summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2014-08-05 11:44:21 -0400
committerKohei Yoshida <kohei.yoshida@collabora.com>2014-08-05 13:26:29 -0400
commit2f247407662922fe84bcc0e2aac3372d9ca1cb7b (patch)
treef3744ddd7c9f5d578679fa64ceaa23e1f801a85a /chart2
parentbb13f1a063c8934325929ff5b1944814bc2cb023 (diff)
Add test to ensure that we don't export label position attributes.
At least for 3D bar chart, exporting this would choke MS Office. Change-Id: Ic6747f3c5502495d8cae734290183ff89b14fc70
Diffstat (limited to 'chart2')
-rw-r--r--chart2/qa/extras/chart2export.cxx18
-rwxr-xr-xchart2/qa/extras/data/docx/3d-bar-label.docxbin0 -> 24163 bytes
2 files changed, 18 insertions, 0 deletions
diff --git a/chart2/qa/extras/chart2export.cxx b/chart2/qa/extras/chart2export.cxx
index 1beb411e873e..67d25f974a47 100644
--- a/chart2/qa/extras/chart2export.cxx
+++ b/chart2/qa/extras/chart2export.cxx
@@ -70,6 +70,7 @@ public:
void testFdo78290CombinationChartMarkerX();
void testAxisNumberFormatODS();
void testDataLabelBordersDOCX();
+ void testDataLabel3DChartDOCX();
CPPUNIT_TEST_SUITE(Chart2ExportTest);
CPPUNIT_TEST(test);
@@ -105,6 +106,7 @@ public:
CPPUNIT_TEST(testFdo78290CombinationChartMarkerX);
CPPUNIT_TEST(testAxisNumberFormatODS);
CPPUNIT_TEST(testDataLabelBordersDOCX);
+ CPPUNIT_TEST(testDataLabel3DChartDOCX);
CPPUNIT_TEST_SUITE_END();
protected:
@@ -802,6 +804,22 @@ void Chart2ExportTest::testDataLabelBordersDOCX()
aTest.checkObject2(xChartDoc);
}
+void Chart2ExportTest::testDataLabel3DChartDOCX()
+{
+ load("/chart2/qa/extras/data/docx/", "3d-bar-label.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 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);
+}
+
void Chart2ExportTest::testBarChartRotation()
{
load ("/chart2/qa/extras/data/docx/", "barChartRotation.docx");
diff --git a/chart2/qa/extras/data/docx/3d-bar-label.docx b/chart2/qa/extras/data/docx/3d-bar-label.docx
new file mode 100755
index 000000000000..69cab8e719f3
--- /dev/null
+++ b/chart2/qa/extras/data/docx/3d-bar-label.docx
Binary files differ