summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-06-05 16:25:01 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-06-05 16:39:36 +0200
commit199eb08be994ef968eb38f4966bc27ef1756d382 (patch)
treeaf06ab2755ef1ae0b3efe98dadeb09cb690da647
parent383cc9deee599a59ee2c8fcb15ab3ab6e1d9bee7 (diff)
SwAnchoredDrawObject::GetObjBoundRect: avoid SwDoc::SetModified()
This is a const method, but it does a const_cast to still resize an object... if that's so, then we should ensure that the "is modified" flag of SwDoc is untouched. CppunitTest_sw_ooxmlimport's testChartSize is a reproducer for this, when shape text is imported as textbox. Change-Id: I6dedb31520a14127ca91782874c285f6e0f93c65
-rw-r--r--sw/source/core/layout/anchoreddrawobject.cxx4
1 files changed, 4 insertions, 0 deletions
diff --git a/sw/source/core/layout/anchoreddrawobject.cxx b/sw/source/core/layout/anchoreddrawobject.cxx
index 72f947ee76d4..1e011aaa6efd 100644
--- a/sw/source/core/layout/anchoreddrawobject.cxx
+++ b/sw/source/core/layout/anchoreddrawobject.cxx
@@ -655,9 +655,13 @@ const SwRect SwAnchoredDrawObject::GetObjBoundRect() const
if ( nTargetWidth != aCurrObjRect.GetWidth( ) || nTargetHeight != aCurrObjRect.GetHeight( ) )
{
+ SwDoc* pDoc = const_cast<SwDoc*>(GetPageFrm()->GetFmt()->GetDoc());
+ bool bModified = pDoc->IsModified();
const_cast< SdrObject* >( GetDrawObj() )->Resize( aCurrObjRect.TopLeft(),
Fraction( nTargetWidth, aCurrObjRect.GetWidth() ),
Fraction( nTargetHeight, aCurrObjRect.GetHeight() ), false );
+ if (!bModified)
+ pDoc->ResetModified();
}
}
return GetDrawObj()->GetCurrentBoundRect();