From 0222ce3cc6bdf4f6927139347ef5506a869eb977 Mon Sep 17 00:00:00 2001 From: Markus Mohrhard Date: Sun, 23 Sep 2012 20:06:18 +0200 Subject: add color scale import test for xlsx Change-Id: I8877d285be21ea4cd010cb532de593b3f5ab5975 --- sc/qa/unit/data/xlsx/colorScale.xlsx | Bin 0 -> 7794 bytes sc/qa/unit/subsequent_filters-test.cxx | 22 ++++++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 sc/qa/unit/data/xlsx/colorScale.xlsx (limited to 'sc') diff --git a/sc/qa/unit/data/xlsx/colorScale.xlsx b/sc/qa/unit/data/xlsx/colorScale.xlsx new file mode 100644 index 000000000000..33234eecad9a Binary files /dev/null and b/sc/qa/unit/data/xlsx/colorScale.xlsx differ diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx index 6a2267a46fd5..867034518424 100644 --- a/sc/qa/unit/subsequent_filters-test.cxx +++ b/sc/qa/unit/subsequent_filters-test.cxx @@ -142,6 +142,7 @@ public: void testDataValidityODS(); void testColorScaleODS(); + void testColorScaleXLSX(); void testDataBarODS(); void testNewCondFormat(); @@ -194,6 +195,7 @@ public: CPPUNIT_TEST(testControlImport); CPPUNIT_TEST(testColorScaleODS); + CPPUNIT_TEST(testColorScaleXLSX); CPPUNIT_TEST(testDataBarODS); CPPUNIT_TEST(testNewCondFormat); @@ -1568,6 +1570,26 @@ void ScFiltersTest::testColorScaleODS() testColorScale_Impl(pDoc, aBuffer.makeStringAndClear()); } +void ScFiltersTest::testColorScaleXLSX() +{ + const rtl::OUString aFileNameBase(RTL_CONSTASCII_USTRINGPARAM("colorScale.")); + rtl::OUString aFileExtension(aFileFormats[XLSX].pName, strlen(aFileFormats[XLSX].pName), RTL_TEXTENCODING_UTF8 ); + rtl::OUString aFilterName(aFileFormats[XLSX].pFilterName, strlen(aFileFormats[XLSX].pFilterName), RTL_TEXTENCODING_UTF8) ; + rtl::OUString aFileName; + createFileURL(aFileNameBase, aFileExtension, aFileName); + rtl::OUString aFilterType(aFileFormats[XLSX].pTypeName, strlen(aFileFormats[XLSX].pTypeName), RTL_TEXTENCODING_UTF8); + std::cout << aFileFormats[XLSX].pName << " Test" << std::endl; + ScDocShellRef xDocSh = load (aFilterName, aFileName, rtl::OUString(), aFilterType, aFileFormats[XLSX].nFormatType); + + CPPUNIT_ASSERT_MESSAGE("Failed to load colorScale.xlsx", xDocSh.Is()); + + ScDocument* pDoc = xDocSh->GetDocument(); + + rtl::OUStringBuffer aBuffer(getSrcRootPath()); + aBuffer.append(m_aBaseString).append(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/reference/"))); + testColorScale_Impl(pDoc, aBuffer.makeStringAndClear()); +} + void ScFiltersTest::testDataBarODS() { -- cgit