diff options
author | Andre Fischer <af@apache.org> | 2012-07-09 14:39:47 +0000 |
---|---|---|
committer | Andre Fischer <af@apache.org> | 2012-07-09 14:39:47 +0000 |
commit | 822661c165198467b56fa2a1034ddc002ba99f7e (patch) | |
tree | 97af475967a6bf5c31a38d41fb64bbeebf6ae0ca /comphelper | |
parent | 6ec8398d5e76070a5a48e7e40d0bdbb800b1bf8d (diff) |
#i120168# Do not call storeOwn() when not necessary.
Patch by: lizh.fee
Review by: Andre Fischer
Notes
Notes:
merged as: dbec45e8136a6de7968d93b2fc891d7409133b13
Diffstat (limited to 'comphelper')
-rw-r--r-- | comphelper/source/container/embeddedobjectcontainer.cxx | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/comphelper/source/container/embeddedobjectcontainer.cxx b/comphelper/source/container/embeddedobjectcontainer.cxx index e78a6d6a4112..069d2cb9716e 100644 --- a/comphelper/source/container/embeddedobjectcontainer.cxx +++ b/comphelper/source/container/embeddedobjectcontainer.cxx @@ -1536,7 +1536,29 @@ sal_Bool EmbeddedObjectContainer::StoreChildren(sal_Bool _bOasisFormat,sal_Bool 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& ) { |