Kaydet (Commit) 199eb08b authored tarafından Miklos Vajna's avatar Miklos Vajna

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
üst 383cc9de
......@@ -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();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment