summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Luth <justin_luth@sil.org>2018-06-25 19:39:55 +0300
committerMiklos Vajna <vmiklos@collabora.co.uk>2018-07-03 17:45:24 +0200
commitd96ba7a7df7d28558adaaf9b28026dd73855c3cb (patch)
treef9e48792300030f8232777df0e57fa4071b452c4
parentd3566e105819cda1e42f51fd5967a971c8f941ea (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> (cherry picked from commit fc90f7ea8034e9585486ea9cc3e55771aca85540) Reviewed-on: https://gerrit.libreoffice.org/56791 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
-rw-r--r--sw/source/core/layout/tabfrm.cxx3
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