summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndre Fischer <af@apache.org>2012-06-13 12:10:23 +0000
committerAndre Fischer <af@apache.org>2012-06-13 12:10:23 +0000
commit83777cd6e0f3f1a4458af896fd13344c696ecb1e (patch)
treea35529d2d92c95c9aab561a4b4b174e7f36fa360
parentc6302d8cf8522034ab795e13fa6bece88ab9057c (diff)
#i119492# Reset the "modified" flag for all OLE objects after loading.
Patch by: Clarence GUO Review by: Andre Fischer
Notes
-rw-r--r--sfx2/source/doc/objstor.cxx24
1 files changed, 23 insertions, 1 deletions
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index 0c02ced825e6..9fb811725369 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -2351,7 +2351,29 @@ sal_Bool SfxObjectShell::InsertFrom( SfxMedium& rMedium )
aArgs[nEnd-1].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "InsertMode" ) );
aArgs[nEnd-1].Value <<= (sal_Bool) sal_True;
- return xLoader->filter( aArgs );
+//-> #i119492
+// return xLoader->filter( aArgs );
+// 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 < ::rtl::OUString > aNames = GetEmbeddedObjectContainer().GetObjectNames();
+ for ( sal_Int32 n = 0; n < aNames.getLength(); n++ )
+ {
+ ::rtl::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;
+//<- #i119492
}catch(const uno::Exception&)
{}
}