summaryrefslogtreecommitdiff
path: root/chart2/qa
diff options
context:
space:
mode:
authorDennis Francis <dennis.francis@collabora.co.uk>2017-08-04 13:21:24 +0530
committerDennis Francis <dennis.francis@collabora.co.uk>2017-08-08 08:31:22 +0200
commit70944a849dc59fa686e3f316a3983dbc8a47017f (patch)
tree9a803d30955593bcd0bf8c1e7c141f1f8e058f5d /chart2/qa
parenta209172669e7a2de6065486e385e4e3007b74bd2 (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>
Diffstat (limited to 'chart2/qa')
-rw-r--r--chart2/qa/extras/chart2import.cxx15
-rw-r--r--chart2/qa/extras/data/xlsx/piechart_outside.xlsxbin0 -> 15473 bytes
2 files changed, 15 insertions, 0 deletions
diff --git a/chart2/qa/extras/chart2import.cxx b/chart2/qa/extras/chart2import.cxx
index e81a6e4d347d..7cb69a3398ce 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
new file mode 100644
index 000000000000..e90eab1e904c
--- /dev/null
+++ b/chart2/qa/extras/data/xlsx/piechart_outside.xlsx
Binary files differ