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

New commits:
commit 20b8f3922a374378cef7b87ee30cde2ae1d6264e
Author:     Michael Stahl <michael.st...@allotropia.de>
AuthorDate: Thu Aug 22 11:20:27 2024 +0200
Commit:     Michael Stahl <michael.st...@allotropia.de>
CommitDate: Thu Aug 22 16:12:23 2024 +0200

    sw: layout: allow table in hidden section to move back
    
    The problem is that a SwTabFrame in a hidden section will never MoveBwd
    because its height is always set to 1 erroneously in
    SwTabFrame::Format() due to some border or so, and thus it doesn't fit.
    
    So prevent Format() from being called by disabling invalidations.
    
    (regression from commit ff7f1b59e22092d8548459e75fe912db852f056f)
    
    Change-Id: I25232b31b22b98c852c2f28eefff34f51e088eda
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172251
    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 42116672708f..a7286a4860b9 100644
--- a/sw/source/core/layout/tabfrm.cxx
+++ b/sw/source/core/layout/tabfrm.cxx
@@ -2275,7 +2275,8 @@ void SwTabFrame::MakeAll(vcl::RenderContext* 
pRenderContext)
         }
     }
 
-    if (IsHiddenNow())
+    bool const isHiddenNow(IsHiddenNow());
+    if (isHiddenNow)
         MakeValidZeroHeight();
 
     int nUnSplitted = 5; // Just another loop control :-(
@@ -2312,7 +2313,10 @@ void SwTabFrame::MakeAll(vcl::RenderContext* 
pRenderContext)
                         pLayout->GetBrowseWidthByTabFrame( *this ) );
                 }
 
-                setFramePrintAreaValid(false);
+                if (!isHiddenNow)
+                {
+                    setFramePrintAreaValid(false);
+                }
                 aNotify.SetLowersComplete( false );
             }
             SwFrame *pPre;
@@ -2415,7 +2419,10 @@ void SwTabFrame::MakeAll(vcl::RenderContext* 
pRenderContext)
                                 pHTMLLayout->GetBrowseWidthByTabFrame( *this ) 
);
                         }
 
-                        setFramePrintAreaValid(false);
+                        if (!isHiddenNow)
+                        {
+                            setFramePrintAreaValid(false);
+                        }
 
                         if (!oAccess)
                         {

Reply via email to