diff options
author | Szabolcs Dezsi <dezsiszabi@hotmail.com> | 2012-03-08 13:47:50 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-03-08 13:48:34 +0000 |
commit | 0c075735344122c1c016289951f2bf832cec69a7 (patch) | |
tree | fdb03263f333c581cec3f61fed0f54c24b38247d /sw | |
parent | Resolves: fdo#46939 don't rename autotext when source and dest are the same (diff) | |
download | core-0c075735344122c1c016289951f2bf832cec69a7.tar.gz core-0c075735344122c1c016289951f2bf832cec69a7.zip |
Fixed crash when renaming AutoText
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/swg/SwXMLTextBlocks.cxx | 8 |
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(); |