From f394d911c00d96537841873d1ba20be9df58f5fd Mon Sep 17 00:00:00 2001 From: Balazs Varga Date: Wed, 13 Feb 2019 08:40:55 +0100 Subject: tdf#123400 OOXML Chart: Export Data Label Separator MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Export the data label separator XML tag and the separated character to OOXML. Change-Id: I9b3bcb588e42a42494107ebde70f4a72492cfac4 Reviewed-on: https://gerrit.libreoffice.org/67753 Tested-by: Jenkins Reviewed-by: László Németh (cherry picked from commit e32e5e61b509dcae0462419acfc556d445895840) Reviewed-on: https://gerrit.libreoffice.org/67772 Reviewed-by: Markus Mohrhard --- chart2/qa/extras/chart2export.cxx | 20 ++++++++++++++++++++ chart2/qa/extras/data/docx/testLabelSeparator.docx | Bin 0 -> 25333 bytes 2 files changed, 20 insertions(+) create mode 100755 chart2/qa/extras/data/docx/testLabelSeparator.docx (limited to 'chart2') diff --git a/chart2/qa/extras/chart2export.cxx b/chart2/qa/extras/chart2export.cxx index 45d9ff73f08f..88d58bd7c683 100644 --- a/chart2/qa/extras/chart2export.cxx +++ b/chart2/qa/extras/chart2export.cxx @@ -117,6 +117,7 @@ public: void testCustomDataLabel(); void testCustomDataLabelMultipleSeries(); void testNumberFormatExportPPTX(); + void testLabelSeparatorExportDOCX(); void testChartTitlePropertiesColorFillPPTX(); void testChartTitlePropertiesGradientFillPPTX(); void testChartTitlePropertiesBitmapFillPPTX(); @@ -203,6 +204,7 @@ public: CPPUNIT_TEST(testCustomDataLabel); CPPUNIT_TEST(testCustomDataLabelMultipleSeries); CPPUNIT_TEST(testNumberFormatExportPPTX); + CPPUNIT_TEST(testLabelSeparatorExportDOCX); CPPUNIT_TEST(testChartTitlePropertiesColorFillPPTX); CPPUNIT_TEST(testChartTitlePropertiesGradientFillPPTX); CPPUNIT_TEST(testChartTitlePropertiesBitmapFillPPTX); @@ -1892,6 +1894,24 @@ void Chart2ExportTest::testNumberFormatExportPPTX() assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dLbls/c:numFmt", "sourceLinked", "0"); } +void Chart2ExportTest::testLabelSeparatorExportDOCX() +{ + load("/chart2/qa/extras/data/docx/", "testLabelSeparator.docx"); + + Reference xChartDoc(getChartDocFromWriter(0), uno::UNO_QUERY); + CPPUNIT_ASSERT(xChartDoc.is()); + + xmlDocPtr pXmlDoc = parseExport("word/charts/chart","Office Open XML Text"); + CPPUNIT_ASSERT(pXmlDoc); + + // The text separator should be a new line + assertXPathContent(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser[1]/c:dLbls/c:separator", "\n"); + // The text separator should be a comma + assertXPathContent(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser[2]/c:dLbls/c:separator", ", "); + // The text separator should be a semicolon + assertXPathContent(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser[3]/c:dLbls/c:separator", "; "); +} + void Chart2ExportTest::testChartTitlePropertiesColorFillPPTX() { load("/chart2/qa/extras/data/pptx/", "testChartTitlePropertiesColorFill.pptx"); diff --git a/chart2/qa/extras/data/docx/testLabelSeparator.docx b/chart2/qa/extras/data/docx/testLabelSeparator.docx new file mode 100755 index 000000000000..452fdccc9403 Binary files /dev/null and b/chart2/qa/extras/data/docx/testLabelSeparator.docx differ -- cgit