Kaydet (Commit) a666862d authored tarafından Andre Fischer's avatar Andre Fischer Kaydeden (comit) Caolán McNamara

Resolves: #i119492# Reset the modified flag on OLE objects after loading

Patch by: Clarence GUO
Review by: Andre Fischer
(cherry picked from commit 83777cd6)

Conflicts:
	sfx2/source/doc/objstor.cxx

Change-Id: I51682ace6a5b233270e52070ef39c33480fd27c0
üst 8e725c7f
...@@ -2256,7 +2256,27 @@ sal_Bool SfxObjectShell::ImportFrom( SfxMedium& rMedium, bool bInsert ) ...@@ -2256,7 +2256,27 @@ sal_Bool SfxObjectShell::ImportFrom( SfxMedium& rMedium, bool bInsert )
aArgs[nEnd-1].Value <<= (sal_Bool) sal_True; aArgs[nEnd-1].Value <<= (sal_Bool) sal_True;
} }
return xLoader->filter( aArgs ); // #i119492# During loading, some OLE objects like chart will be set
// modified flag, so needs to reset the flag to false after loading
sal_Bool bRtn = xLoader->filter( aArgs );
uno::Sequence < OUString > aNames = GetEmbeddedObjectContainer().GetObjectNames();
for ( sal_Int32 n = 0; n < aNames.getLength(); ++n )
{
OUString aName = aNames[n];
uno::Reference < embed::XEmbeddedObject > xObj = GetEmbeddedObjectContainer().GetEmbeddedObject( aName );
OSL_ENSURE( xObj.is(), "An empty entry in the embedded objects list!\n" );
if ( xObj.is() )
{
sal_Int32 nState = xObj->getCurrentState();
if ( nState == embed::EmbedStates::LOADED || nState == embed::EmbedStates::RUNNING ) // means that the object is not active
{
uno::Reference< util::XModifiable > xModifiable( xObj->getComponent(), uno::UNO_QUERY );
if ( xModifiable.is() )
xModifiable->setModified(sal_False);
}
}
}
return bRtn;
} }
catch (const packages::zip::ZipIOException&) catch (const packages::zip::ZipIOException&)
{ {
......
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