summaryrefslogtreecommitdiffstats
path: root/chart2
diff options
context:
space:
mode:
authorTamas Bunth <tamas.bunth@collabora.co.uk>2020-01-02 12:55:16 +0100
committerAndras Timar <andras.timar@collabora.com>2020-01-06 14:47:36 +0100
commitab142e036dfdaa05fa990d998e3380aa54c4d9a8 (patch)
tree16d424ee13ea5eab3d4ebc8586afacc3c962ce0a /chart2
parenttdf#123206 Store custom label as chart:data-label (diff)
downloadcore-ab142e036dfdaa05fa990d998e3380aa54c4d9a8.tar.gz
core-ab142e036dfdaa05fa990d998e3380aa54c4d9a8.zip
tdf#123206 Add test: import custom-label-field
Add test for deprecated custom-label-field attribute of the data-point element. Change-Id: I9a7619898fa72900323e5b41728d2146c14203e3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86103 Tested-by: Jenkins Reviewed-by: Tamás Bunth <btomi96@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86117 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'chart2')
-rw-r--r--chart2/qa/extras/chart2import.cxx22
-rw-r--r--chart2/qa/extras/data/odp/tdf123206.odpbin0 -> 19589 bytes
2 files changed, 20 insertions, 2 deletions
diff --git a/chart2/qa/extras/chart2import.cxx b/chart2/qa/extras/chart2import.cxx
index 960d12b72a57..a4c5313cf4a1 100644
--- a/chart2/qa/extras/chart2import.cxx
+++ b/chart2/qa/extras/chart2import.cxx
@@ -120,7 +120,7 @@ public:
void testTdf114179();
void testTdf123504();
void testTdf122765();
-
+ void testTdf123206CustomLabelField();
CPPUNIT_TEST_SUITE(Chart2ImportTest);
CPPUNIT_TEST(Fdo60083);
CPPUNIT_TEST(testSteppedLines);
@@ -194,7 +194,7 @@ public:
CPPUNIT_TEST(testTdf114179);
CPPUNIT_TEST(testTdf123504);
CPPUNIT_TEST(testTdf122765);
-
+ CPPUNIT_TEST(testTdf123206CustomLabelField);
CPPUNIT_TEST_SUITE_END();
private:
@@ -1755,6 +1755,24 @@ void Chart2ImportTest::testTdf122765()
CPPUNIT_ASSERT_GREATER(sal_Int32(7000), aSlicePosition.X);
}
+void Chart2ImportTest::testTdf123206CustomLabelField()
+{
+ // File contains the deprecated "custom-label-field" attribute of the
+ // "data-point" element. It should be interpreted and stored as a data point
+ // property.
+ uno::Reference< chart2::XChartDocument > xChartDoc(getChartDocFromImpress("/chart2/qa/extras/data/odp/", "tdf123206.odp"), uno::UNO_QUERY_THROW);
+ CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is());
+ CPPUNIT_ASSERT(xChartDoc.is());
+ Reference<chart2::XDataSeries> xDataSeries = getDataSeriesFromDoc(xChartDoc, 0);
+ CPPUNIT_ASSERT(xDataSeries.is());
+ Reference<beans::XPropertySet> xDp = xDataSeries->getDataPointByIndex(1);
+ Sequence<Reference<chart2::XDataPointCustomLabelField>> aLabelFields;
+ CPPUNIT_ASSERT(xDp->getPropertyValue("CustomLabelFields") >>= aLabelFields);
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), aLabelFields.getLength());
+ CPPUNIT_ASSERT_EQUAL(OUString("Kiskacsa"), aLabelFields[0]->getString());
+
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(Chart2ImportTest);
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/chart2/qa/extras/data/odp/tdf123206.odp b/chart2/qa/extras/data/odp/tdf123206.odp
new file mode 100644
index 000000000000..1975756bce18
--- /dev/null
+++ b/chart2/qa/extras/data/odp/tdf123206.odp
Binary files differ