[Libreoffice-commits] core.git: sw/source

Justin Luth justin_luth at sil.org
Mon Jul 2 04:03:30 UTC 2018


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

New commits:
commit fc90f7ea8034e9585486ea9cc3e55771aca85540
Author: Justin Luth <justin_luth at sil.org>
Date:   Mon Jun 25 19:39:55 2018 +0300

    tdf#108000 sw layout: ignore emulated keep on large tables
    
    There is no point in a very large (multipage) table keeping with
    the following content and it just makes the layout more complex.
    This is especially true when we are emulating this using
    MSWord's convention, and not LO's native table-keep option.
    
    This patch only affects my earlier code for emulated tables.
    Otherwise, something about the general logic could loop
    forever in certain huge tables. This seemed like a very
    reasonable compromise.
    
    Change-Id: Ic1bde12b266e71fc9f608ec4d1223277108750fa
    Reviewed-on: https://gerrit.libreoffice.org/56314
    Tested-by: Jenkins
    Reviewed-by: Justin Luth <justin_luth at sil.org>

diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
index 9817b082b688..8fad05cf2508 100644
--- a/sw/source/core/layout/tabfrm.cxx
+++ b/sw/source/core/layout/tabfrm.cxx
@@ -1862,8 +1862,9 @@ void SwTabFrame::MakeAll(vcl::RenderContext* pRenderContext)
     auto pAccess = o3tl::make_unique<SwBorderAttrAccess>(SwFrame::GetCache(), this);
     const SwBorderAttrs *pAttrs = pAccess->Get();
 
+    const bool bLargeTable = GetTable()->GetTabLines().size() > 64;  //arbitrary value, virtually guaranteed to be larger than one page.
     // The beloved keep attribute
-    const bool bEmulateTableKeep = AreAllRowsKeepWithNext( GetFirstNonHeadlineRow() );
+    const bool bEmulateTableKeep = !bLargeTable && AreAllRowsKeepWithNext( GetFirstNonHeadlineRow() );
     const bool bKeep = IsKeep(pAttrs->GetAttrSet().GetKeep(), GetBreakItem(), bEmulateTableKeep);
 
     // All rows should keep together


More information about the Libreoffice-commits mailing list