summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTamas Bunth <tamas.bunth@collabora.co.uk>2020-01-02 14:52:08 +0100
committerXisco Faulí <xiscofauli@libreoffice.org>2020-01-07 12:45:58 +0100
commitf05e5581badb9a258f778333007173512076fe0b (patch)
tree200081952d8bede594431f5d74ec87044c42c469
parent0e536aa4b173b5e2a370333e50f822883923dffc (diff)
tdf#125444 Add pptx import test for percentage
Add test for imporing custom label field of type "PERCENTAGE" from a pptx document. Change-Id: Ide6baa95d07836cafb97efc9c00ec2ab224a1d1b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86109 Tested-by: Jenkins Reviewed-by: Tamás Bunth <btomi96@gmail.com> Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86129
-rw-r--r--chart2/qa/extras/chart2import.cxx22
-rwxr-xr-xchart2/qa/extras/data/pptx/tdf125444.pptxbin0 -> 34078 bytes
2 files changed, 22 insertions, 0 deletions
diff --git a/chart2/qa/extras/chart2import.cxx b/chart2/qa/extras/chart2import.cxx
index da62dfd5e87d..c11c5cdf28ad 100644
--- a/chart2/qa/extras/chart2import.cxx
+++ b/chart2/qa/extras/chart2import.cxx
@@ -133,6 +133,7 @@ public:
void testXaxisValues();
void testTdf123504();
void testTdf122765();
+ void testTdf125444PercentageCustomLabel();
CPPUNIT_TEST_SUITE(Chart2ImportTest);
CPPUNIT_TEST(Fdo60083);
@@ -218,6 +219,7 @@ public:
CPPUNIT_TEST(testXaxisValues);
CPPUNIT_TEST(testTdf123504);
CPPUNIT_TEST(testTdf122765);
+ CPPUNIT_TEST(testTdf125444PercentageCustomLabel);
CPPUNIT_TEST_SUITE_END();
@@ -1991,6 +1993,26 @@ void Chart2ImportTest::testTdf122765()
CPPUNIT_ASSERT_GREATER(sal_Int32(7000), aSlicePosition.X);
}
+void Chart2ImportTest::testTdf125444PercentageCustomLabel()
+{
+ load("/chart2/qa/extras/data/pptx/", "tdf125444.pptx");
+
+ // 1st chart
+ Reference<chart2::XChartDocument> xChartDoc(getChartDocFromDrawImpress(0, 0), uno::UNO_QUERY);
+ CPPUNIT_ASSERT(xChartDoc.is());
+
+ uno::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);
+ // There are three label field: a value label, a newline and a percentage label. We want
+ // to assert the latter.
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(3), aLabelFields.getLength());
+ CPPUNIT_ASSERT_EQUAL(chart2::DataPointCustomLabelFieldType_PERCENTAGE, aLabelFields[2]->getFieldType());
+
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(Chart2ImportTest);
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/chart2/qa/extras/data/pptx/tdf125444.pptx b/chart2/qa/extras/data/pptx/tdf125444.pptx
new file mode 100755
index 000000000000..e78efecd652b
--- /dev/null
+++ b/chart2/qa/extras/data/pptx/tdf125444.pptx
Binary files differ