diff options
author | Bartosz Kosiorek <gang65@poczta.onet.pl> | 2017-03-23 00:24:34 +0100 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2017-04-06 20:57:56 +0000 |
commit | d5215e0e58febf582b18ad38f5745f8ae924cc1f (patch) | |
tree | f89d403ee83d0f06aab548bef637cc4b163c47ef | |
parent | 54f6a0fe470096f6bdc3942e9f3032e40dbfcd23 (diff) |
unit test for CEILING and FLOOR .xlsx export, tdf#100011
Change-Id: I2ce45db4ae905dedf7c3dc8fb0fd9519ace6c3aa
Reviewed-on: https://gerrit.libreoffice.org/35549
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins <ci@libreoffice.org>
-rw-r--r-- | sc/qa/unit/data/ods/ceiling-floor.ods | bin | 0 -> 8154 bytes | |||
-rw-r--r-- | sc/qa/unit/subsequent_export-test.cxx | 18 |
2 files changed, 18 insertions, 0 deletions
diff --git a/sc/qa/unit/data/ods/ceiling-floor.ods b/sc/qa/unit/data/ods/ceiling-floor.ods Binary files differnew file mode 100644 index 000000000000..051518b6fc4a --- /dev/null +++ b/sc/qa/unit/data/ods/ceiling-floor.ods diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx index ffb3bbf15157..6cc4bbb407a1 100644 --- a/sc/qa/unit/subsequent_export-test.cxx +++ b/sc/qa/unit/subsequent_export-test.cxx @@ -144,9 +144,11 @@ public: void testCeilingFloor( sal_uLong nFormatType ); void testCeilingFloorXLSX(); + void testCeilingFloorODSToXLSX(); void testCeilingFloorXLS(); void testCeilingFloorODS(); + #if !defined _WIN32 void testRelativePathsODS(); #endif @@ -239,6 +241,7 @@ public: CPPUNIT_TEST(testFunctionsExcel2010XLS); CPPUNIT_TEST(testFunctionsExcel2010ODS); CPPUNIT_TEST(testCeilingFloorXLSX); + CPPUNIT_TEST(testCeilingFloorODSToXLSX); CPPUNIT_TEST(testCeilingFloorXLS); CPPUNIT_TEST(testCeilingFloorODS); #if !defined(_WIN32) @@ -2723,6 +2726,20 @@ void ScExportTest::testCeilingFloorXLSX() testCeilingFloor(FORMAT_XLSX); } +void ScExportTest::testCeilingFloorODSToXLSX() +{ + // tdf#100011 - Cannot open sheet containg FLOOR/CEILING functions by MS Excel, after export to .xlsx + ScDocShellRef xShell = loadDoc("ceiling-floor.", FORMAT_ODS); + CPPUNIT_ASSERT_MESSAGE("Failed to load the document.", xShell.is()); + + std::shared_ptr<utl::TempFile> pXPathFile = ScBootstrapFixture::exportTo(&(*xShell), FORMAT_XLSX); + xmlDocPtr pSheet = XPathHelper::parseExport(pXPathFile, m_xSFactory, "xl/workbook.xml"); + CPPUNIT_ASSERT(pSheet); + + // there shouldn't be any defined names during export of FLOOR and CEILING functions to .xlsx + assertXPath(pSheet, "/x:workbook/x:definedNames", 0); +} + void ScExportTest::testCeilingFloorXLS() { testCeilingFloor(FORMAT_XLS); @@ -2733,6 +2750,7 @@ void ScExportTest::testCeilingFloorODS() testCeilingFloor(FORMAT_ODS); } + #if !defined _WIN32 void ScExportTest::testRelativePathsODS() { |