diff options
Diffstat (limited to 'sw/source/core/table/swtable.cxx')
-rw-r--r-- | sw/source/core/table/swtable.cxx | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sw/source/core/table/swtable.cxx b/sw/source/core/table/swtable.cxx index d122f66fc4e9..ca0efb0f9353 100644 --- a/sw/source/core/table/swtable.cxx +++ b/sw/source/core/table/swtable.cxx @@ -1632,8 +1632,8 @@ SwTableBox::SwTableBox( SwTableBoxFormat* pFormat, const SwNodeIndex &rIdx, // insert into the table const SwTableNode* pTableNd = m_pStartNode->FindTableNode(); OSL_ENSURE( pTableNd, "In which table is that box?" ); - SwTableSortBoxes& rSrtArr = (SwTableSortBoxes&)pTableNd->GetTable(). - GetTabSortBoxes(); + SwTableSortBoxes& rSrtArr = const_cast<SwTableSortBoxes&>(pTableNd->GetTable(). + GetTabSortBoxes()); SwTableBox* p = this; // error: &this rSrtArr.insert( p ); // insert } @@ -1652,8 +1652,8 @@ SwTableBox::SwTableBox( SwTableBoxFormat* pFormat, const SwStartNode& rSttNd, Sw // insert into the table const SwTableNode* pTableNd = m_pStartNode->FindTableNode(); OSL_ENSURE( pTableNd, "In which table is the box?" ); - SwTableSortBoxes& rSrtArr = (SwTableSortBoxes&)pTableNd->GetTable(). - GetTabSortBoxes(); + SwTableSortBoxes& rSrtArr = const_cast<SwTableSortBoxes&>(pTableNd->GetTable(). + GetTabSortBoxes()); SwTableBox* p = this; // error: &this rSrtArr.insert( p ); // insert } @@ -1665,8 +1665,8 @@ void SwTableBox::RemoveFromTable() // remove from table const SwTableNode* pTableNd = m_pStartNode->FindTableNode(); assert(pTableNd && "In which table is that box?"); - SwTableSortBoxes& rSrtArr = (SwTableSortBoxes&)pTableNd->GetTable(). - GetTabSortBoxes(); + SwTableSortBoxes& rSrtArr = const_cast<SwTableSortBoxes&>(pTableNd->GetTable(). + GetTabSortBoxes()); SwTableBox *p = this; // error: &this rSrtArr.erase( p ); // remove m_pStartNode = nullptr; // clear it so this is only run once |