diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2015-04-25 04:13:05 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2015-04-25 04:13:38 +0200 |
commit | 967b8c33225ae2aab5733639f0713a84cb1971da (patch) | |
tree | afcd1609761d9fcd3de5d20eb032e44c1ed2979e /chart2/qa | |
parent | 8ccb2c0ed7e15329cf44fa82feb0435d42c891f9 (diff) |
add test for plotArea manualLayout, tdf#90851
Change-Id: I18ac4e702a7ef4a2d9dbb4ba7d0ece1e69c7e379
Diffstat (limited to 'chart2/qa')
-rw-r--r-- | chart2/qa/extras/chart2export.cxx | 30 | ||||
-rw-r--r-- | chart2/qa/extras/data/xlsx/plot_area_manual_layout.xlsx | bin | 0 -> 13142 bytes |
2 files changed, 30 insertions, 0 deletions
diff --git a/chart2/qa/extras/chart2export.cxx b/chart2/qa/extras/chart2export.cxx index 00bec719ec20..2535dcbd38e0 100644 --- a/chart2/qa/extras/chart2export.cxx +++ b/chart2/qa/extras/chart2export.cxx @@ -91,6 +91,7 @@ public: void testBubble3DXLSX(); void testNoMarkerXLSX(); void testTitleManualLayoutXLSX(); + void testPlotAreaManualLayoutXLSX(); CPPUNIT_TEST_SUITE(Chart2ExportTest); CPPUNIT_TEST(testErrorBarXLSX); @@ -146,6 +147,7 @@ public: CPPUNIT_TEST(testBubble3DXLSX); CPPUNIT_TEST(testNoMarkerXLSX); CPPUNIT_TEST(testTitleManualLayoutXLSX); + CPPUNIT_TEST(testPlotAreaManualLayoutXLSX); CPPUNIT_TEST_SUITE_END(); protected: @@ -1338,6 +1340,34 @@ void Chart2ExportTest::testTitleManualLayoutXLSX() assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:bodyPr", "rot", "1200000"); } +void Chart2ExportTest::testPlotAreaManualLayoutXLSX() +{ + load("/chart2/qa/extras/data/xlsx/", "plot_area_manual_layout.xlsx"); + xmlDocPtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + CPPUNIT_ASSERT(pXmlDoc); + + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:layout/c:manualLayout/c:xMode", "val", "edge"); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:layout/c:manualLayout/c:yMode", "val", "edge"); + + OUString aXVal = getXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/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:plotArea/c:layout/c:manualLayout/c:y", "val"); + double nY = aYVal.toDouble(); + CPPUNIT_ASSERT(nY > 0 && nY < 1); + CPPUNIT_ASSERT(nX != nY); + + OUString aWVal = getXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:layout/c:manualLayout/c:w", "val"); + double nW = aWVal.toDouble(); + CPPUNIT_ASSERT(nW > 0 && nW < 1); + + OUString aHVal = getXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:layout/c:manualLayout/c:h", "val"); + double nH = aHVal.toDouble(); + CPPUNIT_ASSERT(nH > 0 && nH < 1); + CPPUNIT_ASSERT(nH != nW); +} + CPPUNIT_TEST_SUITE_REGISTRATION(Chart2ExportTest); CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/chart2/qa/extras/data/xlsx/plot_area_manual_layout.xlsx b/chart2/qa/extras/data/xlsx/plot_area_manual_layout.xlsx Binary files differnew file mode 100644 index 000000000000..f0bc5881344c --- /dev/null +++ b/chart2/qa/extras/data/xlsx/plot_area_manual_layout.xlsx |