[Libreoffice-commits] core.git: Branch 'libreoffice-6-3' - chart2/qa
Tamas Bunth (via logerrit)
logerrit at kemper.freedesktop.org
Tue Jan 7 11:46:52 UTC 2020
chart2/qa/extras/chart2import.cxx | 22 ++++++++++++++++++++++
chart2/qa/extras/data/pptx/tdf125444.pptx |binary
2 files changed, 22 insertions(+)
New commits:
commit f05e5581badb9a258f778333007173512076fe0b
Author: Tamas Bunth <tamas.bunth at collabora.co.uk>
AuthorDate: Thu Jan 2 14:52:08 2020 +0100
Commit: Xisco Faulí <xiscofauli at libreoffice.org>
CommitDate: Tue Jan 7 12:45:58 2020 +0100
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 at gmail.com>
Signed-off-by: Xisco Fauli <xiscofauli at libreoffice.org>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86129
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
Binary files /dev/null and b/chart2/qa/extras/data/pptx/tdf125444.pptx differ
More information about the Libreoffice-commits
mailing list