From 27a4fb657fad157d26d07934ecd0cce578a99f38 Mon Sep 17 00:00:00 2001 From: Jean-Tiare Le Bigot Date: Tue, 18 Oct 2016 23:36:51 +0200 Subject: chart2: fix unserialization of empty cells Change-Id: Ib7e5c8c4db6cac7ef1255246eea13325cf7cca69 Reviewed-on: https://gerrit.libreoffice.org/30030 Reviewed-by: jan iversen Tested-by: jan iversen --- chart2/qa/extras/chart2import.cxx | 50 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) (limited to 'chart2/qa/extras') diff --git a/chart2/qa/extras/chart2import.cxx b/chart2/qa/extras/chart2import.cxx index 7d0f8f204a6a..bff7e81a521b 100644 --- a/chart2/qa/extras/chart2import.cxx +++ b/chart2/qa/extras/chart2import.cxx @@ -90,6 +90,8 @@ public: void testSecondaryAxisTitleDefaultRotationXLSX(); void testAxisTitleRotationXLSX(); + void testInternalDataProvider(); + CPPUNIT_TEST_SUITE(Chart2ImportTest); CPPUNIT_TEST(Fdo60083); CPPUNIT_TEST(testSteppedLines); @@ -139,6 +141,9 @@ public: CPPUNIT_TEST(testAxisTitleDefaultRotationXLSX); CPPUNIT_TEST(testSecondaryAxisTitleDefaultRotationXLSX); CPPUNIT_TEST(testAxisTitleRotationXLSX); + + CPPUNIT_TEST(testInternalDataProvider); + CPPUNIT_TEST_SUITE_END(); private: @@ -1125,6 +1130,51 @@ void Chart2ImportTest::testAxisTitleRotationXLSX() } +void Chart2ImportTest::testInternalDataProvider() { + uno::Reference< chart2::XChartDocument > xChartDoc(getChartDocFromImpress("/chart2/qa/extras/data/odp/", "chart.odp"), uno::UNO_QUERY_THROW); + const uno::Reference< chart2::data::XDataProvider >& rxDataProvider = xChartDoc->getDataProvider(); + + // Parse 42 array + Reference xDataSeq = rxDataProvider->createDataSequenceByValueArray("values-y", "{42;42;42;42}"); + Sequence xSequence = xDataSeq->getData(); + CPPUNIT_ASSERT_EQUAL(uno::Any(42), xSequence[0]); + CPPUNIT_ASSERT_EQUAL(uno::Any(42), xSequence[1]); + CPPUNIT_ASSERT_EQUAL(uno::Any(42), xSequence[2]); + CPPUNIT_ASSERT_EQUAL(uno::Any(42), xSequence[3]); + + // Parse empty first and last + xDataSeq = rxDataProvider->createDataSequenceByValueArray("values-y", "{\"\";42;42;\"\"}"); + xSequence = xDataSeq->getData(); + CPPUNIT_ASSERT_EQUAL(uno::Any(0), xSequence[0]); + CPPUNIT_ASSERT_EQUAL(uno::Any(42), xSequence[1]); + CPPUNIT_ASSERT_EQUAL(uno::Any(42), xSequence[2]); + CPPUNIT_ASSERT_EQUAL(uno::Any(0), xSequence[3]); + + // Parse empty middle + xDataSeq = rxDataProvider->createDataSequenceByValueArray("values-y", "{42;\"\";\"\";42}"); + xSequence = xDataSeq->getData(); + CPPUNIT_ASSERT_EQUAL(uno::Any(42), xSequence[0]); + CPPUNIT_ASSERT_EQUAL(uno::Any(0), xSequence[1]); + CPPUNIT_ASSERT_EQUAL(uno::Any(0), xSequence[2]); + CPPUNIT_ASSERT_EQUAL(uno::Any(42), xSequence[3]); + + // Parse mixed types, numeric only role + xDataSeq = rxDataProvider->createDataSequenceByValueArray("values-y", "{42;\"hello\";0;\"world\"}"); + xSequence = xDataSeq->getData(); + CPPUNIT_ASSERT_EQUAL(uno::Any(42), xSequence[0]); + CPPUNIT_ASSERT_EQUAL(uno::Any(0), xSequence[1]); + CPPUNIT_ASSERT_EQUAL(uno::Any(0), xSequence[2]); + CPPUNIT_ASSERT_EQUAL(uno::Any(0), xSequence[3]); + + // Parse mixed types, mixed role + xDataSeq = rxDataProvider->createDataSequenceByValueArray("categories", "{42;\"hello\";0;\"world\"}"); + xSequence = xDataSeq->getData(); + CPPUNIT_ASSERT_EQUAL(uno::Any(OUString("42")), xSequence[0]); + CPPUNIT_ASSERT_EQUAL(uno::Any(OUString("hello")), xSequence[1]); + CPPUNIT_ASSERT_EQUAL(uno::Any(OUString("0")), xSequence[2]); + CPPUNIT_ASSERT_EQUAL(uno::Any(OUString("world")), xSequence[3]); +} + CPPUNIT_TEST_SUITE_REGISTRATION(Chart2ImportTest); CPPUNIT_PLUGIN_IMPLEMENT(); -- cgit ption> LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
path: root/uui
AgeCommit message (Expand)Author
2012-04-09add package deps for resourcesDavid Tardon
2012-04-08gbuild: "use" vs. "add":Michael Stahl
2012-04-06Replaced equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(...)) with == operatorSzabolcs Dezsi
2012-04-05UniString::CreateFromInt32 -> rtl::OUString::valueOfCaolán McNamara
2012-04-02pointer is always non-nullCaolán McNamara
2012-03-23.component files don't need executable bitsMichael Stahl
2012-03-23.hrc files don't need executable bitsMichael Stahl
2012-03-16Introduced SystemShellExecuteFlags::URIS_ONLYStephan Bergmann
2012-03-10gbuild: get rid of realpath in gb_Foo_set_includeMatúš Kukan
2012-03-01New IMPL_LINK_NOARG to work around SAL_UNUSED_PARAMETER problemStephan Bergmann
2012-02-27fix CntHTTPCookieList_impl leakCaolán McNamara
2012-02-23Get rid of CREATEVERSIONRESMGR[_NAME]Stephan Bergmann
2012-02-08Added READMEs for modules which used to be in libs-coreJosh Heidenreich
2012-02-05switch to include-based build rather than sourced-based buildNorbert Thiebaud
2012-01-19Fix for fdo43460 Part XLIII getLength() to isEmpty()Olivier Hallot
2012-01-05Removed unnecessary tools includes.Marcel Metz
2011-12-07in modules, when we have a env we are in stage gbuildBjoern Michaelsen
2011-12-01get rid of class Date and Time default ctor with system time penaltyEike Rathke
2011-11-29move reconfigure into gbuildBjoern Michaelsen
2011-11-25make gbuild makefiles run independant of pwd againBjoern Michaelsen
2011-11-16tweak gbuild standart Makefile to allow partial build in unsourced envNorbert Thiebaud
2011-11-11Heavily simplified utl::ConfigManager.Stephan Bergmann