chart2/qa/extras/chart2import.cxx | 15 +++++++++++++++ chart2/qa/extras/data/pptx/tdf127720.pptx |binary chart2/source/tools/InternalDataProvider.cxx | 3 ++- 3 files changed, 17 insertions(+), 1 deletion(-)
New commits: commit 446c491c2f0d2643f83c0f7981b04bced785894c Author: Justin Luth <justin_l...@sil.org> AuthorDate: Wed Feb 23 20:45:04 2022 +0200 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Thu Feb 24 10:26:22 2022 +0100 tdf#127720 chart2: create new columns for error bars This is basically a copy/paste of the bubble chart fix for tdf#103984 against the same LO 4.4 regression. No exist unit tests had error bars. Very interesting. make CppunitTest_chart2_import CPPUNIT_TEST_NAME=testPPTXChartErrorBars Change-Id: I81ff91ee2ba75277502a8e261106bf5837a8903b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130444 Tested-by: Jenkins Reviewed-by: Justin Luth <jl...@mail.com> (cherry picked from commit dfd0717b3f55eeb15a5634e52d7d0ed544d17578) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130447 Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> diff --git a/chart2/qa/extras/chart2import.cxx b/chart2/qa/extras/chart2import.cxx index e908cfc57a71..564d6b0815b9 100644 --- a/chart2/qa/extras/chart2import.cxx +++ b/chart2/qa/extras/chart2import.cxx @@ -53,6 +53,7 @@ public: void testDOCXChartSeries(); void testDOCXChartEmptySeries(); void testTdf81396(); + void testPPTXChartErrorBars(); void testDOCXChartValuesSize(); void testPPTXChartSeries(); void testPPTXSparseChartSeries(); @@ -154,6 +155,7 @@ public: CPPUNIT_TEST(testDOCXChartSeries); CPPUNIT_TEST(testDOCXChartEmptySeries); CPPUNIT_TEST(testTdf81396); + CPPUNIT_TEST(testPPTXChartErrorBars); CPPUNIT_TEST(testDOCXChartValuesSize); CPPUNIT_TEST(testPPTChartSeries); CPPUNIT_TEST(testPPTXChartSeries); @@ -491,6 +493,19 @@ void Chart2ImportTest::testTdf81396() CPPUNIT_ASSERT_EQUAL(105.210801910481, aDataSeriesYValues[0][0]); } +void Chart2ImportTest::testPPTXChartErrorBars() +{ + load(u"/chart2/qa/extras/data/pptx/", "tdf127720.pptx"); + Reference<chart2::XChartDocument> xChartDoc(getChartDocFromDrawImpress(0, 0), uno::UNO_QUERY); + CPPUNIT_ASSERT(xChartDoc.is()); + + uno::Reference< chart::XChartDataArray > xDataArray(xChartDoc->getDataProvider(), UNO_QUERY_THROW); + Sequence<OUString> aColumnDesc = xDataArray->getColumnDescriptions(); + // Number of columns = 4 (Y-values, X-values and positive/negative error bars). + // Without the fix there would only be 2 columns (no error range). + CPPUNIT_ASSERT_EQUAL_MESSAGE("There must be 4 columns and descriptions", static_cast<sal_Int32>(4), aColumnDesc.getLength()); +} + void Chart2ImportTest::testDOCXChartValuesSize() { load( u"/chart2/qa/extras/data/docx/", "bubblechart.docx" ); diff --git a/chart2/qa/extras/data/pptx/tdf127720.pptx b/chart2/qa/extras/data/pptx/tdf127720.pptx new file mode 100644 index 000000000000..b10a4c5ab4ed Binary files /dev/null and b/chart2/qa/extras/data/pptx/tdf127720.pptx differ diff --git a/chart2/source/tools/InternalDataProvider.cxx b/chart2/source/tools/InternalDataProvider.cxx index 794a780d5a86..3b2fe6e5a021 100644 --- a/chart2/source/tools/InternalDataProvider.cxx +++ b/chart2/source/tools/InternalDataProvider.cxx @@ -569,7 +569,8 @@ InternalDataProvider::createDataSequenceFromArray( const OUString& rArrayStr, st } if (rRole == u"values-y" || rRole == u"values-first" || rRole == u"values-last" || - rRole == u"values-min" || rRole == u"values-max" || rRole == u"values-size") + rRole == u"values-min" || rRole == u"values-max" || rRole == u"values-size" || + rRole == u"error-bars-y-positive" || rRole == u"error-bars-y-negative") { // Column values. Append a new data column and populate it.