From b3057b7944dc52cc2ee3c57f44d4265c625e8dad Mon Sep 17 00:00:00 2001 From: Tünde Tóth Date: Tue, 23 Jun 2020 13:52:39 +0200 Subject: tdf#134247 Chart OOXML import: fix order of legend entries MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The order of legend entries was reversed in stacked column, line and area charts. Change-Id: Ia4a439aa6cee0619ad323c3fb728ff358cf28537 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96941 Tested-by: Jenkins Tested-by: László Németh Reviewed-by: László Németh --- sw/qa/extras/layout/data/legend-itemorder-min.docx | Bin 0 -> 27053 bytes sw/qa/extras/layout/layout.cxx | 17 +++++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 sw/qa/extras/layout/data/legend-itemorder-min.docx (limited to 'sw/qa') diff --git a/sw/qa/extras/layout/data/legend-itemorder-min.docx b/sw/qa/extras/layout/data/legend-itemorder-min.docx new file mode 100644 index 000000000000..8783d3908267 Binary files /dev/null and b/sw/qa/extras/layout/data/legend-itemorder-min.docx differ diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx index 2f324bb026bd..a44d0396cf3d 100644 --- a/sw/qa/extras/layout/layout.cxx +++ b/sw/qa/extras/layout/layout.cxx @@ -2324,6 +2324,23 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf125335) // This failed, if the legend first label is not "Data3". The legend position is bottom. } +CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf134247) +{ + SwDoc* pDoc = createDoc("legend-itemorder-min.docx"); + 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); + + assertXPathContent(pXmlDoc, + "/metafile/push[1]/push[1]/push[1]/push[4]/push[1]/textarray[14]/text", + "1. adatsor"); + // This failed, if the legend first label is not "1. adatsor". +} + CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf75659) { SwDoc* pDoc = createDoc("tdf75659.docx"); -- cgit