chart2/qa/extras/chart2export.cxx | 21 +++++++++++++++++++-- chart2/qa/extras/data/docx/area-chart-labels.docx |binary oox/source/export/chartexport.cxx | 1 + 3 files changed, 20 insertions(+), 2 deletions(-)
New commits: commit f4677f58a26d1183af5c91470be0e4f782e6cbeb Author: Kohei Yoshida <kohei.yosh...@collabora.com> Date: Thu Aug 7 14:43:36 2014 -0400 Area chart also doesn't support label position property. Change-Id: I612ca7426b2b3de07d4afe1d78cd809f1f6b37bb diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx index 027a566..0845f71 100644 --- a/oox/source/export/chartexport.cxx +++ b/oox/source/export/chartexport.cxx @@ -2640,6 +2640,7 @@ void ChartExport::exportDataLabels( aParam.mbExport = true; break; case chart::TYPEID_DOUGHNUT: + case chart::TYPEID_AREA: // Doughnut charts don't support label placement. aParam.mbExport = false; break; commit 9c2af3c885bd007bb36877f7b59e4035282d14f4 Author: Kohei Yoshida <kohei.yosh...@collabora.com> Date: Thu Aug 7 14:40:38 2014 -0400 Fix the test. It's bar3DChart not barChart. Change-Id: I8e504dfee81557a1965bb4bbce4ea975c13fe775 diff --git a/chart2/qa/extras/chart2export.cxx b/chart2/qa/extras/chart2export.cxx index 46fe22d..664dba5 100644 --- a/chart2/qa/extras/chart2export.cxx +++ b/chart2/qa/extras/chart2export.cxx @@ -822,8 +822,8 @@ void Chart2ExportTest::testDataLabel3DChartDOCX() // We must not export label position attributes for 3D bar charts. The // same rule also applies to several other 3D charts, apparently. - assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dLbls/c:dLblPos", 0); - assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dLbls/c:dLbl/c:dLblPos", 0); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:bar3DChart/c:ser/c:dLbls/c:dLblPos", 0); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:bar3DChart/c:ser/c:dLbls/c:dLbl/c:dLblPos", 0); } void Chart2ExportTest::testDataLabelDoughnutChartDOCX() commit 3683cddee869ed4d3025bd8039df5625c016199d Author: Kohei Yoshida <kohei.yosh...@collabora.com> Date: Thu Aug 7 14:38:01 2014 -0400 Write test for exporting data labels in area chart for OOXML. Change-Id: Icbb17f56643f7d89bf739b0f218b2ca8a6309d9a diff --git a/chart2/qa/extras/chart2export.cxx b/chart2/qa/extras/chart2export.cxx index 2ebfd9d..46fe22d 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 new file mode 100755 index 0000000..4db8441 Binary files /dev/null and b/chart2/qa/extras/data/docx/area-chart-labels.docx differ _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits