summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorAndre Fischer <af@apache.org>2012-06-13 12:10:23 +0000
committerCaolán McNamara <caolanm@redhat.com>2013-04-12 20:09:12 +0100
commita666862deffa33013d3df3bb62e87c67f9a89948 (patch)
tree345b4c6935dca70aa04e10dc1ca832f7de96c309 /sfx2
parent8e725c7fade01bdf36b11d8f313607971b826669 (diff)
Resolves: #i119492# Reset the modified flag on OLE objects after loading
Patch by: Clarence GUO Review by: Andre Fischer (cherry picked from commit 83777cd6e0f3f1a4458af896fd13344c696ecb1e) Conflicts: sfx2/source/doc/objstor.cxx Change-Id: I51682ace6a5b233270e52070ef39c33480fd27c0
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/doc/objstor.cxx22
1 files changed, 21 insertions, 1 deletions
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index 223ae5e90720..0008014b87e8 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -2256,7 +2256,27 @@ sal_Bool SfxObjectShell::ImportFrom( SfxMedium& rMedium, bool bInsert )
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&)
{