summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2015-04-25 15:19:10 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2015-04-25 15:20:58 +0200
commit3aec78edd7e36a950866a91060f85cfcd3b4fbdd (patch)
treee6a77b2774630011872aaf01c9d4da713be9aa0c /chart2
parent0afab16d9afb8ccd1f089447868b25a960ec595b (diff)
add test for tdf#88848
Change-Id: I1ad26038db7ee386d7d6dc333e29845753ab8ec3
Diffstat (limited to 'chart2')
-rw-r--r--chart2/qa/extras/chart2export.cxx21
-rw-r--r--chart2/qa/extras/data/xlsx/legend_manual_layout.xlsxbin0 -> 13145 bytes
2 files changed, 21 insertions, 0 deletions
diff --git a/chart2/qa/extras/chart2export.cxx b/chart2/qa/extras/chart2export.cxx
index 2535dcbd38e0..f087463cac6c 100644
--- a/chart2/qa/extras/chart2export.cxx
+++ b/chart2/qa/extras/chart2export.cxx
@@ -92,6 +92,7 @@ public:
void testNoMarkerXLSX();
void testTitleManualLayoutXLSX();
void testPlotAreaManualLayoutXLSX();
+ void testLegendManualLayoutXLSX();
CPPUNIT_TEST_SUITE(Chart2ExportTest);
CPPUNIT_TEST(testErrorBarXLSX);
@@ -148,6 +149,7 @@ public:
CPPUNIT_TEST(testNoMarkerXLSX);
CPPUNIT_TEST(testTitleManualLayoutXLSX);
CPPUNIT_TEST(testPlotAreaManualLayoutXLSX);
+ CPPUNIT_TEST(testLegendManualLayoutXLSX);
CPPUNIT_TEST_SUITE_END();
protected:
@@ -1368,6 +1370,25 @@ void Chart2ExportTest::testPlotAreaManualLayoutXLSX()
CPPUNIT_ASSERT(nH != nW);
}
+void Chart2ExportTest::testLegendManualLayoutXLSX()
+{
+ load("/chart2/qa/extras/data/xlsx/", "legend_manual_layout.xlsx");
+ xmlDocPtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML");
+ CPPUNIT_ASSERT(pXmlDoc);
+
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:legend/c:layout/c:manualLayout/c:xMode", "val", "edge");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:legend/c:layout/c:manualLayout/c:yMode", "val", "edge");
+
+ OUString aXVal = getXPath(pXmlDoc, "/c:chartSpace/c:chart/c:legend/c:layout/c:manualLayout/c:x", "val");
+ double nX = aXVal.toDouble();
+ CPPUNIT_ASSERT(nX > 0 && nX < 1);
+
+ OUString aYVal = getXPath(pXmlDoc, "/c:chartSpace/c:chart/c:legend/c:layout/c:manualLayout/c:y", "val");
+ double nY = aYVal.toDouble();
+ CPPUNIT_ASSERT(nY > 0 && nY < 1);
+ CPPUNIT_ASSERT(nX != nY);
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(Chart2ExportTest);
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/chart2/qa/extras/data/xlsx/legend_manual_layout.xlsx b/chart2/qa/extras/data/xlsx/legend_manual_layout.xlsx
new file mode 100644
index 000000000000..16ea01142eaa
--- /dev/null
+++ b/chart2/qa/extras/data/xlsx/legend_manual_layout.xlsx
Binary files differ