From 199eb08be994ef968eb38f4966bc27ef1756d382 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Thu, 5 Jun 2014 16:25:01 +0200 Subject: 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 --- sw/source/core/layout/anchoreddrawobject.cxx | 4 ++++ 1 file changed, 4 insertions(+) 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(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(); -- cgit v1.2.3