summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLionel Elie Mamane <lionel@mamane.lu>2013-08-02 23:33:47 +0200
committerMiklos Vajna <vmiklos@suse.cz>2013-08-06 08:45:49 +0000
commita05a4a7d546c8ed6d106e7b2d81aac83f87b3b92 (patch)
tree378b4d31c2be7b2e379b2ee1abde4f0f7abf3cc0
parentd185b1d2ae6c24ec8c9a133741ad3dba9e5dc66e (diff)
fdo#67685 open xSourceLibrariesStor only when needed
else it keeps loadLibrary from completing, because the latter cannot open the storage because it is already open in read/write mode. Change-Id: Icd0aabfff6e67af2c38a8f9185f8485b46ab1516 Reviewed-on: https://gerrit.libreoffice.org/5262 Reviewed-by: Miklos Vajna <vmiklos@suse.cz> Tested-by: Miklos Vajna <vmiklos@suse.cz>
-rw-r--r--basic/source/uno/namecont.cxx30
1 files changed, 15 insertions, 15 deletions
diff --git a/basic/source/uno/namecont.cxx b/basic/source/uno/namecont.cxx
index 4dcf9c429917..816a542611c4 100644
--- a/basic/source/uno/namecont.cxx
+++ b/basic/source/uno/namecont.cxx
@@ -1877,21 +1877,6 @@ void SfxLibraryContainer::storeLibraries_Impl( const uno::Reference< embed::XSto
DBG_UNHANDLED_EXCEPTION();
return;
}
-
- // open the source storage which might be used to copy yet-unmodified libraries
- try
- {
- if ( mxStorage->hasByName( maLibrariesDir ) || bInplaceStorage )
- {
- xSourceLibrariesStor = mxStorage->openStorageElement( maLibrariesDir,
- bInplaceStorage ? embed::ElementModes::READWRITE : embed::ElementModes::READ );
- }
- }
- catch( const uno::Exception& )
- {
- DBG_UNHANDLED_EXCEPTION();
- return;
- }
}
int iArray = 0;
@@ -1991,6 +1976,21 @@ void SfxLibraryContainer::storeLibraries_Impl( const uno::Reference< embed::XSto
// then we need to clean up the temporary storage we used for this
if ( bInplaceStorage && !sTempTargetStorName.isEmpty() )
{
+ // open the source storage which might be used to copy yet-unmodified libraries
+ try
+ {
+ if ( mxStorage->hasByName( maLibrariesDir ) || bInplaceStorage )
+ {
+ xSourceLibrariesStor = mxStorage->openStorageElement( maLibrariesDir,
+ bInplaceStorage ? embed::ElementModes::READWRITE : embed::ElementModes::READ );
+ }
+ }
+ catch( const uno::Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ return;
+ }
+
SAL_WARN_IF(
!xSourceLibrariesStor.is(), "basic",
("SfxLibrariesContainer::storeLibraries_impl: unexpected: we should"