summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@collabora.co.uk>2015-02-19 01:03:48 +0100
committerAndras Timar <andras.timar@collabora.com>2015-02-19 16:20:07 +0100
commita9a77fdce2cfa8bcf95c0714614f486665935aa6 (patch)
tree5ac285bb47fabad39201e9a1387bd88beee14934
parentf86e5d2559b25a864dd9dbb6fc4c7a006f9c2415 (diff)
add test for tdf#89454
(cherry picked from commit b13534de022972131b46f93f5ada90af155eec9e) Conflicts: chart2/qa/extras/chart2import.cxx Change-Id: Iefb52f6fa77cf90955dbb47c1b9ca7ab699a43eb
-rw-r--r--chart2/qa/extras/chart2import.cxx19
-rw-r--r--chart2/qa/extras/charttest.hxx21
-rw-r--r--chart2/qa/extras/data/xlsx/axis-label-rotation.xlsxbin0 -> 13698 bytes
3 files changed, 40 insertions, 0 deletions
diff --git a/chart2/qa/extras/chart2import.cxx b/chart2/qa/extras/chart2import.cxx
index f210c448f989..d9e98554a91c 100644
--- a/chart2/qa/extras/chart2import.cxx
+++ b/chart2/qa/extras/chart2import.cxx
@@ -43,6 +43,7 @@ public:
void testDelayedCellImport(); // chart range referencing content on later sheets
void testFlatODSStackedColumnChart();
void testChartAreaStyleBackgroundXLSX();
+ void testAxisTextRotationXLSX();
void testNumberFormatsXLSX();
CPPUNIT_TEST_SUITE(Chart2ImportTest);
@@ -70,6 +71,7 @@ public:
CPPUNIT_TEST(testDelayedCellImport);
CPPUNIT_TEST(testFlatODSStackedColumnChart);
CPPUNIT_TEST(testChartAreaStyleBackgroundXLSX);
+ CPPUNIT_TEST(testAxisTextRotationXLSX);
CPPUNIT_TEST(testNumberFormatsXLSX);
CPPUNIT_TEST_SUITE_END();
@@ -406,6 +408,23 @@ void Chart2ImportTest::testChartAreaStyleBackgroundXLSX()
sal_Int32(0), nColor);
}
+void Chart2ImportTest::testAxisTextRotationXLSX()
+{
+ load("/chart2/qa/extras/data/xlsx/", "axis-label-rotation.xlsx");
+ uno::Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0, mxComponent);
+ CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is());
+
+ Reference<chart2::XAxis> xYAxis = getAxisFromDoc(xChartDoc, 0, 0, 0);
+ CPPUNIT_ASSERT(xYAxis.is());
+
+ Reference<beans::XPropertySet> xPS(xYAxis, uno::UNO_QUERY_THROW);
+ double nRotation = 0;
+ bool bSuccess = xPS->getPropertyValue("TextRotation") >>= nRotation;
+
+ CPPUNIT_ASSERT(bSuccess);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(90, nRotation, 1e-10);
+}
+
void Chart2ImportTest::testNumberFormatsXLSX()
{
diff --git a/chart2/qa/extras/charttest.hxx b/chart2/qa/extras/charttest.hxx
index b933b306cb37..ac753a275903 100644
--- a/chart2/qa/extras/charttest.hxx
+++ b/chart2/qa/extras/charttest.hxx
@@ -213,6 +213,27 @@ Reference< chart2::XChartType > getChartTypeFromDoc( Reference< chart2::XChartDo
return xChartTypeSequence[nChartType];
}
+Reference<chart2::XAxis> getAxisFromDoc(
+const Reference<chart2::XChartDocument>& xChartDoc, sal_Int32 nCooSys, sal_Int32 nAxisDim, sal_Int32 nAxisIndex )
+{
+ Reference<chart2::XDiagram> xDiagram = xChartDoc->getFirstDiagram();
+ CPPUNIT_ASSERT(xDiagram.is());
+
+ Reference<chart2::XCoordinateSystemContainer> xCooSysContainer(xDiagram, UNO_QUERY_THROW);
+ CPPUNIT_ASSERT(xCooSysContainer.is());
+
+ Sequence<Reference<chart2::XCoordinateSystem> > xCooSysSequence = xCooSysContainer->getCoordinateSystems();
+ CPPUNIT_ASSERT(xCooSysSequence.getLength() > nCooSys);
+
+ Reference<chart2::XCoordinateSystem> xCoord = xCooSysSequence[nCooSys];
+ CPPUNIT_ASSERT(xCoord.is());
+
+ Reference<chart2::XAxis> xAxis = xCoord->getAxisByDimension(nAxisDim, nAxisIndex);
+ CPPUNIT_ASSERT(xAxis.is());
+
+ return xAxis;
+}
+
Reference< chart2::XDataSeries > getDataSeriesFromDoc( uno::Reference< chart2::XChartDocument > xChartDoc,
sal_Int32 nDataSeries, sal_Int32 nChartType = 0, sal_Int32 nCooSys = 0 )
{
diff --git a/chart2/qa/extras/data/xlsx/axis-label-rotation.xlsx b/chart2/qa/extras/data/xlsx/axis-label-rotation.xlsx
new file mode 100644
index 000000000000..cc3b1df8a4eb
--- /dev/null
+++ b/chart2/qa/extras/data/xlsx/axis-label-rotation.xlsx
Binary files differ