diff options
author | Dennis Francis <dennis.francis@collabora.co.uk> | 2017-08-04 13:21:24 +0530 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2017-08-09 16:03:41 +0200 |
commit | 29594a1c9f9dd440c1012732d9e713f6e3db0838 (patch) | |
tree | 069a77e32bb655f5eaf7aaac0af4d26d84151615 /chart2 | |
parent | 1571964b4f7c38f47e47973fb06a0589d11d17b5 (diff) |
tdf#109858: Override default point label placement setting...
with series label placement setting if available while
importing xlsx chart.
Adds unit test in chart2import.cxx that asserts one of
the point label setting in the bugzilla xlsx document.
Change-Id: I8bc04fd569f94a19633666ffdc51b61ac719e8a9
Reviewed-on: https://gerrit.libreoffice.org/40860
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Dennis Francis <dennis.francis@collabora.co.uk>
(cherry picked from commit 70944a849dc59fa686e3f316a3983dbc8a47017f)
Reviewed-on: https://gerrit.libreoffice.org/40861
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Diffstat (limited to 'chart2')
-rw-r--r-- | chart2/qa/extras/chart2import.cxx | 15 | ||||
-rw-r--r-- | chart2/qa/extras/data/xlsx/piechart_outside.xlsx | bin | 0 -> 15473 bytes |
2 files changed, 15 insertions, 0 deletions
diff --git a/chart2/qa/extras/chart2import.cxx b/chart2/qa/extras/chart2import.cxx index 2399cf7f5034..9ea527b1bf76 100644 --- a/chart2/qa/extras/chart2import.cxx +++ b/chart2/qa/extras/chart2import.cxx @@ -94,6 +94,7 @@ public: void testAxisTitleRotationXLSX(); void testTdf90510(); // Pie chart label placement settings(XLS) + void testTdf109858(); // Pie chart label placement settings(XLSX) void testInternalDataProvider(); @@ -150,6 +151,7 @@ public: CPPUNIT_TEST(testSecondaryAxisTitleDefaultRotationXLSX); CPPUNIT_TEST(testAxisTitleRotationXLSX); CPPUNIT_TEST(testTdf90510); + CPPUNIT_TEST(testTdf109858); CPPUNIT_TEST(testInternalDataProvider); @@ -1262,6 +1264,19 @@ void Chart2ImportTest::testTdf90510() CPPUNIT_ASSERT_EQUAL_MESSAGE( "Data labels should be placed outside", chart::DataLabelPlacement::OUTSIDE, nLabelPlacement ); } +void Chart2ImportTest::testTdf109858() +{ + load("/chart2/qa/extras/data/xlsx/", "piechart_outside.xlsx"); + uno::Reference< chart::XChartDocument > xChart1Doc( getChartCompFromSheet( 0, mxComponent ), UNO_QUERY_THROW ); + CPPUNIT_ASSERT_MESSAGE( "failed to load chart", xChart1Doc.is() ); + Reference<beans::XPropertySet> xPropSet( xChart1Doc->getDiagram()->getDataPointProperties( 0, 0 ), uno::UNO_QUERY_THROW ); + uno::Any aAny = xPropSet->getPropertyValue( "LabelPlacement" ); + CPPUNIT_ASSERT( aAny.hasValue() ); + sal_Int32 nLabelPlacement = 0; + CPPUNIT_ASSERT( aAny >>= nLabelPlacement ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Data labels should be placed outside", chart::DataLabelPlacement::OUTSIDE, nLabelPlacement ); +} + CPPUNIT_TEST_SUITE_REGISTRATION(Chart2ImportTest); CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/chart2/qa/extras/data/xlsx/piechart_outside.xlsx b/chart2/qa/extras/data/xlsx/piechart_outside.xlsx Binary files differnew file mode 100644 index 000000000000..e90eab1e904c --- /dev/null +++ b/chart2/qa/extras/data/xlsx/piechart_outside.xlsx |