summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/layout/README2
-rw-r--r--sw/qa/extras/layout/data/tdf105478_rowMinHeight.odtbin0 -> 14550 bytes
-rw-r--r--sw/qa/extras/layout/layout.cxx9
-rw-r--r--sw/source/core/layout/tabfrm.cxx16
4 files changed, 26 insertions, 1 deletions
diff --git a/sw/qa/extras/layout/README b/sw/qa/extras/layout/README
new file mode 100644
index 000000000000..82259fe15215
--- /dev/null
+++ b/sw/qa/extras/layout/README
@@ -0,0 +1,2 @@
+To run tests from this folder, do
+make CppunitTest_sw_layoutwriter CPPUNIT_TEST_NAME=xxxx
diff --git a/sw/qa/extras/layout/data/tdf105478_rowMinHeight.odt b/sw/qa/extras/layout/data/tdf105478_rowMinHeight.odt
new file mode 100644
index 000000000000..3a7fd600ceee
--- /dev/null
+++ b/sw/qa/extras/layout/data/tdf105478_rowMinHeight.odt
Binary files differ
diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx
index ea6ac4089a0b..27ba1d0a649c 100644
--- a/sw/qa/extras/layout/layout.cxx
+++ b/sw/qa/extras/layout/layout.cxx
@@ -2799,6 +2799,15 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTableExtrusion2)
assertXPath(pXmlDoc, sXPath, 0);
}
+CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf105478)
+{
+ createDoc("tdf105478_rowMinHeight.odt");
+ xmlDocPtr pXmlDoc = parseLayoutDump();
+
+ // Minimum row height forces the cell (with table header as row 1) to start on page 2, not page 1.
+ assertXPathContent(pXmlDoc, "/root/page[2]/body/tab/row[2]/cell/txt[1]", "Cell 1");
+}
+
CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf116848)
{
SwDoc* pDoc = createDoc("tdf116848.odt");
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