summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
authorDennis Francis <dennis.francis@collabora.co.uk>2017-07-25 13:16:28 +0530
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2017-07-27 19:10:39 +0200
commitcb46bc6ba066c1c98d4e357f8469c5eecc171241 (patch)
tree4e8d459c1df506e35a2a592db1a3745622ace6d6 /chart2
parent1d9a30bac4ba69ddee34f40427ba24a4d83a1f72 (diff)
tdf#90510 : Override default point label placement setting...
with global label placement setting if available while importing xls chart. Added unit test in chart2import.cxx that asserts one of the point label setting in the bugzilla xls document. Change-Id: Id331f56c05873554b22920e02805909c50fb8619 Reviewed-on: https://gerrit.libreoffice.org/40402 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com> (cherry picked from commit 2a4d015ff896dc9e8d2219982da54c51a42482b8) Reviewed-on: https://gerrit.libreoffice.org/40495
Diffstat (limited to 'chart2')
-rw-r--r--chart2/qa/extras/chart2import.cxx16
-rw-r--r--chart2/qa/extras/data/xls/piechart_outside.xlsbin0 -> 60928 bytes
2 files changed, 16 insertions, 0 deletions
diff --git a/chart2/qa/extras/chart2import.cxx b/chart2/qa/extras/chart2import.cxx
index e38612724ed0..2399cf7f5034 100644
--- a/chart2/qa/extras/chart2import.cxx
+++ b/chart2/qa/extras/chart2import.cxx
@@ -93,6 +93,8 @@ public:
void testSecondaryAxisTitleDefaultRotationXLSX();
void testAxisTitleRotationXLSX();
+ void testTdf90510(); // Pie chart label placement settings(XLS)
+
void testInternalDataProvider();
CPPUNIT_TEST_SUITE(Chart2ImportTest);
@@ -147,6 +149,7 @@ public:
CPPUNIT_TEST(testAxisTitleDefaultRotationXLSX);
CPPUNIT_TEST(testSecondaryAxisTitleDefaultRotationXLSX);
CPPUNIT_TEST(testAxisTitleRotationXLSX);
+ CPPUNIT_TEST(testTdf90510);
CPPUNIT_TEST(testInternalDataProvider);
@@ -1246,6 +1249,19 @@ void Chart2ImportTest::testInternalDataProvider() {
CPPUNIT_ASSERT_EQUAL(uno::Any(OUString("world")), xSequence[3]);
}
+void Chart2ImportTest::testTdf90510()
+{
+ load("/chart2/qa/extras/data/xls/", "piechart_outside.xls");
+ 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/xls/piechart_outside.xls b/chart2/qa/extras/data/xls/piechart_outside.xls
new file mode 100644
index 000000000000..02a4f7b85549
--- /dev/null
+++ b/chart2/qa/extras/data/xls/piechart_outside.xls
Binary files differ