summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2017-11-30 10:37:21 +0200
committerMike Kaganski <mike.kaganski@collabora.com>2017-11-30 13:48:50 +0100
commit36423d18267e2ef3373bfb162e9b2e8062d01dd4 (patch)
tree10f977ed772f1826a0720c8cbec80219dab9c542 /sw
parent2c5a3d914ecf681d97a8356db62d49b62b52b465 (diff)
Don't do dynamic_cast twice
Change-Id: I1f1f7c13937af3b84cc1a1eaf2f5036bab774579 Reviewed-on: https://gerrit.libreoffice.org/45556 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/layout/tabfrm.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
index 2e39abf3c40e..6a4654d7e5e8 100644
--- a/sw/source/core/layout/tabfrm.cxx
+++ b/sw/source/core/layout/tabfrm.cxx
@@ -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 );
}
}