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

New commits:
commit 641c82472ddc28c585345caae188ab5b8e783da0
Author:     Michael Stahl <michael.st...@allotropia.de>
AuthorDate: Thu Sep 5 12:37:46 2024 +0200
Commit:     Mike Kaganski <mike.kagan...@collabora.com>
CommitDate: Thu Sep 5 17:11:34 2024 +0200

    sw: fix empty pages after hiding section due to SwTabFrame
    
    The problem with a full customer doc is that a table doesn't MoveBwd
    because ShouldBwdMoved finds that the rows don't fit as the rows still
    have non-0 heights, and the result is an empty page at the end; also the
    table later splits.
    
    Turns out that setting bDontSplit prevents both problems; the inner
    frames are all set to 0 height by lcl_RecalcTable().
    
    (regression from commit ff7f1b59e22092d8548459e75fe912db852f056f)
    
    Change-Id: I5012142a0019ee2e978d5b8a9eb445ff0949e569
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172910
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>
    Tested-by: Jenkins
    (cherry picked from commit 8087f479b373299d45469ff3996dba793a9cdb28)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172897
    Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com>

diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
index c765bd35e0cc..45623a7a2c04 100644
--- a/sw/source/core/layout/tabfrm.cxx
+++ b/sw/source/core/layout/tabfrm.cxx
@@ -2165,9 +2165,10 @@ void SwTabFrame::MakeAll(vcl::RenderContext* 
pRenderContext)
     std::optional<SwBorderAttrAccess> oAccess(std::in_place, 
SwFrame::GetCache(), this);
     const SwBorderAttrs *pAttrs = oAccess->Get();
 
+    bool const isHiddenNow(IsHiddenNow());
     // All rows should keep together
-    bool bDontSplit = !IsFollow() &&
-                            ( !GetFormat()->GetLayoutSplit().GetValue() );
+    bool bDontSplit = isHiddenNow
+                || (!IsFollow() && !GetFormat()->GetLayoutSplit().GetValue());
 
     // The number of repeated headlines
     const sal_uInt16 nRepeat = GetTable()->GetRowsToRepeat();
@@ -2262,7 +2263,6 @@ void SwTabFrame::MakeAll(vcl::RenderContext* 
pRenderContext)
         }
     }
 
-    bool const isHiddenNow(IsHiddenNow());
     if (isHiddenNow)
         MakeValidZeroHeight();
 

Reply via email to