diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-08-24 09:59:43 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-08-24 12:47:52 +0200 |
commit | 35fa0a7369d6ba3a051923c4f813107c16d2c617 (patch) | |
tree | 976fccddf7ac0b3d750230eb41f9bc0091013e6b /sw/source/core/layout/calcmove.cxx | |
parent | 1fd9116fbcd1a8d25f964087cd1d0eb15df8a2d1 (diff) |
reduce cost of dynamic casting to SwFlyFrame
which is often hot on doing document layout
Change-Id: Ie78b6a6da4dba38b4ab682f4e1b9d86cc8171918
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120938
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/core/layout/calcmove.cxx')
-rw-r--r-- | sw/source/core/layout/calcmove.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sw/source/core/layout/calcmove.cxx b/sw/source/core/layout/calcmove.cxx index 004fd4114d5c..39a183f9e38c 100644 --- a/sw/source/core/layout/calcmove.cxx +++ b/sw/source/core/layout/calcmove.cxx @@ -717,7 +717,7 @@ static void lcl_CheckObjects(SwSortedObjs& rSortedObjs, const SwFrame* pFrame, t // #i28701# - consider changed type of <SwSortedObjs> // entries. tools::Long nTmp = 0; - if ( auto pFly = dynamic_cast<SwFlyFrame*>( pObj) ) + if ( auto pFly = pObj->DynCastFlyFrame() ) { if( pFly->getFrameArea().Top() != FAR_AWAY && ( pFrame->IsPageFrame() ? pFly->IsFlyLayFrame() : @@ -1128,7 +1128,7 @@ void SwContentFrame::MakePrtArea( const SwBorderAttrs &rAttrs ) // <SwSortedObjs> entries SwAnchoredObject* pObj = (*GetDrawObjs())[i]; const SwFrameFormat& rFormat = pObj->GetFrameFormat(); - const bool bFly = dynamic_cast<const SwFlyFrame*>( pObj) != nullptr; + const bool bFly = pObj->DynCastFlyFrame() != nullptr; if ((bFly && (FAR_AWAY == pObj->GetObjRect().Width())) || rFormat.GetFrameSize().GetWidthPercent()) { |