diff options
Diffstat (limited to 'basic/source/uno/namecont.cxx')
-rw-r--r-- | basic/source/uno/namecont.cxx | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/basic/source/uno/namecont.cxx b/basic/source/uno/namecont.cxx index c3329d1c47e5..52d3494f23ef 100644 --- a/basic/source/uno/namecont.cxx +++ b/basic/source/uno/namecont.cxx @@ -1909,8 +1909,6 @@ void SfxLibraryContainer::storeLibraries_Impl( const uno::Reference< embed::XSto if( pImplLib->implIsModified() || bComplete ) { -// For the moment don't copy storage (as an optimisation ) -// but instead always write to storage from memory. // Testing pImplLib->implIsModified() is not reliable, // IMHO the value of pImplLib->implIsModified() should // reflect whether the library ( in-memory ) model @@ -1921,9 +1919,14 @@ void SfxLibraryContainer::storeLibraries_Impl( const uno::Reference< embed::XSto // temp storage when saving ( and later sets the root storage of the // library container ) and similar madness in dbaccess means some surgery // is required to make it possible to successfully use this optimisation -#if 0 +// It would be possible to do the implSetModified() call below only +// conditionally, but that would require an additional boolean to be +// passed in via the XStorageBasedDocument::storeLibrariesToStorage()... +// fdo#68983: If there's a password and the password is not known, only +// copying the storage works! // Can we simply copy the storage? - if( !mbOldInfoFormat && !pImplLib->implIsModified() && !mbOasis2OOoFormat && xSourceLibrariesStor.is() ) + if (!mbOldInfoFormat && !pImplLib->isLoadedStorable() && + !mbOasis2OOoFormat && xSourceLibrariesStor.is()) { try { @@ -1936,7 +1939,6 @@ void SfxLibraryContainer::storeLibraries_Impl( const uno::Reference< embed::XSto } } else -#endif { uno::Reference< embed::XStorage > xLibraryStor; if( bStorage ) @@ -3037,6 +3039,11 @@ SfxLibrary::SfxLibrary( ModifiableHelper& _rModifiable, const Type& aType, { } +bool SfxLibrary::isLoadedStorable() +{ + return mbLoaded && (!mbPasswordProtected || mbPasswordVerified); +} + void SfxLibrary::implSetModified( bool _bIsModified ) { if ( mbIsModified == _bIsModified ) |