diff options
author | Markus Mohrhard <markus.mohrhard@collabora.co.uk> | 2015-03-16 06:12:55 +0100 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@collabora.co.uk> | 2015-03-16 06:12:55 +0100 |
commit | 18e557487b2edcd49f012d89f9bcbe8fbcebef2e (patch) | |
tree | d128db6b8b067ae22c994ee56e0ab2bb716c33cf /chart2/qa | |
parent | e6dbd5b03cf923fa505f8313fbae56f2d287be30 (diff) |
add test for fixed dispBlanksAs OOXML import
Change-Id: I096e235560c81ef4c55cf14ead3544b977916c20
Diffstat (limited to 'chart2/qa')
-rw-r--r-- | chart2/qa/extras/chart2import.cxx | 33 | ||||
-rw-r--r-- | chart2/qa/extras/data/xlsx/dispBlanksAs_2007.xlsx | bin | 0 -> 10520 bytes | |||
-rw-r--r-- | chart2/qa/extras/data/xlsx/dispBlanksAs_2013.xlsx | bin | 0 -> 13430 bytes |
3 files changed, 33 insertions, 0 deletions
diff --git a/chart2/qa/extras/chart2import.cxx b/chart2/qa/extras/chart2import.cxx index 668c09b45d80..686f8084af74 100644 --- a/chart2/qa/extras/chart2import.cxx +++ b/chart2/qa/extras/chart2import.cxx @@ -19,6 +19,7 @@ #include <com/sun/star/chart/XChartDataArray.hpp> #include <com/sun/star/drawing/FillStyle.hpp> #include <com/sun/star/chart/XTwoAxisXSupplier.hpp> +#include <com/sun/star/chart/MissingValueTreatment.hpp> #include <com/sun/star/util/Color.hpp> @@ -67,6 +68,8 @@ public: // where we fixed the handling of MSO 2007 vs OOXML void testAutoTitleDelDefaultValue2007XLSX(); void testAutoTitleDelDefaultValue2013XLSX(); + void testDispBlanksAsDefaultValue2007XLSX(); + void testDispBlanksAsDefaultValue2013XLSX(); CPPUNIT_TEST_SUITE(Chart2ImportTest); CPPUNIT_TEST(Fdo60083); @@ -100,6 +103,8 @@ public: CPPUNIT_TEST(testNumberFormatsXLSX); CPPUNIT_TEST(testAutoTitleDelDefaultValue2007XLSX); CPPUNIT_TEST(testAutoTitleDelDefaultValue2013XLSX); + CPPUNIT_TEST(testDispBlanksAsDefaultValue2007XLSX); + CPPUNIT_TEST(testDispBlanksAsDefaultValue2013XLSX); CPPUNIT_TEST_SUITE_END(); private: @@ -779,6 +784,34 @@ void Chart2ImportTest::testAutoTitleDelDefaultValue2013XLSX() !xTitle.is()); } +void Chart2ImportTest::testDispBlanksAsDefaultValue2007XLSX() +{ + load("/chart2/qa/extras/data/xlsx/", "dispBlanksAs_2007.xlsx"); + Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0, mxComponent); + CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is()); + + Reference<beans::XPropertySet> xDiagram(xChartDoc->getFirstDiagram(), UNO_QUERY); + CPPUNIT_ASSERT(xDiagram.is()); + uno::Any aAny = xDiagram->getPropertyValue("MissingValueTreatment"); + sal_Int32 nMissingValueTreatment = -2; + CPPUNIT_ASSERT(aAny >>= nMissingValueTreatment); + CPPUNIT_ASSERT_EQUAL(chart::MissingValueTreatment::LEAVE_GAP, nMissingValueTreatment); +} + +void Chart2ImportTest::testDispBlanksAsDefaultValue2013XLSX() +{ + load("/chart2/qa/extras/data/xlsx/", "dispBlanksAs_2013.xlsx"); + Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0, mxComponent); + CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is()); + + Reference<beans::XPropertySet> xDiagram(xChartDoc->getFirstDiagram(), UNO_QUERY); + CPPUNIT_ASSERT(xDiagram.is()); + uno::Any aAny = xDiagram->getPropertyValue("MissingValueTreatment"); + sal_Int32 nMissingValueTreatment = -2; + CPPUNIT_ASSERT(aAny >>= nMissingValueTreatment); + CPPUNIT_ASSERT_EQUAL(chart::MissingValueTreatment::USE_ZERO, nMissingValueTreatment); +} + CPPUNIT_TEST_SUITE_REGISTRATION(Chart2ImportTest); CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/chart2/qa/extras/data/xlsx/dispBlanksAs_2007.xlsx b/chart2/qa/extras/data/xlsx/dispBlanksAs_2007.xlsx Binary files differnew file mode 100644 index 000000000000..64e673e7c7da --- /dev/null +++ b/chart2/qa/extras/data/xlsx/dispBlanksAs_2007.xlsx diff --git a/chart2/qa/extras/data/xlsx/dispBlanksAs_2013.xlsx b/chart2/qa/extras/data/xlsx/dispBlanksAs_2013.xlsx Binary files differnew file mode 100644 index 000000000000..86a0a3596162 --- /dev/null +++ b/chart2/qa/extras/data/xlsx/dispBlanksAs_2013.xlsx |