sw/source/uibase/shells/tabsh.cxx | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-)
New commits: commit 8cc5eaffce520ce93e81e108c2c28dc301d06c8d Author: Xisco Fauli <xiscofa...@libreoffice.org> AuthorDate: Sat Aug 9 22:57:23 2025 +0200 Commit: Adolfo Jayme Barrientos <fit...@ubuntu.com> CommitDate: Sun Aug 10 15:27:33 2025 +0200 tdf#167875: check GetLower() After commit 1b03f6ea0362a38c6c4e5e767fcb5cf87ddd28dd Author: Ujjawal Kumar <randomfores...@gmail.com> Date: Thu Mar 13 20:42:21 2025 +0530 tdf#149825 Add command to insert a paragraph break before table Previously, I pushed a blind fix for it in commit 22a4e2df6f521a5baf1abfd9d4bf6da116933ed8 Author: Xisco Fauli <xiscofa...@libreoffice.org> Date: Thu Aug 7 19:59:47 2025 +0200 crashreporting: check Lower() Change-Id: Ied2e14224adcf71c0c438df13506e684136b7f6c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189278 Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com> Tested-by: Jenkins (cherry picked from commit 48ff1bbbe90001716e7421c5ebd30e2e635fe99e) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189287 Reviewed-by: Adolfo Jayme Barrientos <fit...@ubuntu.com> diff --git a/sw/source/uibase/shells/tabsh.cxx b/sw/source/uibase/shells/tabsh.cxx index 76cc764da6dd..83825e269817 100644 --- a/sw/source/uibase/shells/tabsh.cxx +++ b/sw/source/uibase/shells/tabsh.cxx @@ -1552,19 +1552,18 @@ void SwTableShell::GetState(SfxItemSet &rSet) { // exec just moves on top and adds the break, which however makes only sense if the table // is the very first item of the document; the command should be hidden otherwise - SwContentFrame* curFrame = rSh.GetCurrFrame(); - SwPageFrame* pageFrame = curFrame->FindPageFrame(); - if (SwFrame* frame = pageFrame->Lower()) + SwContentFrame* pCurFrame = rSh.GetCurrFrame(); + SwPageFrame* pPageFrame = pCurFrame->FindPageFrame(); + SwFrame* pFrame = pPageFrame->Lower(); + + while(pFrame && !pFrame->IsContentFrame()) { - while(!frame->IsContentFrame()) - { - frame = frame->GetLower(); - } + pFrame = pFrame->GetLower(); + } - if(frame->FindTabFrame() != curFrame->FindTabFrame()) - { - rSet.DisableItem(nSlot); - } + if(pFrame && pFrame->FindTabFrame() != pCurFrame->FindTabFrame()) + { + rSet.DisableItem(nSlot); } } break;