Kaydet (Commit) 36423d18 authored tarafından Mike Kaganski's avatar Mike Kaganski

Don't do dynamic_cast twice

Change-Id: I1f1f7c13937af3b84cc1a1eaf2f5036bab774579
Reviewed-on: https://gerrit.libreoffice.org/45556Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarMike Kaganski <mike.kaganski@collabora.com>
üst 2c5a3d91
......@@ -259,6 +259,8 @@ static void lcl_InvalidateLowerObjs( SwLayoutFrame& _rLayoutFrame,
pAnchoredObj->UnlockPosition();
pAnchoredObj->InvalidateObjPos();
SwFlyFrame *pFly = dynamic_cast<SwFlyFrame*>(pAnchoredObj);
// move anchored object 'out of range'
if ( _bMoveObjsOutOfRange )
{
......@@ -279,18 +281,16 @@ static void lcl_InvalidateLowerObjs( SwLayoutFrame& _rLayoutFrame,
->Prepare( PREP_FLY_ATTR_CHG,
&(pAnchoredObj->GetFrameFormat()) );
}
if ( dynamic_cast< const SwFlyFrame *>( pAnchoredObj ) != nullptr )
if ( pFly != nullptr )
{
SwFlyFrame *pFly = static_cast<SwFlyFrame*>(pAnchoredObj);
pFly->GetVirtDrawObj()->SetRectsDirty();
pFly->GetVirtDrawObj()->SetChanged();
}
}
// If anchored object is a fly frame, invalidate its lower objects
if ( dynamic_cast< const SwFlyFrame *>( pAnchoredObj ) != nullptr )
if ( pFly != nullptr )
{
SwFlyFrame *pFly = static_cast<SwFlyFrame*>(pAnchoredObj);
::lcl_InvalidateLowerObjs( *pFly, _bMoveObjsOutOfRange, _pPageFrame );
}
}
......
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