diff options
author | Michael Stahl <mstahl@redhat.com> | 2016-03-04 23:01:18 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2016-03-09 09:55:10 +0000 |
commit | e93270fae07be68a92bdb7d6d964a54412ce983c (patch) | |
tree | fbaacf52fa7dfcbc2f2c67c1643fa06c041dc0e9 /basic | |
parent | 55ec8dd8af96756b00d5a617dc5a58abe73118d6 (diff) |
basic: tdf#87530 don't copy storage that doesn't exist
If the Basic library is newly created it may not have been stored to the
document storage yet.
(regression from 5246fa262450f686674850c53df666422f441c86)
(cherry picked from commit aeb43916366b293935314efe9454c66b4877b9d1)
tdf#87530 finish the regression test
Need to store the document twice to actually reproduce the bug.
(cherry picked from commit 7faecc70c286c0e1a3068b77ccde771640928b37)
Change-Id: I9c2fc1d7446795b9c1c2224671118b2a671dcad8
Reviewed-on: https://gerrit.libreoffice.org/23040
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'basic')
-rw-r--r-- | basic/source/uno/namecont.cxx | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/basic/source/uno/namecont.cxx b/basic/source/uno/namecont.cxx index e3baba0d260e..fe76af29bb18 100644 --- a/basic/source/uno/namecont.cxx +++ b/basic/source/uno/namecont.cxx @@ -1950,8 +1950,21 @@ void SfxLibraryContainer::storeLibraries_Impl( const uno::Reference< embed::XSto // 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->isLoadedStorable() && - !mbOasis2OOoFormat && xSourceLibrariesStor.is()) + bool isCopyStorage = !mbOldInfoFormat && !mbOasis2OOoFormat + && !pImplLib->isLoadedStorable() + && xSourceLibrariesStor.is() /* null for user profile */; + if (isCopyStorage) + { + try + { + xSourceLibrariesStor->isStorageElement(rLib.aName); + } + catch (container::NoSuchElementException const&) + { + isCopyStorage = false; + } + } + if (isCopyStorage) { try { |