diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-03-08 09:03:39 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-03-08 10:01:00 +0100 |
commit | 078c00e3a3c971ac83154948d5f08462532b9dc6 (patch) | |
tree | 684b2621c33ec8ef7c410bc48f5b40237786d10e /sw/source | |
parent | fcd8844cb01722fbc09a9947440912bf57b1b6c7 (diff) |
tdf#97601 sw: don't mark an already modified chart as modified
Regression from commit e2b260fc98e833d4e64426b90992094f2da0498c (sw: let
layout not mark embedded object as modified, 2014-06-03), an infinite
loop was caused by:
1) SwDoc::SetOLEObjModified() triggering the maOLEModifiedIdle Idle
2) which at the end called SwWrtShell::CalcAndSetScale()
3) which at the end called chart::ChartModel::setModified()
4) where chart code called back into SwDoc::SetOLEObjModified() via the
modification listener, and this happened again and again.
The original fix wanted to avoid marking the document as modified
without a user interaction, so fix the bug by only calling setModified()
if it prevents a not-modified -> modified transition. This keeps the
original bug fixed, but prevents the infinite loop, that is always a
modified -> modified transition.
Change-Id: I3b56a91afaacd3e0b7cb646a492fd15f1b5168ee
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/uibase/wrtsh/wrtsh1.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sw/source/uibase/wrtsh/wrtsh1.cxx b/sw/source/uibase/wrtsh/wrtsh1.cxx index 6a089eccc51f..675a4609cbca 100644 --- a/sw/source/uibase/wrtsh/wrtsh1.cxx +++ b/sw/source/uibase/wrtsh/wrtsh1.cxx @@ -656,7 +656,7 @@ void SwWrtShell::CalcAndSetScale( svt::EmbeddedObjectRef& xObj, aSz.Width = aSize.Width(); aSz.Height = aSize.Height(); - // Action 'setVisualAreaSize' doesn't have to change the + // Action 'setVisualAreaSize' doesn't have to turn on the // modified state of the document, either. bool bModified = false; uno::Reference<util::XModifiable> xModifiable(xObj->getComponent(), uno::UNO_QUERY); @@ -664,7 +664,7 @@ void SwWrtShell::CalcAndSetScale( svt::EmbeddedObjectRef& xObj, bModified = xModifiable->isModified(); xObj->setVisualAreaSize( nAspect, aSz ); xModifiable.set(xObj->getComponent(), uno::UNO_QUERY); - if (xModifiable.is()) + if (xModifiable.is() && xModifiable->isModified() && !bModified) xModifiable->setModified(bModified); // #i48419# - action 'UpdateReplacement' doesn't |