[Libreoffice-commits] core.git: Branch 'libreoffice-6-4' - chart2/qa
Tamas Bunth (via logerrit)
logerrit at kemper.freedesktop.org
Tue Jan 7 11:46:37 UTC 2020
chart2/qa/extras/chart2import.cxx | 22 ++++++++++++++++++++++
chart2/qa/extras/data/pptx/tdf125444.pptx |binary
2 files changed, 22 insertions(+)
New commits:
commit 363b7ab405f70fe0f61d57103d5ae28a0b24e0c5
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:42 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>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86128
Reviewed-by: Xisco Faulí <xiscofauli at libreoffice.org>
diff --git a/chart2/qa/extras/chart2import.cxx b/chart2/qa/extras/chart2import.cxx
index be010f3b309f..6ff60e1e6c00 100644
--- a/chart2/qa/extras/chart2import.cxx
+++ b/chart2/qa/extras/chart2import.cxx
@@ -149,6 +149,7 @@ public:
void testTdf123504();
void testTdf122765();
void testTdf121991();
+ void testTdf125444PercentageCustomLabel();
CPPUNIT_TEST_SUITE(Chart2ImportTest);
CPPUNIT_TEST(Fdo60083);
@@ -247,6 +248,7 @@ public:
CPPUNIT_TEST(testTdf123504);
CPPUNIT_TEST(testTdf122765);
CPPUNIT_TEST(testTdf121991);
+ CPPUNIT_TEST(testTdf125444PercentageCustomLabel);
CPPUNIT_TEST_SUITE_END();
@@ -2296,6 +2298,26 @@ void Chart2ImportTest::testTdf121991()
CPPUNIT_ASSERT(!bShowLegendEntry);
}
+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