summaryrefslogtreecommitdiff
path: root/basic
diff options
context:
space:
mode:
authorLionel Elie Mamane <lionel@mamane.lu>2014-09-04 11:56:12 +0200
committerAndras Timar <andras.timar@collabora.com>2014-10-14 15:27:44 +0200
commit68102b7f2d0b5b088208d1f2544121a5553ebfee (patch)
tree461fcdf48bef6b61015b097118b1c339edc81549 /basic
parent3c7a6848261d48dc8c2de9498be25310833610c5 (diff)
fdo#52076 remove Library dir when no library
when saving to same storage (in place) we already did that when empty "Standard" was the only library, but not when there was no library... Cannot get through that state in through UI, but possible through scripting. Change-Id: I0f1129e034ac31b3eaf6bd388a03aee5aae5b87e Reviewed-on: https://gerrit.libreoffice.org/11276 Reviewed-by: Muthu Subramanian K <muthusuba@gmail.com> 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.cxx17
1 files changed, 11 insertions, 6 deletions
diff --git a/basic/source/uno/namecont.cxx b/basic/source/uno/namecont.cxx
index abdd3d5c4595..61672d3c6c1a 100644
--- a/basic/source/uno/namecont.cxx
+++ b/basic/source/uno/namecont.cxx
@@ -1795,18 +1795,22 @@ void SfxLibraryContainer::storeLibraries_Impl( const uno::Reference< embed::XSto
nLibsToSave--;
}
}
- if( !nLibsToSave )
- {
- return;
- }
- boost::scoped_ptr< ::xmlscript::LibDescriptorArray > pLibArray(new ::xmlscript::LibDescriptorArray(nLibsToSave));
-
// Write to storage?
bool bStorage = i_rStorage.is();
uno::Reference< embed::XStorage > xSourceLibrariesStor;
uno::Reference< embed::XStorage > xTargetLibrariesStor;
OUString sTempTargetStorName;
const bool bInplaceStorage = bStorage && ( i_rStorage == mxStorage );
+
+ if( nLibsToSave == 0 )
+ {
+ if ( bInplaceStorage && mxStorage->hasByName(maLibrariesDir) )
+ {
+ mxStorage->removeElement(maLibrariesDir);
+ }
+ return;
+ }
+
if ( bStorage )
{
// Don't write if only empty standard lib exists
@@ -1884,6 +1888,7 @@ void SfxLibraryContainer::storeLibraries_Impl( const uno::Reference< embed::XSto
int iArray = 0;
pName = aNames.getConstArray();
::xmlscript::LibDescriptor aLibDescriptorForExtensionLibs;
+ boost::scoped_ptr< ::xmlscript::LibDescriptorArray > pLibArray(new ::xmlscript::LibDescriptorArray(nLibsToSave));
for( ; pName != pNamesEnd; ++pName )
{
SfxLibrary* pImplLib = getImplLib( *pName );