diff options
author | Justin Luth <justin.luth@collabora.com> | 2020-05-04 13:16:32 +0300 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2020-05-11 10:14:19 +0200 |
commit | aa5dc0b48cd4db6883c9b52c68b16170c9c81d1f (patch) | |
tree | 7a1bb6161ef3bad60db5c1093a1a5c7d2e9dcec8 /sw/source | |
parent | 356edfa963bd1d1c8e081a012e6a2ccbe7bf53d3 (diff) |
tdf#105478 sw layout: treat minHeight as "do not split row"
Already, if minHeight is greater than the content of the row,
then the row will "stay intact" and not split just because there
is space for part of it on the preceeding page. However, if the
content is greater than minHeight, it can split anywhere and
moveBwd - since LO 5.3.
At least for MS compatibility, this needs to not be split.
But others agreed to change this for ODT as well,
especially since this matches pre-5.3 behaviour,
and will help at design-time for MS interoperability,
as well as making minHeight consistent for the two
different scenarios.
Change-Id: Id15c44da2e7c38f6d552ffe32f92ab1c6b3c3349
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93414
Tested-by: Jenkins
Reviewed-by: Justin Luth <justin_luth@sil.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/core/layout/tabfrm.cxx | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx index 47a81b870125..bedce3a3f588 100644 --- a/sw/source/core/layout/tabfrm.cxx +++ b/sw/source/core/layout/tabfrm.cxx @@ -1091,7 +1091,21 @@ bool SwTabFrame::Split( const SwTwips nCutPos, bool bTryToSplit, bool bTableRowK m_pTable->SetRowsToRepeat(0); return false; } - else if ( !GetIndPrev() && nRepeat == nRowCount ) + + // Minimum row height has the same force as "do not split row" (as long as it fits on one page) + if ( bSplitRowAllowed && bTryToSplit && !pRow->IsRowSpanLine() ) + { + const SwFormatFrameSize &rSz = pRow->GetFormat()->GetFrameSize(); + const sal_Int32 nMinHeight = rSz.GetHeightSizeType() == SwFrameSize::Minimum ? rSz.GetHeight() : 0; + if ( nMinHeight > nRemainingSpaceForLastRow ) + { + // TODO: what if we are not in a page, but a column or something that is not page-sized. + const sal_Int32 nFullPageHeight = FindPageFrame()->getFramePrintArea().Height(); + bSplitRowAllowed = nMinHeight > nFullPageHeight; + } + } + + if ( !GetIndPrev() && nRepeat == nRowCount ) { // Second case: The first non-headline row does not fit to the page. // If it is not allowed to be split, or it contains a sub-row that |