diff options
author | Balazs Varga <balazs.varga991@gmail.com> | 2019-01-28 10:09:51 +0100 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2019-01-30 09:10:17 +0100 |
commit | 2eac095e2a672db180dc816350c1585a65245c7c (patch) | |
tree | 8f12d885b2ed288ce1d6749ceb4bbd3286a415d3 /chart2 | |
parent | a16372dba916d3179a70434e4d26af13c2f1b540 (diff) |
tdf#122915 Chart OOXML: Export individual data label prop
Export the xLabelPropSet instead of the xPropset and the
individual data label formatting will not be disappeared.
Change-Id: Ic8c64543ad1e8b40d6d6a5cb7a9a244923e028f1
Reviewed-on: https://gerrit.libreoffice.org/66995
Tested-by: Jenkins
Reviewed-by: László Németh <nemeth@numbertext.org>
Tested-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'chart2')
-rw-r--r-- | chart2/qa/extras/chart2export.cxx | 16 | ||||
-rwxr-xr-x | chart2/qa/extras/data/xlsx/tdf122915.xlsx | bin | 0 -> 14310 bytes |
2 files changed, 15 insertions, 1 deletions
diff --git a/chart2/qa/extras/chart2export.cxx b/chart2/qa/extras/chart2export.cxx index e01ce9381ef9..dc36c3ad3c29 100644 --- a/chart2/qa/extras/chart2export.cxx +++ b/chart2/qa/extras/chart2export.cxx @@ -82,6 +82,7 @@ public: void testDataLabelDoughnutChartDOCX(); void testDataLabelAreaChartDOCX(); void testDataLabelDefaultLineChartDOCX(); + void testIndividualDataLabelProps(); void testChartTitlePropertiesColorFillDOCX(); void testChartTitlePropertiesGradientFillDOCX(); void testChartTitlePropertiesBitmapFillDOCX(); @@ -170,6 +171,7 @@ public: CPPUNIT_TEST(testDataLabelDoughnutChartDOCX); CPPUNIT_TEST(testDataLabelAreaChartDOCX); CPPUNIT_TEST(testDataLabelDefaultLineChartDOCX); + CPPUNIT_TEST(testIndividualDataLabelProps); CPPUNIT_TEST(testChartTitlePropertiesColorFillDOCX); CPPUNIT_TEST(testChartTitlePropertiesGradientFillDOCX); CPPUNIT_TEST(testChartTitlePropertiesBitmapFillDOCX); @@ -1094,6 +1096,17 @@ void Chart2ExportTest::testDataLabelDefaultLineChartDOCX() CPPUNIT_ASSERT_EQUAL_MESSAGE("Line chart's default label placement should be 'right'.", chart::DataLabelPlacement::RIGHT, nLabelPlacement ); } +void Chart2ExportTest::testIndividualDataLabelProps() +{ + load("/chart2/qa/extras/data/xlsx/", "tdf122915.xlsx"); + xmlDocPtr pXmlDoc = parseExport("xl/charts/chart","Calc Office Open XML"); + CPPUNIT_ASSERT(pXmlDoc); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:scatterChart/c:ser[3]/c:dLbls/c:dLbl/c:txPr/a:p/a:pPr/a:defRPr", "b", "1"); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:scatterChart/c:ser[3]/c:dLbls/c:dLbl/c:txPr/a:p/a:pPr/a:defRPr", "sz", "1600"); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:scatterChart/c:ser[3]/c:dLbls/c:dLbl/c:txPr/a:p/a:pPr/a:defRPr/a:solidFill/a:srgbClr", "val", "ff0000"); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:scatterChart/c:ser[3]/c:dLbls/c:dLbl/c:txPr/a:p/a:pPr/a:defRPr/a:latin", "typeface", "Times New Roman"); +} + void Chart2ExportTest::testChartTitlePropertiesColorFillDOCX() { load("/chart2/qa/extras/data/docx/", "testChartTitlePropertiesColorFill.docx"); @@ -1736,7 +1749,8 @@ void Chart2ExportTest::testCustomDataLabel() load("/chart2/qa/extras/data/pptx/", "tdf115107.pptx"); xmlDocPtr pXmlDoc = parseExport("ppt/charts/chart1", "Impress MS PowerPoint 2007 XML"); CPPUNIT_ASSERT(pXmlDoc); - assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dLbls/c:dLbl[1]/c:txPr/a:p/a:pPr/a:defRPr/a:solidFill/a:srgbClr", "val", "404040"); + // Check the data labels font color for the complete data series + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dLbls/c:txPr/a:p/a:pPr/a:defRPr/a:solidFill/a:srgbClr", "val", "404040"); Reference<chart2::XChartDocument> xChartDoc(getChartDocFromDrawImpress(0, 0), uno::UNO_QUERY); CPPUNIT_ASSERT(xChartDoc.is()); diff --git a/chart2/qa/extras/data/xlsx/tdf122915.xlsx b/chart2/qa/extras/data/xlsx/tdf122915.xlsx Binary files differnew file mode 100755 index 000000000000..ff20e04baf22 --- /dev/null +++ b/chart2/qa/extras/data/xlsx/tdf122915.xlsx |