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/qa/extras | |
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/qa/extras')
-rw-r--r-- | sw/qa/extras/uiwriter/uiwriter2.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sw/qa/extras/uiwriter/uiwriter2.cxx b/sw/qa/extras/uiwriter/uiwriter2.cxx index a3f63a80d816..8461ef96197a 100644 --- a/sw/qa/extras/uiwriter/uiwriter2.cxx +++ b/sw/qa/extras/uiwriter/uiwriter2.cxx @@ -1804,7 +1804,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testUnfloatButtonSmallTable) CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), pAnchored->size()); SwAnchoredObject* pAnchoredObj = (*pAnchored)[0]; - SwFlyFrame* pFlyFrame = dynamic_cast<SwFlyFrame*>(pAnchoredObj); + SwFlyFrame* pFlyFrame = pAnchoredObj->DynCastFlyFrame(); CPPUNIT_ASSERT(pFlyFrame); CPPUNIT_ASSERT(!pFlyFrame->IsShowUnfloatButton(pWrtShell)); @@ -1849,7 +1849,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testUnfloatButton) SwAnchoredObject* pAnchoredObj = (*pAnchored)[0]; // The unfloat button is not visible until it gets selected - SwFlyFrame* pFlyFrame = dynamic_cast<SwFlyFrame*>(pAnchoredObj); + SwFlyFrame* pFlyFrame = pAnchoredObj->DynCastFlyFrame(); CPPUNIT_ASSERT_MESSAGE(sFailureMessage.getStr(), pFlyFrame); CPPUNIT_ASSERT_MESSAGE(sFailureMessage.getStr(), !pFlyFrame->IsShowUnfloatButton(pWrtShell)); @@ -1875,7 +1875,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testUnfloatButtonReadOnlyMode) CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), pAnchored->size()); SwAnchoredObject* pAnchoredObj = (*pAnchored)[0]; - SwFlyFrame* pFlyFrame = dynamic_cast<SwFlyFrame*>(pAnchoredObj); + SwFlyFrame* pFlyFrame = pAnchoredObj->DynCastFlyFrame(); CPPUNIT_ASSERT(pFlyFrame); CPPUNIT_ASSERT(!pFlyFrame->IsShowUnfloatButton(pWrtShell)); @@ -1921,7 +1921,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testUnfloating) CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailureMessage.getStr(), static_cast<size_t>(1), pAnchored->size()); SwAnchoredObject* pAnchoredObj = (*pAnchored)[0]; - pFlyFrame = dynamic_cast<SwFlyFrame*>(pAnchoredObj); + pFlyFrame = pAnchoredObj->DynCastFlyFrame(); CPPUNIT_ASSERT_MESSAGE(sFailureMessage.getStr(), pFlyFrame); } |