sfx2/source/doc/objstor.cxx | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-)
New commits: commit a666862deffa33013d3df3bb62e87c67f9a89948 Author: Andre Fischer <a...@apache.org> Date: Wed Jun 13 12:10:23 2012 +0000 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 diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx index 223ae5e..0008014 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&) { _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits