diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-06-21 13:18:00 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-06-21 15:08:47 +0200 |
commit | 2e6e87decdb87221a7b832958e03195b1d8fc133 (patch) | |
tree | 45bc9fe779c5175b2f27dfd4fec4081869b52859 /sw | |
parent | 3ffb7efa95d900db6fdd7d8443535988adb2be70 (diff) |
replace dynamic_cast<SwLayoutFrame> with cheaper check
Change-Id: I2102d27fe2b38e3787e39a2b7234991a57c30d99
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117578
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/layout/pagechg.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/layout/paintfrm.cxx | 7 | ||||
-rw-r--r-- | sw/source/core/layout/sectfrm.cxx | 5 |
3 files changed, 7 insertions, 7 deletions
diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx index d699d59ecb80..6fa74682c675 100644 --- a/sw/source/core/layout/pagechg.cxx +++ b/sw/source/core/layout/pagechg.cxx @@ -2085,7 +2085,7 @@ static void lcl_MoveAllLowers( SwFrame* pFrame, const Point& rOffset ) lcl_MoveAllLowerObjs( pFrame, rOffset ); // finally, for layout frames we have to call this function recursively: - if ( dynamic_cast< const SwLayoutFrame *>( pFrame ) != nullptr ) + if ( pFrame && pFrame->IsLayoutFrame() ) { SwFrame* pLowerFrame = pFrame->GetLower(); while ( pLowerFrame ) diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx index 2243f2084226..982cd95f98af 100644 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -2423,10 +2423,11 @@ void SwTabFramePainter::HandleFrame(const SwLayoutFrame& rLayoutFrame, const SwR const SwFrame* pLower = rLayoutFrame.Lower(); while ( pLower ) { - const SwLayoutFrame* pLowerLayFrame = dynamic_cast<const SwLayoutFrame*>(pLower); - if ( pLowerLayFrame && !pLowerLayFrame->IsTabFrame() ) + if (pLower->IsLayoutFrame() && !pLower->IsTabFrame()) + { + const SwLayoutFrame* pLowerLayFrame = static_cast<const SwLayoutFrame*>(pLower); HandleFrame(*pLowerLayFrame, rPaintArea); - + } pLower = pLower->GetNext(); } } diff --git a/sw/source/core/layout/sectfrm.cxx b/sw/source/core/layout/sectfrm.cxx index 079e7de2b264..052626d8ac82 100644 --- a/sw/source/core/layout/sectfrm.cxx +++ b/sw/source/core/layout/sectfrm.cxx @@ -1241,10 +1241,9 @@ class ExtraFormatToPositionObjs pAnchoredObj->SetClearedEnvironment( false ); } } - SwLayoutFrame* pLayoutFrame = dynamic_cast<SwLayoutFrame*>(&rFrame); - if ( pLayoutFrame != nullptr ) + if ( rFrame.IsLayoutFrame() ) { - SwFrame* pLowerFrame = pLayoutFrame->GetLower(); + SwFrame* pLowerFrame = rFrame.GetLower(); while ( pLowerFrame != nullptr ) { InitObjs( *pLowerFrame ); |