You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by af...@apache.org on 2012/06/13 15:10:23 UTC

svn commit: r1349824 - /incubator/ooo/trunk/main/sfx2/source/doc/objstor.cxx

Author: af
Date: Wed Jun 13 13:10:23 2012
New Revision: 1349824

URL: http://svn.apache.org/viewvc?rev=1349824&view=rev
Log:
#i119492# Reset the "modified" flag for all OLE objects after loading.

          Patch by: Clarence GUO
          Review by: Andre Fischer

Modified:
    incubator/ooo/trunk/main/sfx2/source/doc/objstor.cxx

Modified: incubator/ooo/trunk/main/sfx2/source/doc/objstor.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sfx2/source/doc/objstor.cxx?rev=1349824&r1=1349823&r2=1349824&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sfx2/source/doc/objstor.cxx (original)
+++ incubator/ooo/trunk/main/sfx2/source/doc/objstor.cxx Wed Jun 13 13:10:23 2012
@@ -2351,7 +2351,29 @@ sal_Bool SfxObjectShell::InsertFrom( Sfx
         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&)
         {}
     }