sw/inc/tblsel.hxx                  |    2 +-
 sw/source/core/access/acccell.cxx  |    3 +--
 sw/source/core/access/acctable.cxx |    8 +++-----
 3 files changed, 5 insertions(+), 8 deletions(-)

New commits:
commit d3ef13ac75b05b6dadc32a854696d27b3680259e
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Fri Apr 18 20:37:11 2025 +0200
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Fri Apr 18 23:49:24 2025 +0200

    sw: Make CompareSwSelBoxes::operator() params const
    
    ... and drop some const_casts in Writer accessibility code
    that are no longer needed now.
    
    Change-Id: Ifd462ae4a7501d197b6a3678c75ecb967030454d
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184360
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>

diff --git a/sw/inc/tblsel.hxx b/sw/inc/tblsel.hxx
index 892376ba6f48..873c0428a25e 100644
--- a/sw/inc/tblsel.hxx
+++ b/sw/inc/tblsel.hxx
@@ -44,7 +44,7 @@ typedef std::deque< SwCellFrame* > SwCellFrames;
 
 struct CompareSwSelBoxes
 {
-    bool operator()(SwTableBox* const& lhs, SwTableBox* const& rhs) const
+    bool operator()(const SwTableBox* const& lhs, const SwTableBox* const& 
rhs) const
     {
         return lhs->GetSttIdx() < rhs->GetSttIdx();
     }
diff --git a/sw/source/core/access/acccell.cxx 
b/sw/source/core/access/acccell.cxx
index 7483cfb897b6..d826c2083843 100644
--- a/sw/source/core/access/acccell.cxx
+++ b/sw/source/core/access/acccell.cxx
@@ -60,8 +60,7 @@ bool SwAccessibleCell::IsSelected()
         {
             const SwCellFrame *pCFrame =
                 static_cast< const SwCellFrame * >( GetFrame() );
-            SwTableBox *pBox =
-                const_cast< SwTableBox *>( pCFrame->GetTabBox() );
+            const SwTableBox* pBox = pCFrame->GetTabBox();
             SwSelBoxes const& 
rBoxes(pCSh->GetTableCursor()->GetSelectedBoxes());
             bRet = rBoxes.find(pBox) != rBoxes.end();
         }
diff --git a/sw/source/core/access/acctable.cxx 
b/sw/source/core/access/acctable.cxx
index cbe190f5e7be..3ea3b3441e84 100644
--- a/sw/source/core/access/acctable.cxx
+++ b/sw/source/core/access/acctable.cxx
@@ -215,8 +215,7 @@ void SwAccessibleTableData_Impl::GetSelection(
                 OSL_ENSURE( pLower->IsCellFrame(), "lower is not a cell frame" 
);
                 const SwCellFrame *pCFrame =
                         static_cast < const SwCellFrame * >( pLower );
-                SwTableBox *pBox =
-                    const_cast< SwTableBox *>( pCFrame->GetTabBox() );
+                const SwTableBox* pBox = pCFrame->GetTabBox();
                 if( rSelBoxes.find( pBox ) == rSelBoxes.end() )
                 {
                     const Int32Set_Impl rRowsOrCols =
@@ -527,7 +526,7 @@ bool SwAccessibleTable::IsChildSelected( sal_Int64 
nChildIndex ) const
     {
         const SwTableBox* pBox = GetTableBox( nChildIndex );
         OSL_ENSURE( pBox != nullptr, "We need the table box." );
-        bRet = pSelBoxes->find( const_cast<SwTableBox*>( pBox ) ) != 
pSelBoxes->end();
+        bRet = pSelBoxes->find(pBox) != pSelBoxes->end();
     }
 
     return bRet;
@@ -962,8 +961,7 @@ sal_Bool SAL_CALL SwAccessibleTable::isAccessibleSelected(
         if( pSelBoxes )
         {
             const SwCellFrame *pCFrame = static_cast < const SwCellFrame * >( 
pFrame );
-            SwTableBox *pBox =
-                const_cast< SwTableBox *>( pCFrame->GetTabBox() );
+            const SwTableBox* pBox = pCFrame->GetTabBox();
             bRet = pSelBoxes->find( pBox ) != pSelBoxes->end();
         }
     }

Reply via email to