sw/source/core/layout/colfrm.cxx | 14 +++++++++----- sw/source/core/layout/tabfrm.cxx | 2 +- 2 files changed, 10 insertions(+), 6 deletions(-)
New commits: commit e080eebd4ebb20ddb0aff1f168096ec22b326546 Author: Xisco Fauli <[email protected]> AuthorDate: Mon Dec 23 11:44:19 2024 +0100 Commit: Xisco Fauli <[email protected]> CommitDate: Mon Dec 23 14:23:57 2024 +0100 crashreporting: check Lower() See https://crashreport.libreoffice.org/stats/signature/SwLayoutFrame::AdjustColumns(SwFormatCol%20const%20*,bool) Change-Id: I690a6358c8964f5511aedf3246384649cf004d9f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179234 Tested-by: Jenkins Reviewed-by: Xisco Fauli <[email protected]> diff --git a/sw/source/core/layout/colfrm.cxx b/sw/source/core/layout/colfrm.cxx index 8aa4fb2fdce5..18133b91332d 100644 --- a/sw/source/core/layout/colfrm.cxx +++ b/sw/source/core/layout/colfrm.cxx @@ -312,9 +312,13 @@ void SwLayoutFrame::ChgColumns( const SwFormatCol &rOld, const SwFormatCol &rNew void SwLayoutFrame::AdjustColumns( const SwFormatCol *pAttr, bool bAdjustAttributes ) { - if( !Lower()->GetNext() ) + SwFrame* pLower = Lower(); + if (!pLower) + return; + + if( !pLower->GetNext() ) { - Lower()->ChgSize( getFramePrintArea().SSize() ); + pLower->ChgSize( getFramePrintArea().SSize() ); return; } @@ -328,7 +332,7 @@ void SwLayoutFrame::AdjustColumns( const SwFormatCol *pAttr, bool bAdjustAttribu if ( !bAdjustAttributes ) { tools::Long nAvail = fnRect.GetWidth(getFramePrintArea()); - for ( SwLayoutFrame *pCol = static_cast<SwLayoutFrame*>(Lower()); + for ( SwLayoutFrame *pCol = static_cast<SwLayoutFrame*>(pLower); pCol; pCol = static_cast<SwLayoutFrame*>(pCol->GetNext()) ) nAvail -= fnRect.GetWidth(pCol->getFrameArea()); @@ -344,7 +348,7 @@ void SwLayoutFrame::AdjustColumns( const SwFormatCol *pAttr, bool bAdjustAttribu const sal_uInt16 nMin = bLine ? sal_uInt16( 20 + ( pAttr->GetLineWidth() / 2) ) : 0; const bool bR2L = IsRightToLeft(); - SwFrame *pCol = bR2L ? GetLastLower() : Lower(); + SwFrame *pCol = bR2L ? GetLastLower() : pLower; // #i27399# // bOrtho means we have to adjust the column frames manually. Otherwise @@ -429,7 +433,7 @@ void SwLayoutFrame::AdjustColumns( const SwFormatCol *pAttr, bool bAdjustAttribu return; tools::Long nInnerWidth = ( nAvail - nGutter ) / pAttr->GetNumCols(); - pCol = Lower(); + pCol = pLower; for( sal_uInt16 i = 0; i < pAttr->GetNumCols() && pCol; pCol = pCol->GetNext(), ++i ) //i118878, value returned by GetNumCols() can't be trusted { SwTwips nWidth; commit ce913724f648061b534098f2deda362791e15386 Author: Xisco Fauli <[email protected]> AuthorDate: Mon Dec 23 11:31:23 2024 +0100 Commit: Xisco Fauli <[email protected]> CommitDate: Mon Dec 23 14:23:51 2024 +0100 crashreporting: check Lower() See https://crashreport.libreoffice.org/stats/signature/SwRowFrame::ShouldRowKeepWithNext(bool) Change-Id: I49ac8312e0288471780c405bb2cd7eb66163ab43 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179233 Tested-by: Jenkins Reviewed-by: Xisco Fauli <[email protected]> diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx index 20755efa8d2c..eced2e301c8a 100644 --- a/sw/source/core/layout/tabfrm.cxx +++ b/sw/source/core/layout/tabfrm.cxx @@ -5645,7 +5645,7 @@ bool SwRowFrame::ShouldRowKeepWithNext( const bool bCheckParents ) const return false; const SwCellFrame* pCell = static_cast<const SwCellFrame*>(Lower()); - const SwFrame* pText = pCell->Lower(); + const SwFrame* pText = pCell ? pCell->Lower() : nullptr; return pText && pText->IsTextFrame() && !pText->IsHiddenNow() && static_cast<const SwTextFrame*>(pText)->GetTextNodeForParaProps()->GetSwAttrSet().GetKeep(bCheckParents).GetValue();
