sw/source/core/layout/wsfrm.cxx |   27 +++++++++++++++++++++------
 1 file changed, 21 insertions(+), 6 deletions(-)

New commits:
commit 2bf98b495cf187c80ab105f30b51da8f65561e35
Author:     Michael Stahl <michael.st...@allotropia.de>
AuthorDate: Fri Jul 28 13:09:41 2023 +0200
Commit:     Michael Stahl <michael.st...@allotropia.de>
CommitDate: Fri Jul 28 15:59:59 2023 +0200

    sw: layout: invalidate row after fixed-height row too
    
    In SwLayoutFrame::GrowFrame(), invalidate the position of not only the
    next frame, but continue to invalidate until there is a frame with a
    non-fixed height.
    
    The idea with invalidating only the next frame is that the next frame
    will then be formatted and this will then invalidate the position of the
    frame after that.
    
    But with a table row with fixed height, this doesn't work:
    SwLayoutFrame::GrowFrame() returns without doing anything, not invalidating
    next frame; the next-next row is never repositioned and overlaps the
    next row.
    
    (this reproduces as a user-visible problem only when using the API to
     export to PDF, and only in a 6.3-based downstream branch, because
     in SwXTextDocument::getRendererCount() view settings are applied and
     this will differ on the IsParagraph() setting and in master this causes
     all pages to be invalidated and another run of the layout fixes the
     problem; also on the downstream branch backports of commit
     383032c50a3e3354f04200ce984a47ab9d2c5c67 "tdf#123583 use TaskStopwatch
     for Writer Idle loop" and commit
     c605283ad6785dea762feab5fdffd9d27e75c292 "sw: fix spurious layout
     invalidation from ~SwCallLink()" are required to reproduce.)
    
    Change-Id: Ic8a0aa23c496eeab2f3fd87bff7212c8d8ca1cfe
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155017
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>

diff --git a/sw/source/core/layout/wsfrm.cxx b/sw/source/core/layout/wsfrm.cxx
index 2834b09f70a6..caaed34e8b70 100644
--- a/sw/source/core/layout/wsfrm.cxx
+++ b/sw/source/core/layout/wsfrm.cxx
@@ -2778,13 +2778,28 @@ SwTwips SwLayoutFrame::GrowFrame( SwTwips nDist, bool 
bTst, bool bInfo )
             SwPageFrame *pPage = FindPageFrame();
             if ( GetNext() )
             {
-                GetNext()->InvalidatePos_();
-                if (GetNext()->IsRowFrame())
-                {   // also invalidate first cell
-                    
static_cast<SwLayoutFrame*>(GetNext())->Lower()->InvalidatePos_();
+                SwFrame * pNext = GetNext();
+                do
+                {
+                    pNext->InvalidatePos_();
+                    if (pNext->IsRowFrame())
+                    {   // also invalidate first cell
+                        
static_cast<SwLayoutFrame*>(pNext)->Lower()->InvalidatePos_();
+                    }
+                    else if (pNext->IsContentFrame())
+                    {
+                        pNext->InvalidatePage(pPage);
+                    }
+                    if (pNext->HasFixSize())
+                    {   // continue to invalidate because growing pNext won't 
do it!
+                        pNext = pNext->GetNext();
+                    }
+                    else
+                    {
+                        break;
+                    }
                 }
-                if ( GetNext()->IsContentFrame() )
-                    GetNext()->InvalidatePage( pPage );
+                while (pNext);
             }
             if ( !IsPageBodyFrame() )
             {

Reply via email to