diff options
author | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-08-07 18:57:17 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-08-07 19:01:43 -0400 |
commit | 3119e04b45a5598833aee2b114f6abcaf3c6808c (patch) | |
tree | 3ff2ce311ccfb63a0794c795092bf1429811382f /chart2/qa/extras | |
parent | 949279c8013022ff2935d73276cd57c9af069b97 (diff) |
Write test for exporting data label positions for percent stack bar chart.
Change-Id: Idebb56fc96828ec38d5c239c16e5b413a50c837f
Diffstat (limited to 'chart2/qa/extras')
-rw-r--r-- | chart2/qa/extras/chart2export.cxx | 17 | ||||
-rwxr-xr-x | chart2/qa/extras/data/docx/bar-chart-labels.docx | bin | 0 -> 24357 bytes |
2 files changed, 17 insertions, 0 deletions
diff --git a/chart2/qa/extras/chart2export.cxx b/chart2/qa/extras/chart2export.cxx index 664dba5f782f..a76b43da788c 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 testDataLabelBarChartDOCX(); void testDataLabelDoughnutChartDOCX(); void testDataLabelAreaChartDOCX(); void testDataLabelDefaultLineChartDOCX(); @@ -110,6 +111,7 @@ public: CPPUNIT_TEST(testAxisNumberFormatODS); CPPUNIT_TEST(testDataLabelBordersDOCX); CPPUNIT_TEST(testDataLabel3DChartDOCX); + CPPUNIT_TEST(testDataLabelBarChartDOCX); CPPUNIT_TEST(testDataLabelDoughnutChartDOCX); CPPUNIT_TEST(testDataLabelAreaChartDOCX); CPPUNIT_TEST(testDataLabelDefaultLineChartDOCX); @@ -826,6 +828,21 @@ void Chart2ExportTest::testDataLabel3DChartDOCX() assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:bar3DChart/c:ser/c:dLbls/c:dLbl/c:dLblPos", 0); } +void Chart2ExportTest::testDataLabelBarChartDOCX() +{ + load("/chart2/qa/extras/data/docx/", "bar-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); + + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser[1]/c:dLbls/c:dLblPos", "val", "ctr"); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser[2]/c:dLbls/c:dLblPos", "val", "inEnd"); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser[3]/c:dLbls/c:dLblPos", "val", "inBase"); +} + void Chart2ExportTest::testDataLabelDoughnutChartDOCX() { load("/chart2/qa/extras/data/docx/", "doughnut-chart-labels.docx"); diff --git a/chart2/qa/extras/data/docx/bar-chart-labels.docx b/chart2/qa/extras/data/docx/bar-chart-labels.docx Binary files differnew file mode 100755 index 000000000000..9ff8b4fd171f --- /dev/null +++ b/chart2/qa/extras/data/docx/bar-chart-labels.docx |