summaryrefslogtreecommitdiff
path: root/chart2/qa/extras
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 17:05:52 +0200
commit2a4d015ff896dc9e8d2219982da54c51a42482b8 (patch)
tree01bcf732c100023efc78da180bf37aeb214220a8 /chart2/qa/extras
parent7ed402ba648dd0f3de3b0dadebc13403b2c0a620 (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>
Diffstat (limited to 'chart2/qa/extras')
-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