summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
authorSzabolcs Dezsi <dezsiszabi@hotmail.com>2012-03-08 13:47:50 +0000
committerCaolán McNamara <caolanm@redhat.com>2012-03-08 13:48:34 +0000
commit0c075735344122c1c016289951f2bf832cec69a7 (patch)
treefdb03263f333c581cec3f61fed0f54c24b38247d /sw/source
parentdbe20175fed8e82bec3578ae3af800dac7bc45f4 (diff)
Fixed crash when renaming AutoText
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/core/swg/SwXMLTextBlocks.cxx8
1 files changed, 7 insertions, 1 deletions
diff --git a/sw/source/core/swg/SwXMLTextBlocks.cxx b/sw/source/core/swg/SwXMLTextBlocks.cxx
index 1ee655ac45f0..ba3b00a08486 100644
--- a/sw/source/core/swg/SwXMLTextBlocks.cxx
+++ b/sw/source/core/swg/SwXMLTextBlocks.cxx
@@ -218,7 +218,13 @@ sal_uLong SwXMLTextBlocks::Rename( sal_uInt16 nIdx, const String& rNewShort, con
String aNewStreamName( aPackageName ); aNewStreamName += sExt;
xRoot = xBlkRoot->openStorageElement( aOldName, embed::ElementModes::READWRITE );
- xRoot->renameElement ( aOldStreamName, aNewStreamName );
+ try
+ {
+ xRoot->renameElement ( aOldStreamName, aNewStreamName );
+ }
+ catch(const container::ElementExistException&)
+ {
+ }
uno::Reference < embed::XTransactedObject > xTrans( xRoot, uno::UNO_QUERY );
if ( xTrans.is() )
xTrans->commit();