[Libreoffice-commits] core.git: sw/qa sw/source

Mike Kaganski mike.kaganski at collabora.com
Sun Mar 11 10:51:09 UTC 2018


 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 82d9af7f14c808d48fa5db9420c85a8d26c79905
Author: Mike Kaganski <mike.kaganski at 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 <ci at libreoffice.org>
    Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>

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 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();


More information about the Libreoffice-commits mailing list