sw/qa/extras/odfimport/data/tdf108482.odt |binary sw/qa/extras/odfimport/odfimport.cxx | 15 +++++++++++++++ sw/source/core/layout/tabfrm.cxx | 3 +++ 3 files changed, 18 insertions(+)
New commits: commit 8ee612c29e0bfb2a9176a2d154217d4b4558a6cf Author: Mike Kaganski <mike.kagan...@collabora.com> Date: Sun Mar 11 11:58:13 2018 +0300 tdf#108482: ignore repeated headlines' previous instances height Change-Id: Idae0b99c4171556612fb41bb02f1c48bbfeec4b2 Reviewed-on: https://gerrit.libreoffice.org/51073 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com> (cherry picked from commit 82d9af7f14c808d48fa5db9420c85a8d26c79905) Reviewed-on: https://gerrit.libreoffice.org/51075 Reviewed-by: Miklos Vajna <vmik...@collabora.co.uk> 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 Binary files /dev/null and b/sw/qa/extras/odfimport/data/tdf108482.odt 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(); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits