diff options
author | Balazs Varga <balazs.varga991@gmail.com> | 2020-06-08 14:26:33 +0200 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2020-06-10 11:38:32 +0200 |
commit | f66fbd4fb5fd557d6065aeea987b3dafdc30a430 (patch) | |
tree | b1b6bbeccc8773ad4e39c978909e6634c6513dc4 /chart2/qa | |
parent | 0c0f4b1531e2e985bd53e8c551328f46bde0c8c9 (diff) |
tdf#91250 Chart DOCX Import: Fix decimal place formatting issue
Use UNLIMITED_PRECISION in case of GENERAL number format of CATEGORY
axis labels in embedded charts, just like Calc does.
Change-Id: I30cb50955c67824bd1aa88fb139618ce0f0974fc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95802
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/tdf91250.docx | bin | 0 -> 25895 bytes |
2 files changed, 22 insertions, 0 deletions
diff --git a/chart2/qa/extras/chart2import.cxx b/chart2/qa/extras/chart2import.cxx index 4a74b468774f..804f154333e8 100644 --- a/chart2/qa/extras/chart2import.cxx +++ b/chart2/qa/extras/chart2import.cxx @@ -161,6 +161,7 @@ public: void testTdf119138MissingAutoTitleDeleted(); void testStockChartShiftedCategoryPosition(); void testTdf133376(); + void testTdf91250(); CPPUNIT_TEST_SUITE(Chart2ImportTest); CPPUNIT_TEST(Fdo60083); @@ -270,6 +271,7 @@ public: CPPUNIT_TEST(testTdf119138MissingAutoTitleDeleted); CPPUNIT_TEST(testStockChartShiftedCategoryPosition); CPPUNIT_TEST(testTdf133376); + CPPUNIT_TEST(testTdf91250); CPPUNIT_TEST_SUITE_END(); @@ -2523,6 +2525,26 @@ void Chart2ImportTest::testTdf133376() CPPUNIT_ASSERT_DOUBLES_EQUAL(5269, aLabelPosition.Y, 30); } +void Chart2ImportTest::testTdf91250() +{ + load("/chart2/qa/extras/data/docx/", "tdf91250.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(4), aCategories.getLength()); + CPPUNIT_ASSERT_EQUAL(OUString("12.3254"), aCategories[0]); + CPPUNIT_ASSERT_EQUAL(OUString("11.62315"), aCategories[1]); + CPPUNIT_ASSERT_EQUAL(OUString("9.26"), aCategories[2]); + CPPUNIT_ASSERT_EQUAL(OUString("8.657"), aCategories[3]); +} + CPPUNIT_TEST_SUITE_REGISTRATION(Chart2ImportTest); CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/chart2/qa/extras/data/docx/tdf91250.docx b/chart2/qa/extras/data/docx/tdf91250.docx Binary files differnew file mode 100644 index 000000000000..4cb199b45795 --- /dev/null +++ b/chart2/qa/extras/data/docx/tdf91250.docx |