diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2018-03-11 11:58:13 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2018-03-11 11:50:46 +0100 |
commit | 82d9af7f14c808d48fa5db9420c85a8d26c79905 (patch) | |
tree | db4d3ee2e2755831afc07898972d2573eafed5ed | |
parent | f9831de353742485b8241fb2bd8ca6b23e3c1c75 (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>
-rw-r--r-- | sw/qa/extras/odfimport/data/tdf108482.odt | bin | 0 -> 9421 bytes | |||
-rw-r--r-- | sw/qa/extras/odfimport/odfimport.cxx | 15 | ||||
-rw-r--r-- | sw/source/core/layout/tabfrm.cxx | 3 |
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 Binary files differnew file mode 100644 index 000000000000..c3ce2fc4272a --- /dev/null +++ b/sw/qa/extras/odfimport/data/tdf108482.odt diff --git a/sw/qa/extras/odfimport/odfimport.cxx b/sw/qa/extras/odfimport/odfimport.cxx index 5ab5c5910ba3..1d4737318517 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 fec639ea943e..67ee9cc37a18 100644 --- a/sw/source/core/layout/tabfrm.cxx +++ b/sw/source/core/layout/tabfrm.cxx @@ -4101,6 +4101,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(); |