diff options
author | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-08-07 10:40:18 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-08-07 14:21:53 -0400 |
commit | 96f890c63848db2975585a3fb5ae30e397c6add8 (patch) | |
tree | d8dbc7299a59af5aea723ba2126d7e02da302d97 /chart2/qa | |
parent | b0eff57aaeb34d25dc011249828f5029df951f57 (diff) |
Write test for doughnut chart export of data labels to OOXML.
We must not export label position properties for doughnut charts, else
MS Office would think the file is corrupt.
Change-Id: Icfab257ffb6da945b8add661e6455aa66cc475ab
Diffstat (limited to 'chart2/qa')
-rw-r--r-- | chart2/qa/extras/chart2export.cxx | 17 | ||||
-rwxr-xr-x | chart2/qa/extras/data/docx/doughnut-chart-labels.docx | bin | 0 -> 23902 bytes |
2 files changed, 17 insertions, 0 deletions
diff --git a/chart2/qa/extras/chart2export.cxx b/chart2/qa/extras/chart2export.cxx index 67d25f974a47..4d51dc41c7c2 100644 --- a/chart2/qa/extras/chart2export.cxx +++ b/chart2/qa/extras/chart2export.cxx @@ -71,6 +71,7 @@ public: void testAxisNumberFormatODS(); void testDataLabelBordersDOCX(); void testDataLabel3DChartDOCX(); + void testDataLabelDoughnutChartDOCX(); CPPUNIT_TEST_SUITE(Chart2ExportTest); CPPUNIT_TEST(test); @@ -107,6 +108,7 @@ public: CPPUNIT_TEST(testAxisNumberFormatODS); CPPUNIT_TEST(testDataLabelBordersDOCX); CPPUNIT_TEST(testDataLabel3DChartDOCX); + CPPUNIT_TEST(testDataLabelDoughnutChartDOCX); CPPUNIT_TEST_SUITE_END(); protected: @@ -820,6 +822,21 @@ void Chart2ExportTest::testDataLabel3DChartDOCX() assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dLbls/c:dLbl/c:dLblPos", 0); } +void Chart2ExportTest::testDataLabelDoughnutChartDOCX() +{ + load("/chart2/qa/extras/data/docx/", "doughnut-chart-labels.docx"); + + Reference<chart2::XChartDocument> xChartDoc(getChartDocFromWriter(0), uno::UNO_QUERY); + CPPUNIT_ASSERT(xChartDoc.is()); + + xmlDocPtr pXmlDoc = parseExport("word/charts/chart","Office Open XML Text"); + CPPUNIT_ASSERT(pXmlDoc); + + // We must not export label position attributes for doughnut charts. + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:doughnutChart/c:ser/c:dLbls/c:dLblPos", 0); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:doughnutChart/c:ser/c:dLbls/c:dLbl/c:dLblPos", 0); +} + void Chart2ExportTest::testBarChartRotation() { load ("/chart2/qa/extras/data/docx/", "barChartRotation.docx"); diff --git a/chart2/qa/extras/data/docx/doughnut-chart-labels.docx b/chart2/qa/extras/data/docx/doughnut-chart-labels.docx Binary files differnew file mode 100755 index 000000000000..559208578f46 --- /dev/null +++ b/chart2/qa/extras/data/docx/doughnut-chart-labels.docx |