[Libreoffice-commits] core.git: chart2/qa
Xisco Fauli (via logerrit)
logerrit at kemper.freedesktop.org
Fri Nov 20 23:05:54 UTC 2020
chart2/qa/extras/chart2import.cxx | 21 +++++++++++++++++++++
chart2/qa/extras/data/pptx/tdf127811.pptx |binary
2 files changed, 21 insertions(+)
New commits:
commit 34c4d09265196b50786a57e185af72a3610a0e5a
Author: Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Fri Nov 20 13:58:39 2020 +0100
Commit: Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Sat Nov 21 00:05:13 2020 +0100
tdf#127811: chart2_import: Add unittest
Change-Id: I071192dbb19c1c5851fb81f67f514ff003bd5c64
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106259
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>
diff --git a/chart2/qa/extras/chart2import.cxx b/chart2/qa/extras/chart2import.cxx
index 883d50ca88d9..6b55d112d5fb 100644
--- a/chart2/qa/extras/chart2import.cxx
+++ b/chart2/qa/extras/chart2import.cxx
@@ -77,6 +77,7 @@ public:
void testFdo78080();
void testFdo54361();
void testFdo54361_1();
+ void testTdf127811();
void testTdf86624(); // manually placed legends
void testTdf105517();
void testTdf106217();
@@ -204,6 +205,7 @@ public:
CPPUNIT_TEST(testFdo78080);
CPPUNIT_TEST(testFdo54361);
CPPUNIT_TEST(testFdo54361_1);
+ CPPUNIT_TEST(testTdf127811);
CPPUNIT_TEST(testTdf86624);
CPPUNIT_TEST(testTdf105517);
CPPUNIT_TEST(testTdf106217);
@@ -950,6 +952,25 @@ void Chart2ImportTest::testFdo78080()
CPPUNIT_ASSERT(!xTitle.is());
}
+void Chart2ImportTest::testTdf127811()
+{
+ load("/chart2/qa/extras/data/pptx/", "tdf127811.pptx");
+ Reference<chart2::XChartDocument> xChartDoc(getChartDocFromDrawImpress(0, 0), uno::UNO_QUERY);
+ CPPUNIT_ASSERT(xChartDoc.is());
+
+ Reference<chart2::XChartType> xCT = getChartTypeFromDoc(xChartDoc, 0);
+ CPPUNIT_ASSERT(xCT.is());
+
+ std::vector<uno::Sequence<uno::Any> > aLabels = getDataSeriesLabelsFromChartType(xCT);
+ CPPUNIT_ASSERT_EQUAL(size_t(2), aLabels.size());
+
+ // Without the fix in place, this test would have failed with
+ // - Expected: 1. first
+ // - Actual : 2. second
+ CPPUNIT_ASSERT_EQUAL(OUString("1. first"), aLabels[0][0].get<OUString>());
+ CPPUNIT_ASSERT_EQUAL(OUString("2. second"), aLabels[1][0].get<OUString>());
+}
+
void Chart2ImportTest::testTdf86624()
{
load("/chart2/qa/extras/data/ods/", "tdf86624.ods");
diff --git a/chart2/qa/extras/data/pptx/tdf127811.pptx b/chart2/qa/extras/data/pptx/tdf127811.pptx
new file mode 100644
index 000000000000..cf3fdee60653
Binary files /dev/null and b/chart2/qa/extras/data/pptx/tdf127811.pptx differ
More information about the Libreoffice-commits
mailing list