remove #if 0 block ( from af34774d26
)
I left in that block in the mentioned commit above for mostly because I preferred a more obvious hack/change to cherry-pick to 4.0 The more I think about this ( despite the still imho problematic setting of the modify state ) I think always writing from memory to the storage is the right thing to do Change-Id: I13c82b9d6b55120482c65fb7a5bfadb2396c347c
This commit is contained in:
@@ -1927,56 +1927,26 @@ void SfxLibraryContainer::storeLibraries_Impl( const uno::Reference< embed::XSto
|
|||||||
|
|
||||||
if( pImplLib->implIsModified() || bComplete )
|
if( pImplLib->implIsModified() || bComplete )
|
||||||
{
|
{
|
||||||
// For the moment don't copy storage (as an optimisation )
|
uno::Reference< embed::XStorage > xLibraryStor;
|
||||||
// but instead always write to storage from memory.
|
if( bStorage )
|
||||||
// Testing pImplLib->implIsModified() is not reliable,
|
|
||||||
// IMHO the value of pImplLib->implIsModified() should
|
|
||||||
// reflect whether the library ( in-memory ) model
|
|
||||||
// is in sync with the library container's own storage. Currently
|
|
||||||
// whenever the library model is written to *any* storage
|
|
||||||
// pImplLib->implSetModified( sal_False ) is called
|
|
||||||
// The way the code works, especially the way that sfx uses
|
|
||||||
// temp storage when saving ( and later sets the root storage of the
|
|
||||||
// library container ) and similar madness in dbaccess means some surgery
|
|
||||||
// is required to make it possible to successfully use this optimisation
|
|
||||||
#if 0
|
|
||||||
// Can we simply copy the storage?
|
|
||||||
if( !mbOldInfoFormat && !pImplLib->implIsModified() && !mbOasis2OOoFormat && xSourceLibrariesStor.is() )
|
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
xSourceLibrariesStor->copyElementTo( rLib.aName, xTargetLibrariesStor, rLib.aName );
|
xLibraryStor = xTargetLibrariesStor->openStorageElement(
|
||||||
}
|
|
||||||
catch( const uno::Exception& )
|
|
||||||
{
|
|
||||||
DBG_UNHANDLED_EXCEPTION();
|
|
||||||
// TODO: error handling?
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
#endif
|
|
||||||
{
|
|
||||||
uno::Reference< embed::XStorage > xLibraryStor;
|
|
||||||
if( bStorage )
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
xLibraryStor = xTargetLibrariesStor->openStorageElement(
|
|
||||||
rLib.aName,
|
rLib.aName,
|
||||||
embed::ElementModes::READWRITE );
|
embed::ElementModes::READWRITE );
|
||||||
}
|
}
|
||||||
catch(const uno::Exception& )
|
catch(const uno::Exception& )
|
||||||
{
|
{
|
||||||
#if OSL_DEBUG_LEVEL > 0
|
#if OSL_DEBUG_LEVEL > 0
|
||||||
Any aError( ::cppu::getCaughtException() );
|
Any aError( ::cppu::getCaughtException() );
|
||||||
SAL_WARN(
|
SAL_WARN(
|
||||||
"basic",
|
"basic",
|
||||||
"couldn't create sub storage for library \""
|
"couldn't create sub storage for library \""
|
||||||
<< rLib.aName << "\". Exception: "
|
<< rLib.aName << "\". Exception: "
|
||||||
<< comphelper::anyToString(aError));
|
<< comphelper::anyToString(aError));
|
||||||
#endif
|
#endif
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Maybe lib is not loaded?!
|
// Maybe lib is not loaded?!
|
||||||
|
Reference in New Issue
Block a user