sw/source/core/layout/sectfrm.cxx | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-)
New commits: commit 323d76efc516c0615bdfe402374e2fb8b38dedc1 Author: Michael Stahl <[email protected]> AuthorDate: Mon Sep 2 13:46:12 2024 +0200 Commit: Michael Stahl <[email protected]> CommitDate: Mon Sep 2 16:17:54 2024 +0200 sw: fix iterating columned sections in SwSectionFrame::SwClientNotify() This was asserting in JunitTest_sw_unoapi_3 on libreoffice-24-2 branch but strangely enough not on master. (regression from commit a97e245ba11598050e1800fde9ace796d20e9df2) Change-Id: Id71dac03992fff0294ab1b2c6d9f3bf10b8c3974 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172740 Tested-by: Jenkins Reviewed-by: Michael Stahl <[email protected]> (cherry picked from commit 5f0f69ba9b7d083cf7c0169be6e9c916008787bb) diff --git a/sw/source/core/layout/sectfrm.cxx b/sw/source/core/layout/sectfrm.cxx index 698ac6a24015..05b769d9e6df 100644 --- a/sw/source/core/layout/sectfrm.cxx +++ b/sw/source/core/layout/sectfrm.cxx @@ -2702,7 +2702,29 @@ void SwSectionFrame::Modify( const SfxPoolItem* pOld, const SfxPoolItem * pNew ) pFirstOnPage = pFirstOnPage->GetUpper(); } assert(pFirstOnPage->IsContentFrame() || pFirstOnPage->IsTabFrame()); - for (SwFrame* pLowerFrame = Lower(); pLowerFrame; pLowerFrame = pLowerFrame->GetNext()) + SwColumnFrame * pColumn{Lower()->IsColumnFrame() + ? static_cast<SwColumnFrame*>(Lower()) : nullptr}; + auto IterateLower = [&pColumn](SwFrame *const pLowerFrame) -> SwFrame* + { + if (pLowerFrame->GetNext()) + { + return pLowerFrame->GetNext(); + } + if (pColumn) + { + pColumn = static_cast<SwColumnFrame*>(pColumn->GetNext()); + if (pColumn) + { + return static_cast<SwLayoutFrame*>(pColumn->Lower())->Lower(); + } + } + return nullptr; + }; + for (SwFrame* pLowerFrame = pColumn + ? static_cast<SwLayoutFrame*>(pColumn->Lower())->Lower() + : Lower(); + pLowerFrame; + pLowerFrame = IterateLower(pLowerFrame)) { if (pLowerFrame == pFirstOnPage) {
