diff options
author | Balazs Varga <balazs.varga.extern@allotropia.de> | 2024-03-06 14:54:22 +0100 |
---|---|---|
committer | Balazs Varga <balazs.varga.extern@allotropia.de> | 2024-03-08 09:40:14 +0100 |
commit | f856733ed18353b8ac7d7e19348cf9b1107cc14b (patch) | |
tree | 7ddda8d3bc3d69a90c4de9482d51fe774f0bef0b /sw | |
parent | 4f680db872ae42912a417ca8d68f68e6acc8d3dd (diff) |
tdf#159443 - chart view: fix Data table is not rendered below chart
If we have 1 dataseries we will have no tickmarks, in that case the
distance between two tickmarks is the width of the chart.
Change-Id: Ifea11329f1dcb80e8e390c1408306d1df7d49ded
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164471
Tested-by: Jenkins
Reviewed-by: Balazs Varga <balazs.varga.extern@allotropia.de>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/layout/data/tdf159443.odt | bin | 0 -> 17838 bytes | |||
-rw-r--r-- | sw/qa/extras/layout/layout3.cxx | 30 |
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 Binary files differnew file mode 100644 index 000000000000..8ec733aedb06 --- /dev/null +++ b/sw/qa/extras/layout/data/tdf159443.odt 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(); |