https://bugs.freedesktop.org/show_bug.cgi?id=46939

--- Comment #4 from Szabolcs Dézsi <[email protected]> 2012-03-06 19:17:20 
PST ---
Created attachment 58098
  --> https://bugs.freedesktop.org/attachment.cgi?id=58098
No longer crashes when renaming AutoTexts.

Hi!

So... after a long debugging session, I managed to trace the crash all the way
from glossary.cxx through
gloshdl.cxx->swblock.cxx->shellio.cxx->SwXMLTextBlocks.cxx to storage.cxx.

First of all, the crash only happens when I rename an AutoText but set the
shortcut to something already existing.

storage.cxx:3282 here's where the exception throw happens. Although don't know
why. Someone already was thinking about this very same question, hence the
question marks in the comments at the end of the line :)
This thrown exception is caught a few lines later only to create a log entry,
and to be rethrown. And this rethrown exception is not handled. -> that is our
problem.

So I added a try catch block in the nearest place (not in xstorage.cxx because
someone might want to catch that rethrown exception elsewhere).
And that nearest place is: SwXMLTextBlocks.cxx:218
xRoot->renameElement ( aOldStreamName, aNewStreamName );

It can be seen a few lines later, that xBlkRoot is handled the same way,
catching a container::ElementExistException, but doing nothing in the catch
block.

I tested it, it worked for me. At least I think it's working, if you spot any
errors, just let me know.

Szabolcs

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

Reply via email to