From f856733ed18353b8ac7d7e19348cf9b1107cc14b Mon Sep 17 00:00:00 2001 From: Balazs Varga Date: Wed, 6 Mar 2024 14:54:22 +0100 Subject: 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 --- sw/qa/extras/layout/data/tdf159443.odt | Bin 0 -> 17838 bytes sw/qa/extras/layout/layout3.cxx | 30 ++++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 sw/qa/extras/layout/data/tdf159443.odt (limited to 'sw') 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 Binary files /dev/null and b/sw/qa/extras/layout/data/tdf159443.odt 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 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(); -- cgit labora/co-22.05-testflight'>distro/collabora/co-22.05-testflight LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
AgeCommit message (Expand)Author