summaryrefslogtreecommitdiff
path: root/sw/qa
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2021-02-12 11:26:07 +0100
committerXisco Fauli <xiscofauli@libreoffice.org>2021-02-12 12:54:37 +0100
commit14c86d402243c0d2730ff38a1b8ac1a4456974de (patch)
tree655508ebb00adc0fa3b8db57d48b397c8d5e8c2e /sw/qa
parent60b0bb80b3aeb52477256152dcda9ec6e4dbb9fd (diff)
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@libreoffice.org>
Diffstat (limited to 'sw/qa')
-rw-r--r--sw/qa/extras/layout/data/tdf72727.odtbin0 -> 13943 bytes
-rw-r--r--sw/qa/extras/layout/layout2.cxx22
2 files changed, 22 insertions, 0 deletions
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
--- /dev/null
+++ b/sw/qa/extras/layout/data/tdf72727.odt
Binary files 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");