sw/source/core/layout/tabfrm.cxx |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit 8c24bc5baa1f501943bf955e07787d80cb7a5763
Author:     Michael Stahl <michael.st...@allotropia.de>
AuthorDate: Fri Aug 25 18:31:42 2023 +0200
Commit:     Michael Stahl <michael.st...@allotropia.de>
CommitDate: Mon Aug 28 13:48:54 2023 +0200

    (related? tdf#155177) sw: layout: fix another RemoveFollowFlowLine SNAFU
    
    This happens with the following commit, on testForcepoint76, for no
    obvious reason.
    
    A follow table frame is in SwTabFrame::MakeAll(), then its follow flow
    line becomes empty and it does SetRemoveFollowFlowLinePending() on the
    master, then it formats its follow flow line (but at that time there's
    again a text frame in it), then that content moves backward, formats its
    uppers until it gets to the master table frame, which wants to join the
    row frame that's being formatted on the stack.
    
    Obviously a SwFrameDeleteGuard in lcl_RecalcRow() can't hurt, but it
    needs an additional change later to prevent it from moving rows of the
    follow back.
    
    Change-Id: Idca90b7eb67994385ccd306562ea26ff39e884f9
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156117
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>

diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
index e4be17237e58..68bb19b7f39d 100644
--- a/sw/source/core/layout/tabfrm.cxx
+++ b/sw/source/core/layout/tabfrm.cxx
@@ -1750,6 +1750,8 @@ static void lcl_RecalcRow(SwRowFrame & rRow, tools::Long 
const nBottom)
 
         if( bCheck )
         {
+            SwFrameDeleteGuard g(&rRow);
+
             // #115759# - force another format of the
             // lowers, if at least one of it was invalid.
             bCheck = SwContentFrame::CalcLowers(rRow, *rRow.GetUpper(), 
nBottom, true);
@@ -2341,7 +2343,9 @@ void SwTabFrame::MakeAll(vcl::RenderContext* 
pRenderContext)
             if ( !bSplit && GetFollow() )
             {
                 bool bDummy;
-                if ( GetFollow()->ShouldBwdMoved( GetUpper(), bDummy ) )
+                if (!(HasFollowFlowLine()
+                        && 
GetFollow()->GetFirstNonHeadlineRow()->IsDeleteForbidden())
+                    && GetFollow()->ShouldBwdMoved(GetUpper(), bDummy))
                 {
                     SwFrame *pTmp = GetUpper();
                     SwTwips nDeadLine = aRectFnSet.GetPrtBottom(*pTmp);

Reply via email to