chart2/qa/extras/chart2import.cxx | 23 +++++++++++++++++++++++ chart2/qa/extras/data/pptx/tdf125444.pptx |binary 2 files changed, 23 insertions(+)
New commits: commit d3d3ebc5d4f19a682ab0e52bf13c6c591878bb97 Author: Tamas Bunth <tamas.bu...@collabora.co.uk> AuthorDate: Thu Jan 2 14:52:08 2020 +0100 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Mon Jan 6 14:48:14 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 <btom...@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86127 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Andras Timar <andras.ti...@collabora.com> diff --git a/chart2/qa/extras/chart2import.cxx b/chart2/qa/extras/chart2import.cxx index a4c5313cf4a1..5aacca0c9a30 100644 --- a/chart2/qa/extras/chart2import.cxx +++ b/chart2/qa/extras/chart2import.cxx @@ -121,6 +121,8 @@ public: void testTdf123504(); void testTdf122765(); void testTdf123206CustomLabelField(); + void testTdf125444PercentageCustomLabel(); + CPPUNIT_TEST_SUITE(Chart2ImportTest); CPPUNIT_TEST(Fdo60083); CPPUNIT_TEST(testSteppedLines); @@ -195,6 +197,7 @@ public: CPPUNIT_TEST(testTdf123504); CPPUNIT_TEST(testTdf122765); CPPUNIT_TEST(testTdf123206CustomLabelField); + CPPUNIT_TEST(testTdf125444PercentageCustomLabel); CPPUNIT_TEST_SUITE_END(); private: @@ -1773,6 +1776,26 @@ void Chart2ImportTest::testTdf123206CustomLabelField() } +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 _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits