[Libreoffice-commits] core.git: sw/source

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Thu Jul 1 07:51:52 UTC 2021


 sw/source/core/txtnode/ndtxt.cxx                |    4 ++--
 sw/source/uibase/docvw/FrameControlsManager.cxx |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 3d8b07093873e7793b07c5cd10de2ad542d05cdb
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Wed Jun 30 15:48:42 2021 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Thu Jul 1 09:51:19 2021 +0200

    avoid some dynamic_casts
    
    where we know the object must be of the destination type
    
    Change-Id: Ib5c7d1a55a89d77060e4064d3469f706f2ad7040
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118166
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index 170f67e974e8..c1387a1fe2b9 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -4110,7 +4110,7 @@ void SwTextNode::SetListRestart( bool bRestart )
 bool SwTextNode::IsListRestart() const
 {
     const SfxBoolItem& aIsRestartItem =
-        dynamic_cast<const SfxBoolItem&>(GetAttr( RES_PARATR_LIST_ISRESTART ));
+        static_cast<const SfxBoolItem&>(GetAttr( RES_PARATR_LIST_ISRESTART ));
 
     return aIsRestartItem.GetValue();
 }
@@ -4225,7 +4225,7 @@ void SwTextNode::SetCountedInList( bool bCounted )
 bool SwTextNode::IsCountedInList() const
 {
     const SfxBoolItem& aIsCountedInListItem =
-        dynamic_cast<const SfxBoolItem&>(GetAttr( RES_PARATR_LIST_ISCOUNTED ));
+        static_cast<const SfxBoolItem&>(GetAttr( RES_PARATR_LIST_ISCOUNTED ));
 
     return aIsCountedInListItem.GetValue();
 }
diff --git a/sw/source/uibase/docvw/FrameControlsManager.cxx b/sw/source/uibase/docvw/FrameControlsManager.cxx
index 1da032330d57..f66150fc6d73 100644
--- a/sw/source/uibase/docvw/FrameControlsManager.cxx
+++ b/sw/source/uibase/docvw/FrameControlsManager.cxx
@@ -139,7 +139,7 @@ void SwFrameControlsManager::SetPageBreakControl( const SwPageFrame* pPageFrame
         pControl.swap( pNewControl );
     }
 
-    SwPageBreakWin* pWin = dynamic_cast<SwPageBreakWin *>(pControl->GetWindow());
+    SwPageBreakWin* pWin = static_cast<SwPageBreakWin *>(pControl->GetWindow());
     assert (pWin != nullptr);
     pWin->UpdatePosition();
     if (!pWin->IsVisible())


More information about the Libreoffice-commits mailing list