diff options
author | Michael Stahl <mstahl@redhat.com> | 2016-03-04 23:01:18 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2016-03-07 12:05:32 +0100 |
commit | aeb43916366b293935314efe9454c66b4877b9d1 (patch) | |
tree | ee57c63305941e55ef111faa640081f96190c41d /basic | |
parent | 4b8c29015d7c70121a161da0f3a85fa4ea0c5987 (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)
Change-Id: I9c2fc1d7446795b9c1c2224671118b2a671dcad8
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 b83344a3ed33..9608fa15bdda 100644 --- a/basic/source/uno/namecont.cxx +++ b/basic/source/uno/namecont.cxx @@ -1946,8 +1946,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 { |