[Libreoffice-commits] core.git: 2 commits - chart2/qa oox/source
Kohei Yoshida
kohei.yoshida at collabora.com
Thu Aug 7 16:33:11 PDT 2014
chart2/qa/extras/chart2export.cxx | 17 +++++++++++++++++
chart2/qa/extras/data/docx/radar-chart-labels.docx |binary
oox/source/export/chartexport.cxx | 4 +++-
3 files changed, 20 insertions(+), 1 deletion(-)
New commits:
commit b3857330980232fe9869371007b20e35bfd05922
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date: Thu Aug 7 19:32:03 2014 -0400
Disable export of label placement properties for radar charts.
Change-Id: Ib9e5801bc13ccf146ddd5aa79b7cd7d2a640e203
diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx
index 882c52c..9b49db2 100644
--- a/oox/source/export/chartexport.cxx
+++ b/oox/source/export/chartexport.cxx
@@ -2664,7 +2664,9 @@ void ChartExport::exportDataLabels(
break;
case chart::TYPEID_DOUGHNUT:
case chart::TYPEID_AREA:
- // Doughnut and area charts don't support label placement.
+ case chart::TYPEID_RADARLINE:
+ case chart::TYPEID_RADARAREA:
+ // These chart types don't support label placement.
aParam.mbExport = false;
break;
case chart::TYPEID_BAR:
commit 5c5f083186a787bbfbcf125f856f96efcd2e025c
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date: Thu Aug 7 19:31:20 2014 -0400
Another test for radar chart data label export.
This one doesn't support label placement property either.
Change-Id: If1f17a135eabd810033644e27db6b1e5c049daff
diff --git a/chart2/qa/extras/chart2export.cxx b/chart2/qa/extras/chart2export.cxx
index a76b43d..280d2fc 100644
--- a/chart2/qa/extras/chart2export.cxx
+++ b/chart2/qa/extras/chart2export.cxx
@@ -72,6 +72,7 @@ public:
void testDataLabelBordersDOCX();
void testDataLabel3DChartDOCX();
void testDataLabelBarChartDOCX();
+ void testDataLabelRadarChartDOCX();
void testDataLabelDoughnutChartDOCX();
void testDataLabelAreaChartDOCX();
void testDataLabelDefaultLineChartDOCX();
@@ -112,6 +113,7 @@ public:
CPPUNIT_TEST(testDataLabelBordersDOCX);
CPPUNIT_TEST(testDataLabel3DChartDOCX);
CPPUNIT_TEST(testDataLabelBarChartDOCX);
+ CPPUNIT_TEST(testDataLabelRadarChartDOCX);
CPPUNIT_TEST(testDataLabelDoughnutChartDOCX);
CPPUNIT_TEST(testDataLabelAreaChartDOCX);
CPPUNIT_TEST(testDataLabelDefaultLineChartDOCX);
@@ -843,6 +845,21 @@ void Chart2ExportTest::testDataLabelBarChartDOCX()
assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser[3]/c:dLbls/c:dLblPos", "val", "inBase");
}
+void Chart2ExportTest::testDataLabelRadarChartDOCX()
+{
+ load("/chart2/qa/extras/data/docx/", "radar-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 radar charts.
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:radarChart/c:ser/c:dLbls/c:dLblPos", 0);
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:radarChart/c:ser/c:dLbls/c:dLbl/c:dLblPos", 0);
+}
+
void Chart2ExportTest::testDataLabelDoughnutChartDOCX()
{
load("/chart2/qa/extras/data/docx/", "doughnut-chart-labels.docx");
diff --git a/chart2/qa/extras/data/docx/radar-chart-labels.docx b/chart2/qa/extras/data/docx/radar-chart-labels.docx
new file mode 100755
index 0000000..2cb876d
Binary files /dev/null and b/chart2/qa/extras/data/docx/radar-chart-labels.docx differ
More information about the Libreoffice-commits
mailing list