diff options
author | Tünde Tóth <toth.tunde@nisz.hu> | 2021-06-04 13:10:51 +0200 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2021-06-10 15:04:50 +0200 |
commit | c9f071ff49bace0809d3a55d4d4b76a26d933f9c (patch) | |
tree | 8646c444c2349ba08480dfe162a159deb78e51e5 /chart2/qa | |
parent | 6185d1ff0130b3d178d5e50eeb6944ab70db41f9 (diff) |
tdf#139658 OOXML: fix broken chart import at labels with quotes
During the import of the internal data table, incomplete
parsing of category labels with escaped quotation marks
resulted broken category labels and charts.
Change-Id: If5af3d527b80d1e055562f589bdaf17096ad49f3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116714
Tested-by: László Németh <nemeth@numbertext.org>
Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'chart2/qa')
-rw-r--r-- | chart2/qa/extras/chart2import.cxx | 22 | ||||
-rw-r--r-- | chart2/qa/extras/data/docx/tdf139658.docx | bin | 0 -> 27488 bytes |
2 files changed, 22 insertions, 0 deletions
diff --git a/chart2/qa/extras/chart2import.cxx b/chart2/qa/extras/chart2import.cxx index 3a8b77f48cdd..0c142a4e7f97 100644 --- a/chart2/qa/extras/chart2import.cxx +++ b/chart2/qa/extras/chart2import.cxx @@ -174,6 +174,7 @@ public: void testTdf137874(); void testTdfCustomShapePos(); void testTdf121281(); + void testTdf139658(); CPPUNIT_TEST_SUITE(Chart2ImportTest); CPPUNIT_TEST(Fdo60083); @@ -297,6 +298,7 @@ public: CPPUNIT_TEST(testTdf137874); CPPUNIT_TEST(testTdfCustomShapePos); CPPUNIT_TEST(testTdf121281); + CPPUNIT_TEST(testTdf139658); CPPUNIT_TEST_SUITE_END(); @@ -2895,6 +2897,26 @@ void Chart2ImportTest::testTdf121281() CPPUNIT_ASSERT_GREATEREQUAL(static_cast<sal_Int32>(0), aLabelPosition.Y); } +void Chart2ImportTest::testTdf139658() +{ + load(u"/chart2/qa/extras/data/docx/", "tdf139658.docx"); + uno::Reference<chart2::XChartDocument> xChartDoc(getChartDocFromWriter(0), uno::UNO_QUERY); + CPPUNIT_ASSERT(xChartDoc.is()); + Reference<chart2::XInternalDataProvider> xInternalProvider(xChartDoc->getDataProvider(), + uno::UNO_QUERY); + CPPUNIT_ASSERT(xInternalProvider.is()); + + Reference<chart::XComplexDescriptionAccess> xDescAccess(xInternalProvider, uno::UNO_QUERY); + CPPUNIT_ASSERT(xDescAccess.is()); + + // Get the category labels. + Sequence<OUString> aCategories = xDescAccess->getRowDescriptions(); + CPPUNIT_ASSERT_EQUAL(sal_Int32(3), aCategories.getLength()); + CPPUNIT_ASSERT_EQUAL(OUString("category1"), aCategories[0]); + CPPUNIT_ASSERT_EQUAL(OUString("\"category2\""), aCategories[1]); + CPPUNIT_ASSERT_EQUAL(OUString("category\"3"), aCategories[2]); +} + CPPUNIT_TEST_SUITE_REGISTRATION(Chart2ImportTest); CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/chart2/qa/extras/data/docx/tdf139658.docx b/chart2/qa/extras/data/docx/tdf139658.docx Binary files differnew file mode 100644 index 000000000000..59deda9f83f9 --- /dev/null +++ b/chart2/qa/extras/data/docx/tdf139658.docx |