diff options
author | Michael Stahl <mstahl@redhat.com> | 2016-03-04 23:01:18 +0100 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2016-03-10 19:42:01 +0100 |
commit | 42eaaa3ee5d14433488ac9b75204c68e47c4393e (patch) | |
tree | 7a872dbaebbbe3bd47b58fe943dce03c2e616992 /basic | |
parent | 31313fbb42a2c49fc4e3c6d1cedbff6b82138b95 (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/23042
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
(cherry picked from commit b3f2b2529dc4ed313f423d29551577b6dfed4258)
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 ab47f0146db2..c23c09e68ed6 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 { |