diff options
author | Justin Luth <justin_luth@sil.org> | 2018-06-25 19:39:55 +0300 |
---|---|---|
committer | Justin Luth <justin_luth@sil.org> | 2018-07-02 06:03:07 +0200 |
commit | fc90f7ea8034e9585486ea9cc3e55771aca85540 (patch) | |
tree | 6a45b5ce97ded2569dc4584d562c0f986cf564a9 /sw | |
parent | 5560a23cbc1e61cf55bb8c98202d7c93e21f60f1 (diff) |
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@sil.org>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/layout/tabfrm.cxx | 3 |
1 files changed, 2 insertions, 1 deletions
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 |