summaryrefslogtreecommitdiff
path: root/sfx2/source/doc/objstor.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sfx2/source/doc/objstor.cxx')
-rw-r--r--sfx2/source/doc/objstor.cxx13
1 files changed, 12 insertions, 1 deletions
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index c6fc52a94038..c1c645562cb4 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -2275,8 +2275,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);
+ }
}
}
}