diff options
author | Michael Stahl <michael.stahl@allotropia.de> | 2023-05-11 19:01:53 +0200 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2023-05-21 13:28:40 +0200 |
commit | 323c3bc92f0169aed6ea1bc03270aec5050b4bc9 (patch) | |
tree | 2c336890595d77f9c9b64180f41499311a4fca9c /sw | |
parent | 888335f53e579ba5027f0c0581237eb4846d9d82 (diff) |
tdf#144494 sw: fix layout loop
There is a pre-existing loop here, where page 1 is layouted, the text
frame splits due to the fly taking up space, page 2 is layouted, the fly
moves to page 2 (invalidating page 1) and thus the text frame splits
again, page 1 is layouted, happy to see all the free space, and joins all
its follows.
Previously this was eventually terminated by layact.cxx:639 calling
SwLayouter::LoopControl() and this force-validates page 1, resulting in
page 1 having the fly (which is actually anchored at the end of the text
frame, on page 2).
Now the CheckPageDescs() discovers that page 3 doesn't have any content,
and deletes it; this causes it to be re-created on every iteration of
the loop and somehow the SwLayouter now doesn't detect the loop.
But the call that deletes the page 3 is actually unnecessary: the text
frame does have a SwPageDescItem - but it is itself a follow, where
break items doesn't matter anyway - so just check for this to get back
to the previous layout result.
(regression from commit b9ef71476fd70bc13f50ebe80390e0730d1b7afb)
Change-Id: If15c31278bd36e51c64090a288e8bd1ab6753dd7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151680
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
(cherry picked from commit ac9500105cc72d84ce120fd1dc125329aadb63a0)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151618
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/layout/flowfrm.cxx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sw/source/core/layout/flowfrm.cxx b/sw/source/core/layout/flowfrm.cxx index 444e597eaa3b..c3690e2984cc 100644 --- a/sw/source/core/layout/flowfrm.cxx +++ b/sw/source/core/layout/flowfrm.cxx @@ -2142,7 +2142,7 @@ bool SwFlowFrame::MoveFwd( bool bMakePage, bool bPageBreak, bool bMoveAlways ) // i#106452 // check page description not only in situation with sections. if ( !bSamePage && - ( m_rThis.GetPageDescItem().GetPageDesc() || + ((!IsFollow() && m_rThis.GetPageDescItem().GetPageDesc()) || pOldPage->GetPageDesc()->GetFollow() != pNewPage->GetPageDesc() ) ) { SwFrame::CheckPageDescs( pNewPage, false ); |