sw/source/core/inc/layfrm.hxx |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

New commits:
commit a06f0cf848dc58f231285a3e761cb38446fc3649
Author:     Mike Kaganski <[email protected]>
AuthorDate: Sun Jan 25 13:01:42 2026 +0100
Commit:     Mike Kaganski <[email protected]>
CommitDate: Sun Jan 25 14:38:23 2026 +0100

    Use std::as_const instead of static_cast
    
    Makes the intent more explicit.
    
    Change-Id: I5654d2138e4fc1865c4db12349622694a8302b98
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198062
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <[email protected]>

diff --git a/sw/source/core/inc/layfrm.hxx b/sw/source/core/inc/layfrm.hxx
index bf24ab7e928b..217f8b0c848b 100644
--- a/sw/source/core/inc/layfrm.hxx
+++ b/sw/source/core/inc/layfrm.hxx
@@ -22,6 +22,8 @@
 #include "frame.hxx"
 #include <swdllapi.h>
 
+#include <utility>
+
 class SwAnchoredObject;
 class SwContentFrame;
 class SwFormatCol;
@@ -189,17 +191,17 @@ public:
  */
 inline SwContentFrame* SwLayoutFrame::ContainsContent()
 {
-    return const_cast<SwContentFrame*>(static_cast<const 
SwLayoutFrame*>(this)->ContainsContent());
+    return const_cast<SwContentFrame*>(std::as_const(*this).ContainsContent());
 }
 
 inline SwCellFrame* SwLayoutFrame::FirstCell()
 {
-    return const_cast<SwCellFrame*>(static_cast<const 
SwLayoutFrame*>(this)->FirstCell());
+    return const_cast<SwCellFrame*>(std::as_const(*this).FirstCell());
 }
 
 inline SwFrame* SwLayoutFrame::ContainsAny( const bool 
_bInvestigateFootnoteForSections )
 {
-    return const_cast<SwFrame*>(static_cast<const 
SwLayoutFrame*>(this)->ContainsAny( _bInvestigateFootnoteForSections ));
+    return 
const_cast<SwFrame*>(std::as_const(*this).ContainsAny(_bInvestigateFootnoteForSections));
 }
 
 /**
@@ -217,7 +219,7 @@ inline bool SwFrame::IsPageBodyFrame() const
 
 inline SwFrame* SwLayoutFrame::GetLastLower()
 {
-    return const_cast<SwFrame*>(static_cast<const 
SwLayoutFrame*>(this)->GetLastLower());
+    return const_cast<SwFrame*>(std::as_const(*this).GetLastLower());
 }
 
 #endif // INCLUDED_SW_SOURCE_CORE_INC_LAYFRM_HXX

Reply via email to