sw/source/core/doc/tblrwcl.cxx | 12 ++++++------ sw/source/core/inc/frmtool.hxx | 2 +- sw/source/core/layout/frmtool.cxx | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-)
New commits: commit 8c6ef628de8f0970fbfc42f022e5d8dddc42f90f Author: Caolán McNamara <[email protected]> AuthorDate: Sat Aug 2 20:16:35 2025 +0100 Commit: Caolán McNamara <[email protected]> CommitDate: Sun Aug 3 12:17:53 2025 +0200 cid#1660816 silence Dereference null return value Change-Id: Ib34cebce18b067d9127fc3a431c4b6274a372065 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188860 Reviewed-by: Caolán McNamara <[email protected]> Tested-by: Jenkins diff --git a/sw/source/core/doc/tblrwcl.cxx b/sw/source/core/doc/tblrwcl.cxx index 71061ab46378..6c25bdc97543 100644 --- a/sw/source/core/doc/tblrwcl.cxx +++ b/sw/source/core/doc/tblrwcl.cxx @@ -2954,7 +2954,7 @@ static void SetLineHeight( SwTableLine& rLine, SwTwips nOldHeight, SwTwips nNewH SwFrameSize eSize = SwFrameSize::Minimum; if( !bMinSize && - ( nMyOldH - nMyNewH ) > ( CalcRowRstHeight( pLineFrame ) + ROWFUZZY )) + ( nMyOldH - nMyNewH ) > ( CalcRowRstHeight(*pLineFrame) + ROWFUZZY )) eSize = SwFrameSize::Fixed; pFormat->SetFormatAttr( SwFormatFrameSize( eSize, 0, nMyNewH ) ); @@ -2981,8 +2981,8 @@ static bool lcl_SetSelLineHeight( SwTableLine* pLine, const CR_SetLineHeight& rP { // Calculate the new relative size by means of the old one SwLayoutFrame* pLineFrame = GetRowFrame( *pLine ); - OSL_ENSURE( pLineFrame, "Where is the Frame from the SwTableLine?" ); - SwTwips nRstHeight = CalcRowRstHeight( pLineFrame ); + assert(pLineFrame && "Where is the Frame from the SwTableLine?"); + SwTwips nRstHeight = CalcRowRstHeight(*pLineFrame); if( (nRstHeight + ROWFUZZY) < nDist ) bRet = false; } @@ -3006,7 +3006,7 @@ static bool lcl_SetOtherLineHeight( SwTableLine* pLine, const CR_SetLineHeight& nDist *= pLineFrame->getFrameArea().Height(); nDist /= rParam.nMaxHeight; } - bRet = nDist <= CalcRowRstHeight( pLineFrame ); + bRet = nDist <= CalcRowRstHeight(*pLineFrame); } } else @@ -3029,7 +3029,7 @@ static bool lcl_SetOtherLineHeight( SwTableLine* pLine, const CR_SetLineHeight& else { // Calculate the new relative size by means of the old one - nDist *= CalcRowRstHeight( pLineFrame ); + nDist *= CalcRowRstHeight(*pLineFrame); nDist /= rParam.nMaxSpace; } } @@ -3115,7 +3115,7 @@ bool SwTable::SetRowHeight( SwTableBox& rCurrentBox, TableChgWidthHeightType eTy { SwLayoutFrame* pLineFrame = GetRowFrame( *(*pLines)[ n ] ); assert(pLineFrame && "Where is the Frame from the SwTableLine??"); - aParam.nMaxSpace += CalcRowRstHeight( pLineFrame ); + aParam.nMaxSpace += CalcRowRstHeight(*pLineFrame); aParam.nMaxHeight += pLineFrame->getFrameArea().Height(); } if( bBigger && aParam.nMaxSpace < nAbsDiff ) diff --git a/sw/source/core/inc/frmtool.hxx b/sw/source/core/inc/frmtool.hxx index 733b604e4ae1..5fffc5494279 100644 --- a/sw/source/core/inc/frmtool.hxx +++ b/sw/source/core/inc/frmtool.hxx @@ -149,7 +149,7 @@ extern bool bObjsDirect; extern bool bSetCompletePaintOnInvalidate; // for table settings via keyboard -SwTwips CalcRowRstHeight( SwLayoutFrame *pRow ); +SwTwips CalcRowRstHeight(SwLayoutFrame& rRow); tools::Long CalcHeightWithFlys( const SwFrame *pFrame ); namespace sw { diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx index 9ee8e3e4e014..96057604c12f 100644 --- a/sw/source/core/layout/frmtool.cxx +++ b/sw/source/core/layout/frmtool.cxx @@ -3744,16 +3744,16 @@ static SwTwips lcl_CalcCellRstHeight( SwLayoutFrame *pCell ) tools::Long nRstHeight = 0; while (pLow && pLow->IsLayoutFrame()) { - nRstHeight += ::CalcRowRstHeight(static_cast<SwLayoutFrame*>(pLow)); + nRstHeight += ::CalcRowRstHeight(*static_cast<SwLayoutFrame*>(pLow)); pLow = pLow->GetNext(); } return nRstHeight; } } -SwTwips CalcRowRstHeight( SwLayoutFrame *pRow ) +SwTwips CalcRowRstHeight(SwLayoutFrame& rRow) { - SwFrame *pLow = pRow->Lower(); + SwFrame *pLow = rRow.Lower(); if (!(pLow && pLow->IsLayoutFrame())) { return 0;
