[Libreoffice-commits] core.git: Branch 'feature/cib_contract57d' - sw/source

Michael Stahl (via logerrit) logerrit at kemper.freedesktop.org
Wed Jun 30 13:14:26 UTC 2021


 sw/source/core/layout/wsfrm.cxx |   17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

New commits:
commit 798c41960be08155f4f9734c6307615ab45c134e
Author:     Michael Stahl <michael.stahl at allotropia.de>
AuthorDate: Fri Jun 25 10:25:59 2021 +0200
Commit:     Michael Stahl <michael.stahl at allotropia.de>
CommitDate: Wed Jun 30 14:53:35 2021 +0200

    sw: layout: fix table split loop caused by RemoveFollowFlowLinePending
    
    In no_view.odt, the table 1340 does RemoveFollowFlowLine(), then splits
    again, and by the time Split() returns, its flag
    m_bRemoveFollowFlowLinePending is set and so in the next
    SwTabFrame::MakeAll() it will do the same thing again, until eventually
    it hits
    layact.cxx:544: LoopControl_1 in SwLayAction::InternalAction
    
    The flag is set during lcl_RecalcSplitLine(), in SwContentFrame::Cut(),
    which operates under the assumption that there are no other cells in the
    follow flow line that may contain content frames.
    
    This only happens if "Verdana" and "Arial" fonts are available and not
    substituted with "DejaVu Sans" etc.
    
    (regression from c4af8b0f106f31b6e79a145bc4ab83bb6a55c808)
    
    Unfortunately this uncovers another pagination bug in testTdf88496
    which was hidden by this flag being set from text frames that shouldn't
    exist anyway.
    
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117851
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.stahl at allotropia.de>
    (cherry picked from commit a0cd270a99f43049fc099ddd463e57aa243d5b0e)
    
    Change-Id: I3cc82c13bfc06960b827aefc64f5b5b12520955a
    (cherry picked from commit d5c9e1b939d76748f30002e73982475856b68a16)

diff --git a/sw/source/core/layout/wsfrm.cxx b/sw/source/core/layout/wsfrm.cxx
index 95af7d95dda2..1e496df41395 100644
--- a/sw/source/core/layout/wsfrm.cxx
+++ b/sw/source/core/layout/wsfrm.cxx
@@ -45,6 +45,7 @@
 #include <fmtcntnt.hxx>
 #include <ftnfrm.hxx>
 #include <tabfrm.hxx>
+#include <rowfrm.hxx>
 #include <flyfrms.hxx>
 #include <sectfrm.hxx>
 #include <fmtclds.hxx>
@@ -1154,6 +1155,7 @@ void SwContentFrame::Cut()
         }
     }
 
+    SwTabFrame* pMasterTab(nullptr);
     if( nullptr != (pFrame = GetIndNext()) )
     {
         // The old follow may have calculated a gap to the predecessor which
@@ -1217,11 +1219,9 @@ void SwContentFrame::Cut()
             if ( IsInTab() )
             {
                 SwTabFrame* pThisTab = FindTabFrame();
-                SwTabFrame* pMasterTab = pThisTab && pThisTab->IsFollow() ? pThisTab->FindMaster() : nullptr;
-                if ( pMasterTab )
+                if (pThisTab && pThisTab->IsFollow())
                 {
-                    pMasterTab->InvalidatePos_();
-                    pMasterTab->SetRemoveFollowFlowLinePending( true );
+                    pMasterTab = pThisTab->FindMaster();
                 }
             }
         }
@@ -1229,8 +1229,17 @@ void SwContentFrame::Cut()
     //Remove first, then shrink the upper.
     SwLayoutFrame *pUp = GetUpper();
     RemoveFromLayout();
+    assert(pUp || !pMasterTab);
     if ( pUp )
     {
+        if (pMasterTab
+            && !pMasterTab->GetFollow()->GetFirstNonHeadlineRow()->ContainsContent())
+        {   // only do this if there's no content in other cells of the row!
+            pMasterTab->InvalidatePos_();
+            pMasterTab->SetRemoveFollowFlowLinePending(true);
+        }
+
+
         SwSectionFrame *pSct = nullptr;
         if ( !pUp->Lower() &&
              ( ( pUp->IsFootnoteFrame() && !pUp->IsColLocked() ) ||


More information about the Libreoffice-commits mailing list