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

Miklos Vajna vmiklos at collabora.co.uk
Tue Jun 20 10:35:04 UTC 2017


 sw/qa/extras/uiwriter/data/table-in-sect.odt |binary
 sw/qa/extras/uiwriter/data/tdf108524.odt     |binary
 sw/qa/extras/uiwriter/uiwriter.cxx           |   30 +++++++++++++++++++++++++++
 3 files changed, 30 insertions(+)

New commits:
commit e9d2016648c7fdfc57932ac0793547cf099749be
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Tue Jun 20 09:21:10 2017 +0200

    tdf#108524 sw: add split section in table testcase
    
    And if we're at it, test the other way around as well, I almost broke
    it.
    
    Change-Id: Ia81e46f218336e5db13dafdbad7b896d8dadaf46
    Reviewed-on: https://gerrit.libreoffice.org/38999
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
    Tested-by: Jenkins <ci at libreoffice.org>

diff --git a/sw/qa/extras/uiwriter/data/table-in-sect.odt b/sw/qa/extras/uiwriter/data/table-in-sect.odt
new file mode 100644
index 000000000000..f439edef997e
Binary files /dev/null and b/sw/qa/extras/uiwriter/data/table-in-sect.odt differ
diff --git a/sw/qa/extras/uiwriter/data/tdf108524.odt b/sw/qa/extras/uiwriter/data/tdf108524.odt
new file mode 100644
index 000000000000..d8978b269cab
Binary files /dev/null and b/sw/qa/extras/uiwriter/data/tdf108524.odt differ
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx
index e1d73952b9e5..4654c2b0d968 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -254,6 +254,8 @@ public:
     void testMsWordCompTrailingBlanks();
     void testCreateDocxAnnotation();
     void testTdf107976();
+    void testTdf108524();
+    void testTableInSection();
 
     CPPUNIT_TEST_SUITE(SwUiWriterTest);
     CPPUNIT_TEST(testReplaceForward);
@@ -395,6 +397,8 @@ public:
     CPPUNIT_TEST(testMsWordCompTrailingBlanks);
     CPPUNIT_TEST(testCreateDocxAnnotation);
     CPPUNIT_TEST(testTdf107976);
+    CPPUNIT_TEST(testTdf108524);
+    CPPUNIT_TEST(testTableInSection);
     CPPUNIT_TEST_SUITE_END();
 
 private:
@@ -4948,6 +4952,32 @@ void SwUiWriterTest::testTdf58604()
 #endif
 }
 
+void SwUiWriterTest::testTdf108524()
+{
+    createDoc("tdf108524.odt");
+    xmlDocPtr pXmlDoc = parseLayoutDump();
+    // In total we expect two cells containing a section.
+    assertXPath(pXmlDoc, "/root/page/body/tab/row/cell/section", 2);
+
+    assertXPath(pXmlDoc, "/root/page[1]/body/tab/row/cell/section", 1);
+    // This was 0, section wasn't split, instead it was only on the first page
+    // and it was cut off.
+    assertXPath(pXmlDoc, "/root/page[2]/body/tab/row/cell/section", 1);
+}
+
+void SwUiWriterTest::testTableInSection()
+{
+    // The document has a section, containing a table that spans over 2 pages.
+    createDoc("table-in-sect.odt");
+    xmlDocPtr pXmlDoc = parseLayoutDump();
+    // In total we expect 4 cells.
+    assertXPath(pXmlDoc, "/root/page/body/section/tab/row/cell", 4);
+
+    // Assert that on both pages the section contains 2 cells.
+    assertXPath(pXmlDoc, "/root/page[1]/body/section/tab/row/cell", 2);
+    assertXPath(pXmlDoc, "/root/page[2]/body/section/tab/row/cell", 2);
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(SwUiWriterTest);
 CPPUNIT_PLUGIN_IMPLEMENT();
 


More information about the Libreoffice-commits mailing list