summaryrefslogtreecommitdiff
path: root/chart2/qa/extras
diff options
context:
space:
mode:
authorBalazs Varga <balazs.varga991@gmail.com>2018-08-09 00:06:47 +0200
committerBartosz Kosiorek <gang65@poczta.onet.pl>2018-08-10 15:36:52 +0200
commit15035b98dc694bde4c4073fa75bdd2ce9d7e6670 (patch)
tree54627b70512c47e223837558674f88190735d959 /chart2/qa/extras
parent7861689c420f38223b8d53dd6911728ea7f26395 (diff)
tdf#96469 Export Data Point properties in Charts on DOCX/XLSX
If the color or other property of a datapoint in the chart deviates from the dataseries property, this patch will write it into a separate dPt tag and fixing the lost properies during OOXML export. Change-Id: I3d975675ac3691fcafe76de16e46851561eb2807 Reviewed-on: https://gerrit.libreoffice.org/58806 Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl> Tested-by: Jenkins
Diffstat (limited to 'chart2/qa/extras')
-rw-r--r--chart2/qa/extras/chart2export.cxx40
-rw-r--r--chart2/qa/extras/data/docx/testBarChartDataPointPropDOCX.docxbin0 -> 25590 bytes
-rw-r--r--chart2/qa/extras/data/xlsx/testBarChartDataPointPropXLSX.xlsxbin0 -> 14007 bytes
3 files changed, 40 insertions, 0 deletions
diff --git a/chart2/qa/extras/chart2export.cxx b/chart2/qa/extras/chart2export.cxx
index ffbe040a42dd..fa5ab14f0517 100644
--- a/chart2/qa/extras/chart2export.cxx
+++ b/chart2/qa/extras/chart2export.cxx
@@ -85,6 +85,7 @@ public:
void testChartTitlePropertiesColorFillDOCX();
void testChartTitlePropertiesGradientFillDOCX();
void testChartTitlePropertiesBitmapFillDOCX();
+ void testBarChartDataPointPropDOCX();
void testFdo83058dlblPos();
void testAutoTitleDelXLSX();
void testDispBlanksAsXLSX();
@@ -102,6 +103,7 @@ public:
void testChartTitlePropertiesColorFillXLSX();
void testChartTitlePropertiesGradientFillXLSX();
void testChartTitlePropertiesBitmapFillXLSX();
+ void testBarChartDataPointPropXLSX();
void testAxisCharacterPropertiesXLSX();
void testTitleCharacterPropertiesXLSX();
void testPlotVisOnlyXLSX();
@@ -165,6 +167,7 @@ public:
CPPUNIT_TEST(testChartTitlePropertiesColorFillDOCX);
CPPUNIT_TEST(testChartTitlePropertiesGradientFillDOCX);
CPPUNIT_TEST(testChartTitlePropertiesBitmapFillDOCX);
+ CPPUNIT_TEST(testBarChartDataPointPropDOCX);
CPPUNIT_TEST(testFdo83058dlblPos);
CPPUNIT_TEST(testAutoTitleDelXLSX);
CPPUNIT_TEST(testDispBlanksAsXLSX);
@@ -182,6 +185,7 @@ public:
CPPUNIT_TEST(testChartTitlePropertiesColorFillXLSX);
CPPUNIT_TEST(testChartTitlePropertiesGradientFillXLSX);
CPPUNIT_TEST(testChartTitlePropertiesBitmapFillXLSX);
+ CPPUNIT_TEST(testBarChartDataPointPropXLSX);
CPPUNIT_TEST(testAxisCharacterPropertiesXLSX);
CPPUNIT_TEST(testTitleCharacterPropertiesXLSX);
CPPUNIT_TEST(testPlotVisOnlyXLSX);
@@ -1101,6 +1105,24 @@ void Chart2ExportTest::testChartTitlePropertiesBitmapFillDOCX()
assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:spPr/a:ln/a:noFill", 1);
}
+void Chart2ExportTest::testBarChartDataPointPropDOCX()
+{
+ load("/chart2/qa/extras/data/docx/", "testBarChartDataPointPropDOCX.docx");
+ xmlDocPtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text");
+ CPPUNIT_ASSERT(pXmlDoc);
+
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:varyColors", "val", "0");
+
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dPt[1]/c:idx", "val", "1");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dPt[1]/c:spPr/a:gradFill/a:gsLst/a:gs[1]/a:srgbClr", "val", "f6f8fc");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dPt[1]/c:spPr/a:gradFill/a:gsLst/a:gs[2]/a:srgbClr", "val", "c7d5ed");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dPt[1]/c:spPr/a:ln/a:solidFill/a:srgbClr", "val", "70ad47");
+
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dPt[2]/c:idx", "val", "2");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dPt[2]/c:spPr/a:solidFill/a:srgbClr", "val", "ff0000");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dPt[2]/c:spPr/a:ln/a:solidFill/a:srgbClr", "val", "000000");
+}
+
void Chart2ExportTest::testBarChartRotation()
{
load ("/chart2/qa/extras/data/docx/", "barChartRotation.docx");
@@ -1566,6 +1588,24 @@ void Chart2ExportTest::testChartTitlePropertiesBitmapFillXLSX()
assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:spPr/a:ln/a:noFill", 1);
}
+void Chart2ExportTest::testBarChartDataPointPropXLSX()
+{
+ load("/chart2/qa/extras/data/xlsx/", "testBarChartDataPointPropXLSX.xlsx");
+ xmlDocPtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML");
+ CPPUNIT_ASSERT(pXmlDoc);
+
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:varyColors", "val", "0");
+
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dPt[1]/c:idx", "val", "1");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dPt[1]/c:spPr/a:solidFill/a:srgbClr", "val", "ff0000");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dPt[1]/c:spPr/a:ln/a:solidFill/a:srgbClr", "val", "000000");
+
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dPt[2]/c:idx", "val", "2");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dPt[2]/c:spPr/a:gradFill/a:gsLst/a:gs[1]/a:srgbClr", "val", "f6f8fc");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dPt[2]/c:spPr/a:gradFill/a:gsLst/a:gs[2]/a:srgbClr", "val", "c7d5ed");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dPt[2]/c:spPr/a:ln/a:solidFill/a:srgbClr", "val", "70ad47");
+}
+
void Chart2ExportTest::testAxisCharacterPropertiesXLSX()
{
load("/chart2/qa/extras/data/xlsx/", "axis_character_properties.xlsx");
diff --git a/chart2/qa/extras/data/docx/testBarChartDataPointPropDOCX.docx b/chart2/qa/extras/data/docx/testBarChartDataPointPropDOCX.docx
new file mode 100644
index 000000000000..66df9153d3c9
--- /dev/null
+++ b/chart2/qa/extras/data/docx/testBarChartDataPointPropDOCX.docx
Binary files differ
diff --git a/chart2/qa/extras/data/xlsx/testBarChartDataPointPropXLSX.xlsx b/chart2/qa/extras/data/xlsx/testBarChartDataPointPropXLSX.xlsx
new file mode 100644
index 000000000000..e73d16bd2dac
--- /dev/null
+++ b/chart2/qa/extras/data/xlsx/testBarChartDataPointPropXLSX.xlsx
Binary files differ