Kaydet (Commit) a7fbabda authored tarafından Lionel Elie Mamane's avatar Lionel Elie Mamane

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
üst 513d95f3
......@@ -1817,18 +1817,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
......@@ -1906,6 +1910,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 );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment