summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/layout/data/tdf159443.odtbin0 -> 17838 bytes
-rw-r--r--sw/qa/extras/layout/layout3.cxx30
2 files changed, 30 insertions, 0 deletions
diff --git a/sw/qa/extras/layout/data/tdf159443.odt b/sw/qa/extras/layout/data/tdf159443.odt
new file mode 100644
index 000000000000..8ec733aedb06
--- /dev/null
+++ b/sw/qa/extras/layout/data/tdf159443.odt
Binary files differ
diff --git a/sw/qa/extras/layout/layout3.cxx b/sw/qa/extras/layout/layout3.cxx
index de11ac7d788d..f96b786cc093 100644
--- a/sw/qa/extras/layout/layout3.cxx
+++ b/sw/qa/extras/layout/layout3.cxx
@@ -2389,6 +2389,36 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testPageBreakInHiddenSection)
assertXPath(pXmlDoc, "//page[4]/body/section/infos/bounds"_ostr, "height"_ostr, u"0"_ustr);
}
+CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf159443)
+{
+ // Given a document with chart, which have a datatable
+ createSwDoc("tdf159443.odt");
+ SwDoc* pDoc = getSwDoc();
+ 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, this would fail:
+ //// - Expected: DataSeries1
+ //// - Actual : 1.25
+ //// - In <>, XPath contents of child does not match
+ assertXPathContent(
+ pXmlDoc,
+ "/metafile/push[1]/push[1]/push[1]/push[3]/push[1]/push[1]/push[1]/push[47]/textarray/text"_ostr,
+ "DataSeries1");
+ assertXPathContent(
+ pXmlDoc,
+ "/metafile/push[1]/push[1]/push[1]/push[3]/push[1]/push[1]/push[1]/push[49]/textarray/text"_ostr,
+ "Category1");
+ assertXPathContent(
+ pXmlDoc,
+ "/metafile/push[1]/push[1]/push[1]/push[3]/push[1]/push[1]/push[1]/push[51]/textarray/text"_ostr,
+ "4.3");
+}
+
} // end of anonymous namespace
CPPUNIT_PLUGIN_IMPLEMENT();