sw: Return reference in SwCellFrame::GetTabBox

Change-Id: I7d258afa33539b132b03e9b7b8c352356bfc026e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200930
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
This commit is contained in:
Michael Weghorn
2026-03-04 12:08:24 +01:00
parent 1d5784045e
commit 7a7b9039b3
20 changed files with 106 additions and 109 deletions
+4 -4
View File
@@ -57,9 +57,9 @@ bool SwAccessibleCell::IsSelected()
{
if( pCSh->IsTableMode() )
{
const SwTableBox* pBox = GetCellFrame().GetTabBox();
const SwTableBox& rBox = GetCellFrame().GetTabBox();
SwSelBoxes const& rBoxes(pCSh->GetTableCursor()->GetSelectedBoxes());
bRet = rBoxes.find(pBox) != rBoxes.end();
bRet = rBoxes.find(&rBox) != rBoxes.end();
}
}
@@ -96,7 +96,7 @@ SwAccessibleCell::SwAccessibleCell(std::shared_ptr<SwAccessibleMap> const& pInit
, m_aSelectionHelper( *this )
, m_bIsSelected( false )
{
OUString sBoxName( pCellFrame->GetTabBox()->GetName() );
OUString sBoxName(pCellFrame->GetTabBox().GetName());
SetName( sBoxName );
m_bIsSelected = IsSelected();
@@ -255,7 +255,7 @@ const SwCellFrame& SwAccessibleCell::GetCellFrame() const
SwFrameFormat* SwAccessibleCell::GetTableBoxFormat() const
{
return GetCellFrame().GetTabBox()->GetFrameFormat();
return GetCellFrame().GetTabBox().GetFrameFormat();
}
//Implement TableCell currentValue
+1 -1
View File
@@ -125,7 +125,7 @@ bool SwAccessibleChild::IsFrameAccessible(const SwFrame& rFrame, bool bPagePrevi
return false;
if (rFrame.IsCellFrame()
&& static_cast<const SwCellFrame&>(rFrame).GetTabBox()->GetSttNd() == nullptr)
&& static_cast<const SwCellFrame&>(rFrame).GetTabBox().GetSttNd() == nullptr)
return false;
if (rFrame.IsInCoveredCell())
+5 -5
View File
@@ -215,8 +215,8 @@ void SwAccessibleTableData_Impl::GetSelection(
OSL_ENSURE( pLower->IsCellFrame(), "lower is not a cell frame" );
const SwCellFrame *pCFrame =
static_cast < const SwCellFrame * >( pLower );
const SwTableBox* pBox = pCFrame->GetTabBox();
if( rSelBoxes.find( pBox ) == rSelBoxes.end() )
const SwTableBox& rBox = pCFrame->GetTabBox();
if (rSelBoxes.find(&rBox) == rSelBoxes.end())
{
const Int32Set_Impl rRowsOrCols =
bColumns ? maColumns : maRows;
@@ -510,7 +510,7 @@ const SwTableBox* SwAccessibleTable::GetTableBox( sal_Int64 nChildIndex ) const
{
const SwCellFrame* pCellFrame =
static_cast<const SwCellFrame*>( pChildFrame );
pBox = pCellFrame->GetTabBox();
pBox = &pCellFrame->GetTabBox();
}
}
@@ -960,8 +960,8 @@ sal_Bool SAL_CALL SwAccessibleTable::isAccessibleSelected(
if( pSelBoxes )
{
const SwCellFrame *pCFrame = static_cast < const SwCellFrame * >( pFrame );
const SwTableBox* pBox = pCFrame->GetTabBox();
bRet = pSelBoxes->find( pBox ) != pSelBoxes->end();
const SwTableBox& rBox = pCFrame->GetTabBox();
bRet = pSelBoxes->find(&rBox) != pSelBoxes->end();
}
}
+4 -4
View File
@@ -216,9 +216,9 @@ bool SwCursorShell::SelTableRowOrCol( bool bRow, bool bRowSimple )
else
{
// will become point of table cursor
pStart = aCells[bVert ? 0 : (bRow ? 2 : 1)]->GetTabBox();
pStart = &aCells[bVert ? 0 : (bRow ? 2 : 1)]->GetTabBox();
// will become mark of table cursor
pEnd = aCells[bVert ? 3 : (bRow ? 1 : 2)]->GetTabBox();
pEnd = &aCells[bVert ? 3 : (bRow ? 1 : 2)]->GetTabBox();
}
}
@@ -761,7 +761,7 @@ OUString SwCursorShell::GetBoxNms() const
if( !pFrame )
return sNm;
sNm = static_cast<SwCellFrame*>(pFrame)->GetTabBox()->GetName() + ":";
sNm = static_cast<SwCellFrame*>(pFrame)->GetTabBox().GetName() + ":";
pPos = m_pTableCursor->End();
}
else
@@ -782,7 +782,7 @@ OUString SwCursorShell::GetBoxNms() const
} while ( pFrame && !pFrame->IsCellFrame() );
if( pFrame )
sNm += static_cast<SwCellFrame*>(pFrame)->GetTabBox()->GetName();
sNm += static_cast<SwCellFrame*>(pFrame)->GetTabBox().GetName();
}
return sNm;
}
+7 -7
View File
@@ -2686,7 +2686,7 @@ void SwDoc::GetTabCols( SwTabCols &rFill, const SwCellFrame* pBoxFrame )
return;
SwTabFrame *pTab = const_cast<SwFrame*>(static_cast<SwFrame const *>(pBoxFrame))->ImplFindTabFrame();
const SwTableBox* pBox = pBoxFrame->GetTabBox();
const SwTableBox& rBox = pBoxFrame->GetTabBox();
// Set fixed points, LeftMin in Document coordinates, all others relative
SwRectFnSet aRectFnSet(*pTab);
@@ -2701,7 +2701,7 @@ void SwDoc::GetTabCols( SwTabCols &rFill, const SwCellFrame* pBoxFrame )
rFill.SetRight ( aRectFnSet.GetRight(pTab->getFramePrintArea()));
rFill.SetRightMax( nRightMax - nLeftMin );
pTab->GetTable()->GetTabCols( rFill, pBox );
pTab->GetTable()->GetTabCols(rFill, &rBox);
}
// Here are some little helpers used in SwDoc::GetTabRows
@@ -2726,7 +2726,7 @@ static bool lcl_IsFrameInColumn( const SwCellFrame& rFrame, SwSelBoxes const & r
{
for (size_t i = 0; i < rBoxes.size(); ++i)
{
if ( rFrame.GetTabBox() == rBoxes[ i ] )
if (&rFrame.GetTabBox() == rBoxes[i])
return true;
}
@@ -2877,7 +2877,7 @@ void SwDoc::SetTabCols( const SwTabCols &rNew, bool bCurRowOnly,
if( pBoxFrame )
{
pTab = const_cast<SwFrame*>(static_cast<SwFrame const *>(pBoxFrame))->ImplFindTabFrame();
pBox = pBoxFrame->GetTabBox();
pBox = &pBoxFrame->GetTabBox();
}
else
{
@@ -3013,12 +3013,12 @@ void SwDoc::SetTabRows( const SwTabCols &rNew, bool bCurColOnly,
if ( pContent && pContent->IsTextFrame() )
{
const SwTableBox* pBox = static_cast<const SwCellFrame*>(pFrame)->GetTabBox();
const sal_Int32 nRowSpan = pBox->getRowSpan();
const SwTableBox& rBox = static_cast<const SwCellFrame*>(pFrame)->GetTabBox();
const sal_Int32 nRowSpan = rBox.getRowSpan();
if( nRowSpan > 0 ) // Not overlapped
pTextFrame = static_cast<const SwTextFrame*>(pContent);
if( nRowSpan < 2 ) // Not overlapping for row height
pLine = pBox->GetUpper();
pLine = rBox.GetUpper();
if( pLine && pTextFrame ) // always for old table model
{
// The new row height must not to be calculated from an overlapping box
+6 -6
View File
@@ -918,14 +918,14 @@ void SwDoc::SetTabBorders( const SwCursor& rCursor, const SfxItemSet& rSet )
aBox.SetDistance( pSetBox->GetDistance( k ), k );
}
SwTableBox *pBox = const_cast<SwTableBox*>(pCell->GetTabBox());
SwFrameFormat *pNewFormat = SwTableFormatCmp::FindNewFormat( aFormatCmp, pBox->GetFrameFormat(), nType );
SwTableBox& rBox = const_cast<SwTableBox&>(pCell->GetTabBox());
SwFrameFormat* pNewFormat = SwTableFormatCmp::FindNewFormat(aFormatCmp, rBox.GetFrameFormat(), nType);
if ( nullptr != pNewFormat )
pBox->ChgFrameFormat( static_cast<SwTableBoxFormat*>(pNewFormat) );
rBox.ChgFrameFormat(static_cast<SwTableBoxFormat*>(pNewFormat));
else
{
SwFrameFormat *pOld = pBox->GetFrameFormat();
SwFrameFormat *pNew = pBox->ClaimFrameFormat();
SwFrameFormat* pOld = rBox.GetFrameFormat();
SwFrameFormat* pNew = rBox.ClaimFrameFormat();
pNew->SetFormatAttr( aBox );
aFormatCmp.push_back(std::make_unique<SwTableFormatCmp>(pOld, pNew, nType));
}
@@ -1008,7 +1008,7 @@ void SwDoc::SetTabLineStyle( const SwCursor& rCursor,
if ( pTab->IsFollow() && pTab->IsInHeadline( *pCell ) )
continue;
const_cast<SwTableBox*>(pCell->GetTabBox())->ClaimFrameFormat();
const_cast<SwTableBox&>(pCell->GetTabBox()).ClaimFrameFormat();
SwFrameFormat *pFormat = pCell->GetFormat();
std::unique_ptr<SvxBoxItem> aBox(pFormat->GetBox().Clone());
+6 -6
View File
@@ -313,8 +313,8 @@ bool SwEditShell::GetTableBoxFormulaAttrs( SfxItemSet& rSet ) const
if (pFrame)
{
auto pBox = const_cast<SwTableBox*>(static_cast<SwCellFrame*>(pFrame)->GetTabBox());
aBoxes.insert(pBox);
SwTableBox& rBox = const_cast<SwTableBox&>(static_cast<SwCellFrame*>(pFrame)->GetTabBox());
aBoxes.insert(&rBox);
}
}
@@ -351,8 +351,8 @@ void SwEditShell::SetTableBoxFormulaAttrs( const SfxItemSet& rSet )
} while ( pFrame && !pFrame->IsCellFrame() );
if ( pFrame )
{
SwTableBox *pBox = const_cast<SwTableBox*>(static_cast<SwCellFrame*>(pFrame)->GetTabBox());
aBoxes.insert( pBox );
SwTableBox& rBox = const_cast<SwTableBox&>(static_cast<SwCellFrame*>(pFrame)->GetTabBox());
aBoxes.insert(&rBox);
}
} while( false );
}
@@ -383,7 +383,7 @@ bool SwEditShell::IsTableBoxTextFormat() const
pFrame = pFrame->GetUpper();
} while ( pFrame && !pFrame->IsCellFrame() );
if ( pFrame )
pBox = static_cast<SwCellFrame*>(pFrame)->GetTabBox();
pBox = &static_cast<SwCellFrame*>(pFrame)->GetTabBox();
}
if( !pBox )
@@ -421,7 +421,7 @@ OUString SwEditShell::GetTableBoxText() const
pFrame = pFrame->GetUpper();
} while ( pFrame && !pFrame->IsCellFrame() );
if ( pFrame )
pBox = static_cast<SwCellFrame*>(pFrame)->GetTabBox();
pBox = &static_cast<SwCellFrame*>(pFrame)->GetTabBox();
}
SwNodeOffset nNd;
+21 -22
View File
@@ -762,7 +762,7 @@ void SwFEShell::GetTabCols_(SwTabCols &rToFill, const SwFrame *pBox) const
if (m_pColumnCache->pLastCellFrame != pBox)
{
pTab->GetTable()->GetTabCols( *m_pColumnCache->pLastCols,
static_cast<const SwCellFrame*>(pBox)->GetTabBox(), true);
&static_cast<const SwCellFrame*>(pBox)->GetTabBox(), true);
m_pColumnCache->pLastCellFrame = pBox;
}
rToFill = *m_pColumnCache->pLastCols;
@@ -1153,8 +1153,8 @@ void SwFEShell::UnProtectCells()
} while ( pFrame && !pFrame->IsCellFrame() );
if( pFrame )
{
SwTableBox *pBox = const_cast<SwTableBox*>(static_cast<SwCellFrame*>(pFrame)->GetTabBox());
aBoxes.insert( pBox );
SwTableBox& rBox = const_cast<SwTableBox&>(static_cast<SwCellFrame*>(pFrame)->GetTabBox());
aBoxes.insert(&rBox);
}
}
@@ -1197,8 +1197,8 @@ bool SwFEShell::CanUnProtectCells() const
} while ( pFrame && !pFrame->IsCellFrame() );
if( pFrame )
{
SwTableBox *pBox = const_cast<SwTableBox*>(static_cast<SwCellFrame*>(pFrame)->GetTabBox());
aBoxes.insert( pBox );
SwTableBox& rBox = const_cast<SwTableBox&>(static_cast<SwCellFrame*>(pFrame)->GetTabBox());
aBoxes.insert(&rBox);
}
}
if( !aBoxes.empty() )
@@ -1367,8 +1367,8 @@ bool SwFEShell::IsAdjustCellWidthAllowed( bool bBalance ) const
if (!pFrame)
return false;
SwTableBox *pBox = const_cast<SwTableBox*>(static_cast<SwCellFrame*>(pFrame)->GetTabBox());
aBoxes.insert( pBox );
SwTableBox& rBox = const_cast<SwTableBox&>(static_cast<SwCellFrame*>(pFrame)->GetTabBox());
aBoxes.insert(&rBox);
}
for (SwTableBox *pBox : aBoxes)
@@ -1533,7 +1533,7 @@ bool SwFEShell::DeleteTableSel()
// position they'll be set to the old position
while( !pFrame->IsCellFrame() )
pFrame = pFrame->GetUpper();
ParkCursor( *static_cast<SwCellFrame*>(pFrame)->GetTabBox()->GetSttNd() );
ParkCursor(*static_cast<SwCellFrame*>(pFrame)->GetTabBox().GetSttNd());
bRet = GetDoc()->DeleteRowCol( aBoxes );
@@ -2029,8 +2029,8 @@ bool SwFEShell::SelTableRowCol( const Point& rPt, const Point* pEnd, bool bRowDr
pFrame = static_cast<const SwCellFrame*>( static_cast<const SwLayoutFrame*>( pLower )->Lower() );
pLower = pFrame ? pFrame->Lower() : nullptr;
}
if( pFrame && pFrame->GetTabBox()->GetSttNd() &&
pFrame->GetTabBox()->GetSttNd()->IsInProtectSect() )
if( pFrame && pFrame->GetTabBox().GetSttNd() &&
pFrame->GetTabBox().GetSttNd()->IsInProtectSect() )
pFrame = nullptr;
}
@@ -2149,8 +2149,8 @@ SwTab SwFEShell::WhichMouseTabCol( const Point &rPt ) const
pFrame = static_cast<const SwCellFrame*>(static_cast<const SwLayoutFrame*>(pLower)->Lower());
pLower = pFrame ? pFrame->Lower() : nullptr;
}
if( pFrame && ((pFrame->GetTabBox()->GetSttNd() &&
pFrame->GetTabBox()->GetSttNd()->IsInProtectSect()) || (pFrame->GetTabBox()->getRowSpan() < 0)))
if( pFrame && ((pFrame->GetTabBox().GetSttNd() &&
pFrame->GetTabBox().GetSttNd()->IsInProtectSect()) || (pFrame->GetTabBox().getRowSpan() < 0)))
pFrame = nullptr;
}
@@ -2413,7 +2413,7 @@ void SwFEShell::SetColRowWidthHeight( TableChgWidthHeightType eType, sal_uInt16
/** The cells are destroyed in here */
GetDoc()->SetColRowWidthHeight(
*const_cast<SwTableBox*>(static_cast<SwCellFrame*>(pFrame)->GetTabBox()),
const_cast<SwTableBox&>(static_cast<SwCellFrame*>(pFrame)->GetTabBox()),
eType, nDiff, nLogDiff );
ClearFEShellTabCols(*GetDoc(), nullptr);
@@ -2430,7 +2430,7 @@ static bool lcl_IsFormulaSelBoxes( const SwTable& rTable, const SwTableBoxFormul
{
SwTableBox* pBox = aBoxes[ --nSelBoxes ];
if( std::none_of(rCells.begin(), rCells.end(), [&pBox](SwCellFrame* pFrame) { return pFrame->GetTabBox() == pBox; }) )
if( std::none_of(rCells.begin(), rCells.end(), [&pBox](SwCellFrame* pFrame) { return &pFrame->GetTabBox() == pBox; }) )
return false;
}
@@ -2453,7 +2453,7 @@ void SwFEShell::GetAutoSum( OUString& rFormula ) const
for( size_t n = aCells.size(); n; )
{
SwCellFrame* pCFrame = aCells[ --n ];
sal_uInt16 nBoxW = pCFrame->GetTabBox()->IsFormulaOrValueBox();
sal_uInt16 nBoxW = pCFrame->GetTabBox().IsFormulaOrValueBox();
if( !nBoxW )
break;
@@ -2465,13 +2465,13 @@ void SwFEShell::GetAutoSum( OUString& rFormula ) const
// formula only if box is contained
if( RES_BOXATR_FORMULA == nBoxW &&
!::lcl_IsFormulaSelBoxes( *pTab->GetTable(), pCFrame->
GetTabBox()->GetFrameFormat()->GetTableBoxFormula(), aCells))
GetTabBox().GetFrameFormat()->GetTableBoxFormula(), aCells))
{
nW = RES_BOXATR_VALUE;
// restore previous spaces!
for( size_t i = aCells.size(); n+1 < i; )
{
sFields = "|<" + aCells[--i]->GetTabBox()->GetName() + ">"
sFields = "|<" + aCells[--i]->GetTabBox().GetName() + ">"
+ sFields;
}
}
@@ -2483,7 +2483,7 @@ void SwFEShell::GetAutoSum( OUString& rFormula ) const
// search for values, Value/Formula/Text found -> include
if( RES_BOXATR_FORMULA == nBoxW &&
::lcl_IsFormulaSelBoxes( *pTab->GetTable(), pCFrame->
GetTabBox()->GetFrameFormat()->GetTableBoxFormula(), aCells ))
GetTabBox().GetFrameFormat()->GetTableBoxFormula(), aCells ))
break;
else if( USHRT_MAX != nBoxW )
sFields = OUStringChar(cListDelim) + sFields;
@@ -2497,7 +2497,7 @@ void SwFEShell::GetAutoSum( OUString& rFormula ) const
if( RES_BOXATR_FORMULA == nBoxW )
{
if( !::lcl_IsFormulaSelBoxes( *pTab->GetTable(), pCFrame->
GetTabBox()->GetFrameFormat()->GetTableBoxFormula(), aCells ))
GetTabBox().GetFrameFormat()->GetTableBoxFormula(), aCells ))
{
// redo only for values!
@@ -2506,8 +2506,7 @@ void SwFEShell::GetAutoSum( OUString& rFormula ) const
// restore previous spaces!
for( size_t i = aCells.size(); n+1 < i; )
{
sFields = "|<" + aCells[--i]->GetTabBox()->GetName() + ">"
+ sFields;
sFields = "|<" + aCells[--i]->GetTabBox().GetName() + ">" + sFields;
}
}
else
@@ -2523,7 +2522,7 @@ void SwFEShell::GetAutoSum( OUString& rFormula ) const
// possibly allow texts??
break;
sFields = "<" + pCFrame->GetTabBox()->GetName() + ">" + sFields;
sFields = "<" + pCFrame->GetTabBox().GetName() + ">" + sFields;
}
}
+7 -8
View File
@@ -314,12 +314,12 @@ void GetTableSel( const SwLayoutFrame* pStart, const SwLayoutFrame* pEnd,
OSL_ENSURE( pCell->IsCellFrame(), "Frame without Cell" );
if( ::IsFrameInTableSel( pUnion->GetUnion(), pCell ) )
{
SwTableBox* pBox = const_cast<SwTableBox*>(
SwTableBox& rBox = const_cast<SwTableBox&>(
static_cast<const SwCellFrame*>(pCell)->GetTabBox());
// check for cell protection??
if( !bChkProtected ||
!pBox->GetFrameFormat()->GetProtect().IsContentProtected() )
rBoxes.insert( pBox );
!rBox.GetFrameFormat()->GetProtect().IsContentProtected() )
rBoxes.insert(&rBox);
if ( pCells )
{
@@ -739,7 +739,7 @@ bool GetAutoSumSel( const SwCursorShell& rShell, SwCellFrames& rBoxes )
sal_uInt16 nWhichId = 0;
for( size_t n = rBoxes.size(); n; )
{
nWhichId = rBoxes[ --n ]->GetTabBox()->IsFormulaOrValueBox();
nWhichId = rBoxes[ --n ]->GetTabBox().IsFormulaOrValueBox();
if( USHRT_MAX != nWhichId )
break;
}
@@ -810,7 +810,7 @@ bool GetAutoSumSel( const SwCursorShell& rShell, SwCellFrames& rBoxes )
for( size_t n = rBoxes.size(); n; )
{
nWhichId = rBoxes[ --n ]
->GetTabBox()->IsFormulaOrValueBox();
->GetTabBox().IsFormulaOrValueBox();
if( USHRT_MAX != nWhichId )
break;
}
@@ -990,7 +990,7 @@ void GetMergeSel( const SwPaM& rPam, SwSelBoxes& rBoxes,
if( rUnion.Top() <= pCell->getFrameArea().Top() &&
rUnion.Bottom() >= pCell->getFrameArea().Bottom() )
{
SwTableBox* pBox = const_cast<SwTableBox*>(static_cast<const SwCellFrame*>(pCell)->GetTabBox());
SwTableBox* pBox = &const_cast<SwTableBox&>(static_cast<const SwCellFrame*>(pCell)->GetTabBox());
// only overlap to the right?
if( ( rUnion.Left() - COLFUZZY ) <= pCell->getFrameArea().Left() &&
@@ -1583,8 +1583,7 @@ static void lcl_FindStartEndRow( const SwLayoutFrame *&rpStart,
if( n )
{
const SwCellFrame* pCellFrame = static_cast<const SwCellFrame*>(aSttArr[ n-1 ]);
const SwTableLines& rLns = pCellFrame->
GetTabBox()->GetTabLines();
const SwTableLines& rLns = pCellFrame->GetTabBox().GetTabLines();
if( rLns[ 0 ] == static_cast<const SwRowFrame*>(aSttArr[ n ])->GetTabLine() &&
rLns[ rLns.size() - 1 ] ==
static_cast<const SwRowFrame*>(aEndArr[ n ])->GetTabLine() )
+1 -1
View File
@@ -46,7 +46,7 @@ public:
// #i103961#
virtual void Cut() override;
const SwTableBox* GetTabBox() const { return &m_rTabBox; }
const SwTableBox& GetTabBox() const { return m_rTabBox; }
// used for breaking table rows:
SwCellFrame* GetFollowCell() const;
+2 -2
View File
@@ -541,7 +541,7 @@ static OUString lcl_CellText(const SwCellFrame* pFrame)
OUString result;
int n = 0;
const SwStartNode* pStartNode = pFrame->GetTabBox()->GetSttNd();
const SwStartNode* pStartNode = pFrame->GetTabBox().GetSttNd();
const SwEndNode* pEndNode = pStartNode->EndOfSectionNode();
const SwNodes& nodes = pStartNode->GetNodes();
@@ -567,7 +567,7 @@ static OUString lcl_CellText(const SwCellFrame* pFrame)
static OString lcl_CellInfo(const SwCellFrame* pFrame)
{
const OUString text = "CellInfo: " + pFrame->GetTabBox()->GetName() + " Text: " + lcl_CellText(pFrame);
const OUString text = "CellInfo: " + pFrame->GetTabBox().GetName() + " Text: " + lcl_CellText(pFrame);
return OUStringToOString(text, RTL_TEXTENCODING_ASCII_US);
}
+5 -5
View File
@@ -1843,7 +1843,7 @@ SwCellFrame* SwCellFrame::GetPreviousCell() const
SwRowFrame* pMasterRow = static_cast<SwRowFrame*>(pMaster->GetLastLower());
if ( pMasterRow )
pRet = lcl_FindCorrespondingCellFrame( *static_cast<const SwRowFrame*>(pRow), *this, *pMasterRow, false );
if ( pRet && pRet->GetTabBox()->getRowSpan() < 1 )
if (pRet && pRet->GetTabBox().getRowSpan() < 1)
pRet = &const_cast<SwCellFrame&>(pRet->FindStartEndOfRowSpanCell( true ));
}
}
@@ -1861,7 +1861,7 @@ const SwCellFrame& SwCellFrame::FindStartEndOfRowSpanCell( bool bStart ) const
return *this;
OSL_ENSURE( pTableFrame &&
( (bStart && GetTabBox()->getRowSpan() < 1) ||
( (bStart && GetTabBox().getRowSpan() < 1) ||
(!bStart && GetLayoutRowSpan() > 1) ),
"SwCellFrame::FindStartRowSpanCell: No rowspan, no table, no cookies" );
@@ -1898,14 +1898,14 @@ const SwCellFrame& SwCellFrame::FindStartEndOfRowSpanCell( bool bStart ) const
// is set) we assure that we find a rMasterBox that has a SwCellFrame in
// the current table frame:
const SwTableBox& rMasterBox = bStart ?
GetTabBox()->FindStartOfRowSpan( *pTable, nMax ) :
GetTabBox()->FindEndOfRowSpan( *pTable, nMax );
GetTabBox().FindStartOfRowSpan(*pTable, nMax) :
GetTabBox().FindEndOfRowSpan(*pTable, nMax);
SwIterator<SwCellFrame,SwFormat> aIter( *rMasterBox.GetFrameFormat() );
for ( SwCellFrame* pMasterCell = aIter.First(); pMasterCell; pMasterCell = aIter.Next() )
{
if ( pMasterCell->GetTabBox() == &rMasterBox )
if (&pMasterCell->GetTabBox() == &rMasterBox)
{
const SwTabFrame* pMasterTable = static_cast<const SwTabFrame*>(pMasterCell->GetUpper()->GetUpper());
+3 -3
View File
@@ -2399,7 +2399,7 @@ void SwTabFramePainter::HandleFrame(const SwLayoutFrame& rLayoutFrame, const SwR
{
const SwCellFrame* pThisCell = static_cast<const SwCellFrame*>(&rLayoutFrame);
const SwRowFrame* pRowFrame = static_cast<const SwRowFrame*>(pThisCell->GetUpper());
const tools::Long nRowSpan = pThisCell->GetTabBox()->getRowSpan();
const tools::Long nRowSpan = pThisCell->GetTabBox().getRowSpan();
if ( !pRowFrame->IsRowSpanLine() || nRowSpan > 1 || nRowSpan < -1 )
{
SwBorderAttrAccess aAccess( SwFrame::GetCache(), &rLayoutFrame );
@@ -2824,7 +2824,7 @@ static bool lcl_IsLastVisibleCellBeforeHiddenCellAtTheEndOfRow(
&& rBoxItem.GetLeft()
// last visible table cell isn't equal to the last cell:
// there are invisible deleted cells in Hide Changes mode
&& pThisRowFrame->GetTabLine()->GetTabBoxes().back() != pThisCell->GetTabBox();
&& pThisRowFrame->GetTabLine()->GetTabBoxes().back() != &pThisCell->GetTabBox();
}
void SwTabFramePainter::InsertFollowTopBorder(const SwFrame& rFrame, const SvxBoxItem& rBoxItem,
@@ -6906,7 +6906,7 @@ void SwFrame::PaintSwFrameBackground( const SwRect &rRect, const SwPageFrame *pP
}
else if ( IsCellFrame() && !bHideTableRedlines )
{
RedlineType eType = static_cast<const SwCellFrame*>(this)->GetTabBox()->GetRedlineType();
RedlineType eType = static_cast<const SwCellFrame*>(this)->GetTabBox().GetRedlineType();
if ( RedlineType::Delete == eType || RedlineType::Insert == eType )
{
pCol = RedlineType::Delete == eType ? COL_AUTHOR_TABLE_DEL : COL_AUTHOR_TABLE_INS;
+3 -3
View File
@@ -204,13 +204,13 @@ void SwFrame::CheckDirChange()
if ( IsCellFrame() && GetUpper() )
{
if ( IsVertical() != GetUpper()->IsVertical() &&
static_cast<SwCellFrame*>(this)->GetTabBox()->getRowSpan() == 1 )
static_cast<SwCellFrame*>(this)->GetTabBox().getRowSpan() == 1 )
{
enum {
MIN_VERT_CELL_HEIGHT = 1135
};
SwTableLine* pLine = const_cast<SwTableLine*>(static_cast<SwCellFrame*>(this)->GetTabBox()->GetUpper());
SwTableLine* pLine = const_cast<SwTableLine*>(static_cast<SwCellFrame*>(this)->GetTabBox().GetUpper());
SwFrameFormat* pFrameFormat = pLine->GetFrameFormat();
SwFormatFrameSize aNew( pFrameFormat->GetFrameSize() );
if ( SwFrameSize::Fixed != aNew.GetHeightSizeType() )
@@ -602,7 +602,7 @@ SwRect SwFrame::GetPaintArea() const
{
if( pTmp->IsCellFrame() && pTmp->GetUpper() &&
pTmp->GetUpper()->IsVertical() != pTmp->IsVertical() )
nRowSpan = static_cast<const SwCellFrame*>(pTmp)->GetTabBox()->getRowSpan();
nRowSpan = static_cast<const SwCellFrame*>(pTmp)->GetTabBox().getRowSpan();
tools::Long nTmpRight = aRectFnSet.GetRight(pTmp->getFrameArea());
tools::Long nTmpLeft = aRectFnSet.GetLeft(pTmp->getFrameArea());
if( pTmp->IsRowFrame() && nRowSpan > 1 )
+18 -19
View File
@@ -348,7 +348,7 @@ static void lcl_ShrinkCellsAndAllContent( SwRowFrame& rRow )
while ( pCurrMasterCell )
{
// NEW TABLES
SwCellFrame& rToAdjust = pCurrMasterCell->GetTabBox()->getRowSpan() < 1 ?
SwCellFrame& rToAdjust = pCurrMasterCell->GetTabBox().getRowSpan() < 1 ?
const_cast<SwCellFrame&>(pCurrMasterCell->FindStartEndOfRowSpanCell( true )) :
*pCurrMasterCell;
@@ -507,7 +507,7 @@ static void lcl_MoveRowContent( SwRowFrame& rSourceLine, SwRowFrame& rDestLine )
{
// NEW TABLES
SwCellFrame* pDestCell = pCurrDestCell;
if ( pDestCell->GetTabBox()->getRowSpan() < 1 )
if ( pDestCell->GetTabBox().getRowSpan() < 1 )
pDestCell = & const_cast<SwCellFrame&>(pDestCell->FindStartEndOfRowSpanCell( true ));
// Find last content
@@ -855,7 +855,7 @@ static bool lcl_RecalcSplitLine( SwRowFrame& rLastLine, SwRowFrame& rFollowLine,
SwCellFrame* pCurrMasterCell = static_cast<SwCellFrame*>(rLastLine.Lower());
while ( pCurrMasterCell )
{
if ( !pCurrMasterCell->ContainsContent() && pCurrMasterCell->GetTabBox()->getRowSpan() >= 1 )
if (!pCurrMasterCell->ContainsContent() && pCurrMasterCell->GetTabBox().getRowSpan() >= 1)
{
bRet = false;
break;
@@ -945,7 +945,7 @@ static tools::Long lcl_GetMaximumLayoutRowSpan( const SwRowFrame& rRow )
const SwCellFrame* pLower = static_cast<const SwCellFrame*>( pCurrentRowFrame->Lower());
while ( pLower )
{
if ( pLower->GetTabBox()->getRowSpan() < 0 )
if (pLower->GetTabBox().getRowSpan() < 0)
{
++nRet;
bNextRow = true;
@@ -1305,7 +1305,7 @@ bool SwTabFrame::Split(const SwTwips nCutPos, bool bTryToSplit,
pCellFrame;
pCellFrame = static_cast<const SwCellFrame*>(pCellFrame->GetNext()))
{
if (pCellFrame->GetTabBox()->getRowSpan() > 1) // Master cell
if (pCellFrame->GetTabBox().getRowSpan() > 1) // Master cell
{
bCellSpanCanSplit = true;
break;
@@ -1434,7 +1434,7 @@ bool SwTabFrame::Split(const SwTwips nCutPos, bool bTryToSplit,
const SwCellFrame* pCellFrame = static_cast<const SwCellFrame*>(pFollowRow->GetLower());
while ( pCellFrame )
{
if ( pCellFrame->GetTabBox()->getRowSpan() < 1 )
if (pCellFrame->GetTabBox().getRowSpan() < 1)
{
pLastRow = static_cast<SwRowFrame*>(pRow->GetPrev());
break;
@@ -1744,7 +1744,7 @@ void SwInvalidateAll( SwFrame *pFrame, tools::Long nBottom )
if (pFrame->IsCellFrame())
{
SwCellFrame* pThisCell = static_cast<SwCellFrame*>(pFrame);
if ( pThisCell->GetTabBox()->getRowSpan() < 1 )
if (pThisCell->GetTabBox().getRowSpan() < 1)
{
pToInvalidate = & const_cast<SwCellFrame&>(pThisCell->FindStartEndOfRowSpanCell( true ));
pToInvalidate->InvalidatePos_();
@@ -1932,7 +1932,7 @@ static bool lcl_InnerCalcLayout( SwFrame *pFrame,
if (pFrame->IsCellFrame())
{
SwCellFrame* pThisCell = static_cast<SwCellFrame*>(pFrame);
if ( pThisCell->GetTabBox()->getRowSpan() < 1 )
if (pThisCell->GetTabBox().getRowSpan() < 1)
{
SwCellFrame& rToCalc = const_cast<SwCellFrame&>(pThisCell->FindStartEndOfRowSpanCell( true ));
bRet |= !rToCalc.isFrameAreaDefinitionValid();
@@ -2402,7 +2402,7 @@ void SwTabFrame::MakeAll(vcl::RenderContext* pRenderContext)
pCellFrame;
pCellFrame = static_cast<const SwCellFrame*>(pCellFrame->GetNext()))
{
if (pCellFrame->GetTabBox()->getRowSpan() > 1) // Master cell
if (pCellFrame->GetTabBox().getRowSpan() > 1) // Master cell
{
bCellSpanCanSplit = true;
break;
@@ -3001,7 +3001,7 @@ void SwTabFrame::MakeAll(vcl::RenderContext* pRenderContext)
pLower = pLower->GetNext())
{
auto pCellFrame = static_cast<const SwCellFrame*>(pLower);
if (pCellFrame->GetTabBox()->getRowSpan() != 1)
if (pCellFrame->GetTabBox().getRowSpan() != 1)
{
// The cell has a rowspan, don't split the row itself in this
// case (but just move it forward, i.e. split between the rows).
@@ -5486,7 +5486,7 @@ void SwRowFrame::AdjustCells( const SwTwips nHeight, const bool bHeight )
// Current frame is a covered frame:
// Set new height for covered cell and adjust master cell:
if ( pCellFrame->GetTabBox()->getRowSpan() < 1 )
if (pCellFrame->GetTabBox().getRowSpan() < 1)
{
// Set height of current (covered) cell to new line height.
const tools::Long nDiff = nHeight - aRectFnSet.GetHeight(pCellFrame->getFrameArea());
@@ -6105,7 +6105,7 @@ void SwCellFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorder
}
}
// #i26945#
tools::Long nRemaining = GetTabBox()->getRowSpan() >= 1 ?
tools::Long nRemaining = GetTabBox().getRowSpan() >= 1 ?
::lcl_CalcMinCellHeight( this, pTab->IsConsiderObjsForMinCellHeight(), pAttrs ) :
0;
if ( !isFrameAreaSizeValid() )
@@ -6137,7 +6137,7 @@ void SwCellFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorder
if ( pTab->GetTable()->IsNewModel() )
{
// 1. sum of widths of cells up to this cell (in model)
const SwTableLine* pTabLine = GetTabBox()->GetUpper();
const SwTableLine* pTabLine = GetTabBox().GetUpper();
const SwTableBoxes& rBoxes = pTabLine->GetTabBoxes();
const SwTableBox* pTmpBox = nullptr;
@@ -6148,7 +6148,7 @@ void SwCellFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorder
pTmpBox = rBoxes[ i++ ];
nSumWidth += pTmpBox->GetFrameFormat()->GetFrameSize().GetWidth();
}
while ( pTmpBox != GetTabBox() );
while (pTmpBox != &GetTabBox());
// 2. calculate actual width of cells up to this one
double nTmpWidth = nSumWidth;
@@ -6370,7 +6370,7 @@ void SwCellFrame::SwClientNotify(const SwModify& rMod, const SfxHint& rHint)
if(rHint.GetId() == SfxHintId::SwTableBoxFormatChanged)
{
auto pNewFormatHint = static_cast<const sw::TableBoxFormatChanged*>(&rHint);
if(GetTabBox() != &pNewFormatHint->m_rTableBox)
if (&GetTabBox() != &pNewFormatHint->m_rTableBox)
return;
RegisterToFormat(const_cast<SwTableBoxFormat&>(pNewFormatHint->m_rNewFormat));
InvalidateSize();
@@ -6394,7 +6394,7 @@ void SwCellFrame::SwClientNotify(const SwModify& rMod, const SfxHint& rHint)
else if(rHint.GetId() == SfxHintId::SwMoveTableBox)
{
auto pMoveTableBoxHint = static_cast<const sw::MoveTableBoxHint*>(&rHint);
if(GetTabBox() != &pMoveTableBoxHint->m_rTableBox)
if (&GetTabBox() != &pMoveTableBoxHint->m_rTableBox)
return;
const_cast<SwFrameFormat*>(&pMoveTableBoxHint->m_rNewFormat)->Add(*this);
InvalidateAll();
@@ -6504,8 +6504,7 @@ void SwCellFrame::SwClientNotify(const SwModify& rMod, const SfxHint& rHint)
tools::Long SwCellFrame::GetLayoutRowSpan() const
{
const SwTableBox *pTabBox = GetTabBox();
tools::Long nRet = pTabBox ? pTabBox->getRowSpan() : 0;
tools::Long nRet = GetTabBox().getRowSpan();
if ( nRet < 1 )
{
const SwFrame* pRow = GetUpper();
@@ -6974,7 +6973,7 @@ SwTwips SwTabFrame::CalcHeightOfFirstContentLine() const
const SwCellFrame* pLower2 = static_cast<const SwCellFrame*>(pFirstRow->Lower());
while ( pLower2 )
{
if ( 1 == pLower2->GetTabBox()->getRowSpan() )
if (1 == pLower2->GetTabBox().getRowSpan())
{
const SwTwips nCellHeight = lcl_CalcMinCellHeight( pLower2, true );
nMaxHeight = std::max( nCellHeight, nMaxHeight );
+4 -4
View File
@@ -2034,9 +2034,9 @@ bool SwRootFrame::MakeTableCursors( SwTableCursor& rTableCursor )
(bReadOnlyAvailable ||
!pCell->GetFormat()->GetProtect().IsContentProtected()))
{
SwTableBox* pInsBox = const_cast<SwTableBox*>(
SwTableBox& rInsBox = const_cast<SwTableBox&>(
static_cast<const SwCellFrame*>(pCell)->GetTabBox());
aNew.insert( pInsBox );
aNew.insert(&rInsBox);
}
if ( pCell->GetNext() )
{
@@ -2580,7 +2580,7 @@ void SwRootFrame::CalcFrameRects(SwShellCursor const& rCursor, SwRects & rRects,
//Now the frames between, if there are any
bool const bBody = pStartFrame->IsInDocBody();
const SwTableBox* pCellBox = pStartFrame->GetUpper()->IsCellFrame() ?
static_cast<const SwCellFrame*>(pStartFrame->GetUpper())->GetTabBox() : nullptr;
&static_cast<const SwCellFrame*>(pStartFrame->GetUpper())->GetTabBox() : nullptr;
assert(pSh);
if (pSh->IsSelectAll())
pCellBox = nullptr;
@@ -2605,7 +2605,7 @@ void SwRootFrame::CalcFrameRects(SwShellCursor const& rCursor, SwRects & rRects,
// If pStartFrame is inside a SwCellFrame, consider only frames which are inside the
// same cell frame (or its follow cell)
const SwTableBox* pTmpCellBox = pContent->GetUpper()->IsCellFrame() ?
static_cast<const SwCellFrame*>(pContent->GetUpper())->GetTabBox() : nullptr;
&static_cast<const SwCellFrame*>(pContent->GetUpper())->GetTabBox() : nullptr;
if (pSh->IsSelectAll())
pTmpCellBox = nullptr;
if ( bBody == pContent->IsInDocBody() &&
+1 -1
View File
@@ -2809,7 +2809,7 @@ SwTwips SwLayoutFrame::GrowFrame(SwTwips nDist, SwResizeLimitReason& reason, boo
if ( pThisCell->GetLayoutRowSpan() > 1 )
{
SwCellFrame& rEndCell = const_cast<SwCellFrame&>(pThisCell->FindStartEndOfRowSpanCell( false ));
if ( -1 == rEndCell.GetTabBox()->getRowSpan() )
if ( -1 == rEndCell.GetTabBox().getRowSpan() )
pToGrow = rEndCell.GetUpper();
else
{
+1 -1
View File
@@ -593,7 +593,7 @@ static void lcl_InvalidateCellFrame( const SwTableBox& rBox )
SwIterator<SwCellFrame,SwFormat> aIter( *rBox.GetFrameFormat() );
for( SwCellFrame* pCell = aIter.First(); pCell; pCell = aIter.Next() )
{
if( pCell->GetTabBox() == &rBox )
if (&pCell->GetTabBox() == &rBox)
{
pCell->InvalidateSize();
SwFrame* pLower = pCell->GetLower();
+5 -5
View File
@@ -1425,7 +1425,7 @@ SwTableBox* SwTable::GetTableBox( SwNodeOffset nSttIdx )
while ( pFrame && !pFrame->IsCellFrame() )
pFrame = pFrame->GetUpper();
if ( pFrame )
pRet = const_cast<SwTableBox*>(static_cast<SwCellFrame*>(pFrame)->GetTabBox());
pRet = &const_cast<SwTableBox&>(static_cast<SwCellFrame*>(pFrame)->GetTabBox());
}
// In case the layout doesn't exist yet or anything else goes wrong.
@@ -2159,7 +2159,7 @@ SwTableBoxFormat* SwTableBox::ClaimFrameFormat()
// re-register SwCellFrame objects that know me
SwIterator<SwCellFrame,SwFormat> aFrameIter( *pRet );
for( SwCellFrame* pCell = aFrameIter.First(); pCell; pCell = aFrameIter.Next() )
if( pCell->GetTabBox() == this )
if (&pCell->GetTabBox() == this)
pCell->RegisterToFormat( *pNewFormat );
// re-register myself
@@ -3179,8 +3179,8 @@ const SwCellFrame * SwTableCellInfo::Impl::getNextTableBoxsCellFrame(const SwFra
while ((pFrame = getNextCellFrame(pFrame)) != nullptr)
{
const SwCellFrame * pCellFrame = static_cast<const SwCellFrame *>(pFrame);
const SwTableBox * pTabBox = pCellFrame->GetTabBox();
auto aIt = m_HandledTableBoxes.insert(pTabBox);
const SwTableBox& rTabBox = pCellFrame->GetTabBox();
auto aIt = m_HandledTableBoxes.insert(&rTabBox);
if (aIt.second)
{
pResult = pCellFrame;
@@ -3239,7 +3239,7 @@ const SwTableBox * SwTableCellInfo::getTableBox() const
const SwTableBox * pRet = nullptr;
if (getCellFrame() != nullptr)
pRet = getCellFrame()->GetTabBox();
pRet = &getCellFrame()->GetTabBox();
return pRet;
}
@@ -370,7 +370,7 @@ void const* lcl_GetKeyFromFrame( const SwFrame& rFrame )
{
const SwTabFrame* pTabFrame = rFrame.FindTabFrame();
const SwTable* pTable = pTabFrame->GetTable();
pKey = static_cast<void const *>(& static_cast<const SwCellFrame&>(rFrame).GetTabBox()->FindStartOfRowSpan(*pTable));
pKey = static_cast<void const *>(& static_cast<const SwCellFrame&>(rFrame).GetTabBox().FindStartOfRowSpan(*pTable));
}
else if (rFrame.IsFootnoteFrame())
{
@@ -984,7 +984,7 @@ void SwTaggedPDFHelper::SetAttributes(vcl::pdf::StructElement eType)
if ( pFrame->IsCellFrame() )
{
const SwCellFrame* pThisCell = static_cast<const SwCellFrame*>(pFrame);
nVal = pThisCell->GetTabBox()->getRowSpan();
nVal = pThisCell->GetTabBox().getRowSpan();
if ( nVal > 1 )
mpPDFExtOutDevData->SetStructureAttributeNumerical( vcl::pdf::PDFWriter::RowSpan, nVal );