diff options
author | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-08-07 14:38:01 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-08-07 14:44:51 -0400 |
commit | 3683cddee869ed4d3025bd8039df5625c016199d (patch) | |
tree | dc5d87071eb91da955fa9fe4650d23ca97a7307b | |
parent | 47999a4304cdb72ee1e78d223e671d17f240bd61 (diff) |
Write test for exporting data labels in area chart for OOXML.
Change-Id: Icbb17f56643f7d89bf739b0f218b2ca8a6309d9a
-rw-r--r-- | chart2/qa/extras/chart2export.cxx | 17 | ||||
-rwxr-xr-x | chart2/qa/extras/data/docx/area-chart-labels.docx | bin | 0 -> 24123 bytes |
2 files changed, 17 insertions, 0 deletions
diff --git a/chart2/qa/extras/chart2export.cxx b/chart2/qa/extras/chart2export.cxx index 2ebfd9d4d016..46fe22d58a02 100644 --- a/chart2/qa/extras/chart2export.cxx +++ b/chart2/qa/extras/chart2export.cxx @@ -72,6 +72,7 @@ public: void testDataLabelBordersDOCX(); void testDataLabel3DChartDOCX(); void testDataLabelDoughnutChartDOCX(); + void testDataLabelAreaChartDOCX(); void testDataLabelDefaultLineChartDOCX(); CPPUNIT_TEST_SUITE(Chart2ExportTest); @@ -110,6 +111,7 @@ public: CPPUNIT_TEST(testDataLabelBordersDOCX); CPPUNIT_TEST(testDataLabel3DChartDOCX); CPPUNIT_TEST(testDataLabelDoughnutChartDOCX); + CPPUNIT_TEST(testDataLabelAreaChartDOCX); CPPUNIT_TEST(testDataLabelDefaultLineChartDOCX); CPPUNIT_TEST_SUITE_END(); @@ -839,6 +841,21 @@ void Chart2ExportTest::testDataLabelDoughnutChartDOCX() assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:doughnutChart/c:ser/c:dLbls/c:dLbl/c:dLblPos", 0); } +void Chart2ExportTest::testDataLabelAreaChartDOCX() +{ + load("/chart2/qa/extras/data/docx/", "area-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 area charts. + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:areaChart/c:ser/c:dLbls/c:dLblPos", 0); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:areaChart/c:ser/c:dLbls/c:dLbl/c:dLblPos", 0); +} + void Chart2ExportTest::testDataLabelDefaultLineChartDOCX() { // This file was created by Word 2007, which doesn't provide default data diff --git a/chart2/qa/extras/data/docx/area-chart-labels.docx b/chart2/qa/extras/data/docx/area-chart-labels.docx Binary files differnew file mode 100755 index 000000000000..4db844112d4b --- /dev/null +++ b/chart2/qa/extras/data/docx/area-chart-labels.docx |