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/07/09 17:39:47 UTC

svn commit: r1359225 - /incubator/ooo/trunk/main/comphelper/source/container/embeddedobjectcontainer.cxx

Author: af
Date: Mon Jul  9 15:39:47 2012
New Revision: 1359225

URL: http://svn.apache.org/viewvc?rev=1359225&view=rev
Log:
#i120168# Do not call storeOwn() when not necessary.

          Patch by: lizh.fee
          Review by: Andre Fischer

Modified:
    incubator/ooo/trunk/main/comphelper/source/container/embeddedobjectcontainer.cxx

Modified: incubator/ooo/trunk/main/comphelper/source/container/embeddedobjectcontainer.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/comphelper/source/container/embeddedobjectcontainer.cxx?rev=1359225&r1=1359224&r2=1359225&view=diff
==============================================================================
--- incubator/ooo/trunk/main/comphelper/source/container/embeddedobjectcontainer.cxx (original)
+++ incubator/ooo/trunk/main/comphelper/source/container/embeddedobjectcontainer.cxx Mon Jul  9 15:39:47 2012
@@ -1536,7 +1536,29 @@ sal_Bool EmbeddedObjectContainer::StoreC
                 try
                 {
                     //TODO/LATER: only storing if changed!
-                    xPersist->storeOwn();
+                    //xPersist->storeOwn();	//commented, i120168
+		    
+		    // begin:all charts will be persited as xml format on disk when saving, which is time consuming.
+                    // '_bObjectsOnly' mean we are storing to alien formats.
+                    //  'isStorageElement' mean current object is NOT an MS OLE format. (may also include in future), i120168
+                    if (_bObjectsOnly && (nCurState == embed::EmbedStates::LOADED || nCurState == embed::EmbedStates::RUNNING)
+                        && (pImpl->mxStorage->isStorageElement( *pIter ) ))
+                    {
+                        uno::Reference< util::XModifiable > xModifiable( xObj->getComponent(), uno::UNO_QUERY );
+                        if ( xModifiable.is() && xModifiable->isModified())
+                        {
+                            xPersist->storeOwn();
+                        }
+                        else
+                        {
+                            //do nothing.embeded model is not modified, no need to persist.
+                        }
+                    }
+                    else //the embeded object is in active status, always store back it.
+                    {
+                        xPersist->storeOwn(); 
+                    } 
+                    //end i120168					
                 }
                 catch( uno::Exception& )
                 {