Kaydet (Commit) 6238cfe2 authored tarafından Miklos Vajna's avatar Miklos Vajna

fdo#58949 EmbeddedObjectContainer: guard against embed::WrongStateException

The problem was that in case an exception was thrown, it was only caught
outside the loop, so in case any error occurred, we didn't even try to
export the remaining objects. At least in case of
embed::WrongStateException, this is safe to do.

Change-Id: I71a7abc45a89bebc667664bc001245bb886a8d83
üst 484d75fe
......@@ -1417,10 +1417,14 @@ sal_Bool EmbeddedObjectContainer::StoreAsChildren(sal_Bool _bOasisFormat,sal_Boo
aArgs[2].Value <<= xStream;
}
xPersist->storeAsEntry( _xStorage,
xPersist->getEntryName(),
uno::Sequence< beans::PropertyValue >(),
aArgs );
try
{
xPersist->storeAsEntry( _xStorage, xPersist->getEntryName(), uno::Sequence< beans::PropertyValue >(), aArgs );
}
catch (const embed::WrongStateException& e)
{
SAL_WARN("comphelper", "failed to store '" << *pIter << "'");
}
}
if ( bSwitchBackToLoaded )
......@@ -1432,10 +1436,11 @@ sal_Bool EmbeddedObjectContainer::StoreAsChildren(sal_Bool _bOasisFormat,sal_Boo
bResult = aCnt.CommitImageSubStorage();
}
catch (const uno::Exception&)
catch (const uno::Exception& e)
{
// TODO/LATER: error handling
bResult = sal_False;
SAL_WARN("comphelper", "failed. Message: " << e.Message);
}
// the old SO6 format does not store graphical replacements
......
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