summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2018-03-11 11:58:13 +0300
committerMiklos Vajna <vmiklos@collabora.co.uk>2018-03-20 09:56:12 +0100
commit8ee612c29e0bfb2a9176a2d154217d4b4558a6cf (patch)
treecb59e5b5b929290cbadc2aa0feaaa7ffa72b1b34
parentc5f0c10b3cb3d7014bb127e8d811377279ab5228 (diff)
tdf#108482: ignore repeated headlines' previous instances height
Change-Id: Idae0b99c4171556612fb41bb02f1c48bbfeec4b2 Reviewed-on: https://gerrit.libreoffice.org/51073 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> (cherry picked from commit 82d9af7f14c808d48fa5db9420c85a8d26c79905) Reviewed-on: https://gerrit.libreoffice.org/51075 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
-rw-r--r--sw/qa/extras/odfimport/data/tdf108482.odtbin0 -> 9421 bytes
-rw-r--r--sw/qa/extras/odfimport/odfimport.cxx15
-rwxr-xr-xsw/source/core/layout/tabfrm.cxx3
3 files changed, 18 insertions, 0 deletions
diff --git a/sw/qa/extras/odfimport/data/tdf108482.odt b/sw/qa/extras/odfimport/data/tdf108482.odt
new file mode 100644
index 000000000000..c3ce2fc4272a
--- /dev/null
+++ b/sw/qa/extras/odfimport/data/tdf108482.odt
Binary files differ
diff --git a/sw/qa/extras/odfimport/odfimport.cxx b/sw/qa/extras/odfimport/odfimport.cxx
index a638dd818574..175fa31c888e 100644
--- a/sw/qa/extras/odfimport/odfimport.cxx
+++ b/sw/qa/extras/odfimport/odfimport.cxx
@@ -887,5 +887,20 @@ DECLARE_ODFIMPORT_TEST(testTdf115079, "tdf115079.odt")
// This document caused segfault when layouting
}
+DECLARE_ODFIMPORT_TEST(testTdf108482, "tdf108482.odt")
+{
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("The table on second page must have two rows",
+ OUString("2"), parseDump("count(/root/page[2]/body/tab/row)")
+ );
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("The second page table's first row must be the repeated headline",
+ OUString("Header"), parseDump("/root/page[2]/body/tab/row[1]/cell/txt")
+ );
+ // The first (repeated headline) row with vertical text orientation must have non-zero height
+ // (in my tests, it was 1135)
+ CPPUNIT_ASSERT_GREATER(
+ sal_Int32(1000), parseDump("/root/page[2]/body/tab/row[1]/infos/bounds", "height").toInt32()
+ );
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
index 911ab3380da2..a02236b905fa 100755
--- a/sw/source/core/layout/tabfrm.cxx
+++ b/sw/source/core/layout/tabfrm.cxx
@@ -4111,6 +4111,9 @@ static sal_uInt16 lcl_GetBottomLineDist( const SwRowFrame& rRow )
// on each following page
static SwTwips lcl_calcHeightOfRowBeforeThisFrame(const SwRowFrame& rRow)
{
+ // We don't need to account for previous instances of repeated headlines
+ if (rRow.IsRepeatedHeadline())
+ return 0;
SwRectFnSet aRectFnSet(&rRow);
const SwTableLine* pLine = rRow.GetTabLine();
const SwTabFrame* pTab = rRow.FindTabFrame();