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.weghorn@posteo.de>
This commit is contained in:
Michael Weghorn
2025-04-18 23:49:24 +02:00
parent f91611df0c
commit d3ef13ac75
3 changed files with 5 additions and 8 deletions
+1 -1
View File
@@ -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();
}
+1 -2
View File
@@ -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();
}
+3 -5
View File
@@ -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();
}
}