[PATCH] fdo#46939: Crash after trying to rename autotext entry

Dézsi Szabolcs dezsiszabi at hotmail.com
Tue Mar 6 19:20:03 PST 2012


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

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

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


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20120307/7f8574fe/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Fixed-crash-when-renaming-AutoText.patch
Type: text/x-patch
Size: 1173 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20120307/7f8574fe/attachment.bin>

More information about the LibreOffice mailing list