From 007bf60611e2ba5a65ffabe80dbb0e279fcb9f26 Mon Sep 17 00:00:00 2001 From: Balazs Varga Date: Tue, 11 Jun 2019 13:26:50 +0200 Subject: tdf#75659 Chart: fix empty legend at not available legend names MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit by using localized versions of "Unnamed Series 1" etc. Note: OOXML files don't contain the default or fallback legend names used by MSO in this case, so the original empty string replacement of the missing names resulted bad chart import. Change-Id: I2897c70d9003e1ab3241dd569de0d79821d896b1 Reviewed-on: https://gerrit.libreoffice.org/73817 Reviewed-by: László Németh Tested-by: László Németh --- sw/qa/extras/layout/data/tdf75659.docx | Bin 0 -> 25109 bytes sw/qa/extras/layout/layout.cxx | 25 +++++++++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 sw/qa/extras/layout/data/tdf75659.docx (limited to 'sw') diff --git a/sw/qa/extras/layout/data/tdf75659.docx b/sw/qa/extras/layout/data/tdf75659.docx new file mode 100644 index 000000000000..a3cde330f8f5 Binary files /dev/null and b/sw/qa/extras/layout/data/tdf75659.docx differ diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx index 1175d25ef573..325c0ef49e64 100644 --- a/sw/qa/extras/layout/layout.cxx +++ b/sw/qa/extras/layout/layout.cxx @@ -2327,6 +2327,31 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf125335) // This failed, if the legend first label is not "Data3". The legend position is bottom. } +CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf75659) +{ + SwDoc* pDoc = createDoc("tdf75659.docx"); + SwDocShell* pShell = pDoc->GetDocShell(); + + // Dump the rendering of the first page as an XML file. + std::shared_ptr xMetaFile = pShell->GetPreviewMetaFile(); + MetafileXmlDump dumper; + xmlDocPtr pXmlDoc = dumpAndParse(dumper, *xMetaFile); + CPPUNIT_ASSERT(pXmlDoc); + + assertXPathContent(pXmlDoc, + "/metafile/push[1]/push[1]/push[1]/push[4]/push[1]/textarray[17]/text", + "Unnamed Series 1"); + + assertXPathContent(pXmlDoc, + "/metafile/push[1]/push[1]/push[1]/push[4]/push[1]/textarray[18]/text", + "Unnamed Series 2"); + + assertXPathContent(pXmlDoc, + "/metafile/push[1]/push[1]/push[1]/push[4]/push[1]/textarray[19]/text", + "Unnamed Series 3"); + // These failed, if the legend names are empty strings. +} + CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf108021) { SwDoc* pDoc = createDoc("tdf108021.odt"); -- cgit