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

Xisco Fauli (via logerrit) logerrit at kemper.freedesktop.org
Fri Feb 12 11:55:24 UTC 2021


 sw/qa/extras/layout/data/tdf72727.odt |binary
 sw/qa/extras/layout/layout2.cxx       |   22 ++++++++++++++++++++++
 2 files changed, 22 insertions(+)

New commits:
commit 14c86d402243c0d2730ff38a1b8ac1a4456974de
Author:     Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Fri Feb 12 11:26:07 2021 +0100
Commit:     Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Fri Feb 12 12:54:37 2021 +0100

    tdf#72727: sw_layoutwriter: Add unittest
    
    Change-Id: I836c4a90e344c6f7fb1c60ac07d9575749adfa9e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110803
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>

diff --git a/sw/qa/extras/layout/data/tdf72727.odt b/sw/qa/extras/layout/data/tdf72727.odt
new file mode 100644
index 000000000000..606ad690703e
Binary files /dev/null and b/sw/qa/extras/layout/data/tdf72727.odt differ
diff --git a/sw/qa/extras/layout/layout2.cxx b/sw/qa/extras/layout/layout2.cxx
index 806da69af6a1..de6c48d56783 100644
--- a/sw/qa/extras/layout/layout2.cxx
+++ b/sw/qa/extras/layout/layout2.cxx
@@ -810,6 +810,28 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf124796)
         "15");
 }
 
+CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf72727)
+{
+    SwDoc* pDoc = createDoc("tdf72727.odt");
+    SwDocShell* pShell = pDoc->GetDocShell();
+
+    // Dump the rendering of the first page as an XML file.
+    std::shared_ptr<GDIMetaFile> xMetaFile = pShell->GetPreviewMetaFile();
+    MetafileXmlDump dumper;
+    xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile);
+    CPPUNIT_ASSERT(pXmlDoc);
+
+    // Without the fix in place, this test would have failed with
+    // - Expected: 1
+    // - Actual  : Series1
+    assertXPathContent(pXmlDoc, "/metafile/push/push/push/push[3]/push/push/push/textarray[1]/text",
+                       "1");
+    assertXPathContent(pXmlDoc, "/metafile/push/push/push/push[3]/push/push/push/textarray[2]/text",
+                       "2");
+    assertXPathContent(pXmlDoc, "/metafile/push/push/push/push[3]/push/push/push/textarray[3]/text",
+                       "3");
+}
+
 CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf130969)
 {
     SwDoc* pDoc = createDoc("tdf130969.docx");


More information about the Libreoffice-commits mailing list