From 3aec78edd7e36a950866a91060f85cfcd3b4fbdd Mon Sep 17 00:00:00 2001 From: Markus Mohrhard Date: Sat, 25 Apr 2015 15:19:10 +0200 Subject: add test for tdf#88848 Change-Id: I1ad26038db7ee386d7d6dc333e29845753ab8ec3 --- chart2/qa/extras/chart2export.cxx | 21 +++++++++++++++++++++ .../qa/extras/data/xlsx/legend_manual_layout.xlsx | Bin 0 -> 13145 bytes 2 files changed, 21 insertions(+) create mode 100644 chart2/qa/extras/data/xlsx/legend_manual_layout.xlsx (limited to 'chart2') 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 Binary files /dev/null and b/chart2/qa/extras/data/xlsx/legend_manual_layout.xlsx differ -- cgit