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

New commits:
commit 8087f479b373299d45469ff3996dba793a9cdb28
Author:     Michael Stahl <michael.st...@allotropia.de>
AuthorDate: Thu Sep 5 12:37:46 2024 +0200
Commit:     Michael Stahl <michael.st...@allotropia.de>
CommitDate: Thu Sep 5 15:45:01 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

diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
index 75515576db37..fda91a289448 100644
--- a/sw/source/core/layout/tabfrm.cxx
+++ b/sw/source/core/layout/tabfrm.cxx
@@ -2180,9 +2180,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();
@@ -2277,7 +2278,6 @@ void SwTabFrame::MakeAll(vcl::RenderContext* 
pRenderContext)
         }
     }
 
-    bool const isHiddenNow(IsHiddenNow());
     if (isHiddenNow)
         MakeValidZeroHeight();
 

Reply via email to