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
This commit is contained in:
Miklos Vajna 2014-06-05 16:25:01 +02:00
parent 383cc9deee
commit 199eb08be9

View File

@ -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();