sw/source/core/text/txtfly.cxx | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-)
New commits: commit 81f9c593a4c49c87ba56792ae1f21692d96f87e6 Author: Xisco Fauli <[email protected]> AuthorDate: Thu Feb 19 10:43:52 2026 +0100 Commit: Xisco Fauli <[email protected]> CommitDate: Thu Feb 19 16:30:50 2026 +0100 sw: silence warning C6011: Dereferencing NULL pointer 'pFlyFrame->Lower()' E:/jenkins/workspace/lo_tb_master_win_analyze/sw/source/core/text/txtfly.cxx(1430): error C2220: the following warning is treated as an error E:\jenkins\workspace\lo_tb_master_win_analyze\sw\source Change-Id: I48aee6e10f169997a23f0b1498ce009c07c2013e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199706 Reviewed-by: Xisco Fauli <[email protected]> Tested-by: Jenkins diff --git a/sw/source/core/text/txtfly.cxx b/sw/source/core/text/txtfly.cxx index 2530e8a62080..2046b557d36b 100644 --- a/sw/source/core/text/txtfly.cxx +++ b/sw/source/core/text/txtfly.cxx @@ -1378,16 +1378,19 @@ SwRect SwTextFly::AnchoredObjToRect( const SwAnchoredObject* pAnchoredObj, if (auto pFlyFrame = pAnchoredObj->DynCastFlyFrame()) { - if (pFlyFrame->IsFlySplitAllowed() && pFlyFrame->Lower()) + if (pFlyFrame->IsFlySplitAllowed()) { - // The floating table could be too tall for its fly frame at this point, because the - // fly's Grow_ would limit to only available space. Take the excessive height into - // account here, so that the line can be forced to move to next page (via SwFlyPortion). - - auto aLowerHeight = aRectFnSet.GetHeight(pFlyFrame->Lower()->getFrameArea()); - if (aLowerHeight > aRectFnSet.GetHeight(aFly)) + if (const SwFrame* pLower = pFlyFrame->Lower()) { - aRectFnSet.SetHeight(aFly, aLowerHeight); + // The floating table could be too tall for its fly frame at this point, because the + // fly's Grow_ would limit to only available space. Take the excessive height into + // account here, so that the line can be forced to move to next page (via SwFlyPortion). + + auto aLowerHeight = aRectFnSet.GetHeight(pLower->getFrameArea()); + if (aLowerHeight > aRectFnSet.GetHeight(aFly)) + { + aRectFnSet.SetHeight(aFly, aLowerHeight); + } } } }
