diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2015-05-08 14:53:04 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2015-05-08 14:56:42 +0200 |
commit | bc4f6677a0d307fb19ad4fdfb627c80e59fd6835 (patch) | |
tree | b9b9a960da82793b5bea481413a3da902b7aaf1e /chart2 | |
parent | 13ede60a9604564339647cff6193d9343ea2fd48 (diff) |
add test for xlsx rotated axis title import
Change-Id: Ibfcf7cffe661efc1ce2063e87d38c45d943df69d
Diffstat (limited to 'chart2')
-rw-r--r-- | chart2/qa/extras/chart2import.cxx | 34 | ||||
-rw-r--r-- | chart2/qa/extras/data/xlsx/axis_title_rotated.xlsx | bin | 0 -> 11579 bytes |
2 files changed, 34 insertions, 0 deletions
diff --git a/chart2/qa/extras/chart2import.cxx b/chart2/qa/extras/chart2import.cxx index e20a5c27c171..7082077c4097 100644 --- a/chart2/qa/extras/chart2import.cxx +++ b/chart2/qa/extras/chart2import.cxx @@ -87,6 +87,7 @@ public: void testAxisTitleDefaultRotationXLSX(); void testSecondaryAxisTitleDefaultRotationXLSX(); + void testAxisTitleRotationXLSX(); CPPUNIT_TEST_SUITE(Chart2ImportTest); CPPUNIT_TEST(Fdo60083); @@ -135,6 +136,7 @@ public: CPPUNIT_TEST(testMinorTickMarksDefaultValue2013XLSX); CPPUNIT_TEST(testAxisTitleDefaultRotationXLSX); CPPUNIT_TEST(testSecondaryAxisTitleDefaultRotationXLSX); + CPPUNIT_TEST(testAxisTitleRotationXLSX); CPPUNIT_TEST_SUITE_END(); private: @@ -1061,6 +1063,38 @@ void Chart2ImportTest::testSecondaryAxisTitleDefaultRotationXLSX() CPPUNIT_ASSERT_EQUAL(90.0, nRotation); } +void Chart2ImportTest::testAxisTitleRotationXLSX() +{ + load("/chart2/qa/extras/data/xlsx/", "axis_title_rotated.xlsx"); + Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0, mxComponent); + CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is()); + { + Reference<chart2::XAxis> xYAxis = getAxisFromDoc(xChartDoc, 0, 1, 0); + CPPUNIT_ASSERT(xYAxis.is()); + Reference<chart2::XTitled> xTitled(xYAxis, uno::UNO_QUERY_THROW); + Reference<chart2::XTitle> xTitle = xTitled->getTitleObject(); + CPPUNIT_ASSERT(xTitle.is()); + Reference<beans::XPropertySet> xPropSet(xTitle, uno::UNO_QUERY_THROW); + uno::Any aAny = xPropSet->getPropertyValue("TextRotation"); + double nRotation = 0; + CPPUNIT_ASSERT(aAny >>= nRotation); + CPPUNIT_ASSERT_EQUAL(340.0, nRotation); + } + { + Reference<chart2::XAxis> xYAxis = getAxisFromDoc(xChartDoc, 0, 1, 1); + CPPUNIT_ASSERT(xYAxis.is()); + Reference<chart2::XTitled> xTitled(xYAxis, uno::UNO_QUERY_THROW); + Reference<chart2::XTitle> xTitle = xTitled->getTitleObject(); + CPPUNIT_ASSERT(xTitle.is()); + Reference<beans::XPropertySet> xPropSet(xTitle, uno::UNO_QUERY_THROW); + uno::Any aAny = xPropSet->getPropertyValue("TextRotation"); + double nRotation = 0; + CPPUNIT_ASSERT(aAny >>= nRotation); + CPPUNIT_ASSERT_EQUAL(270.0, nRotation); + } + +} + CPPUNIT_TEST_SUITE_REGISTRATION(Chart2ImportTest); CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/chart2/qa/extras/data/xlsx/axis_title_rotated.xlsx b/chart2/qa/extras/data/xlsx/axis_title_rotated.xlsx Binary files differnew file mode 100644 index 000000000000..29e42d8a4796 --- /dev/null +++ b/chart2/qa/extras/data/xlsx/axis_title_rotated.xlsx |