diff options
Diffstat (limited to 'sfx2/source')
-rw-r--r-- | sfx2/source/doc/objstor.cxx | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx index be8ecd062f66..7bc028d85229 100644 --- a/sfx2/source/doc/objstor.cxx +++ b/sfx2/source/doc/objstor.cxx @@ -2281,8 +2281,19 @@ bool SfxObjectShell::ImportFrom(SfxMedium& rMedium, 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() ) + if (xModifiable.is() && xModifiable->isModified()) + { + uno::Reference<embed::XEmbedPersist> const xPers(xObj, uno::UNO_QUERY); + if (xPers.is()) + { // store it before resetting modified! + xPers->storeOwn(); + } + else + { + SAL_WARN("sfx.doc", "Modified object without persistence!"); + } xModifiable->setModified(sal_False); + } } } } |