diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2020-07-14 15:57:05 +0200 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2020-07-16 19:45:44 +0200 |
commit | 8b15cebf0df0bf1449e2a1f221411e23eebbce16 (patch) | |
tree | 8040defd2cb98683ab07c132a74a01c8241483e5 /sc | |
parent | 0aa98f7b745a884639e722c0118387dd9f3f8990 (diff) |
tdf#134332, tdf#134796: sc_subsequent_export_test: Add unittest
Change-Id: I4b67937dbec76c32c61a85ed24ca67bfcf3f83a8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98743
Tested-by: Luboš Luňák <l.lunak@collabora.com>
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
(cherry picked from commit c60ce3d48dbccd616cfa989ca3d8f1ded4ccd411)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98844
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/qa/unit/data/ods/tdf134332.ods | bin | 0 -> 22292 bytes | |||
-rw-r--r-- | sc/qa/unit/subsequent_export-test.cxx | 29 |
2 files changed, 29 insertions, 0 deletions
diff --git a/sc/qa/unit/data/ods/tdf134332.ods b/sc/qa/unit/data/ods/tdf134332.ods Binary files differnew file mode 100644 index 000000000000..2046093bd926 --- /dev/null +++ b/sc/qa/unit/data/ods/tdf134332.ods diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx index 6d4830ad9276..096c95e0f575 100644 --- a/sc/qa/unit/subsequent_export-test.cxx +++ b/sc/qa/unit/subsequent_export-test.cxx @@ -94,6 +94,7 @@ public: void test(); void testTdf111876(); void testPasswordExportODS(); + void testTdf134332(); void testConditionalFormatExportODS(); void testConditionalFormatExportXLSX(); void testCondFormatExportCellIs(); @@ -253,6 +254,7 @@ public: CPPUNIT_TEST(test); CPPUNIT_TEST(testTdf111876); CPPUNIT_TEST(testPasswordExportODS); + CPPUNIT_TEST(testTdf134332); CPPUNIT_TEST(testConditionalFormatExportODS); CPPUNIT_TEST(testCondFormatExportCellIs); CPPUNIT_TEST(testConditionalFormatExportXLSX); @@ -540,6 +542,33 @@ void ScExportTest::testPasswordExportODS() xDocSh->DoClose(); } +void ScExportTest::testTdf134332() +{ + ScDocShellRef xShell = loadDoc("tdf134332.", FORMAT_ODS); + CPPUNIT_ASSERT(xShell.is()); + + ScDocument& rDoc = xShell->GetDocument(); + + ASSERT_DOUBLES_EQUAL(190.0, rDoc.GetValue(ScAddress(0,0,0))); + + ASSERT_DOUBLES_EQUAL(238.0, rDoc.GetValue(ScAddress(0,10144,0))); + + sal_Int32 nFormat = FORMAT_ODS; + OUString aFilterName(getFileFormats()[nFormat].pFilterName, strlen(getFileFormats()[nFormat].pFilterName), RTL_TEXTENCODING_UTF8) ; + OUString aFilterType(getFileFormats()[nFormat].pTypeName, strlen(getFileFormats()[nFormat].pTypeName), RTL_TEXTENCODING_UTF8); + ScDocShellRef xDocSh = saveAndReloadPassword(static_cast<ScDocShell*>(rDoc.GetDocumentShell()), aFilterName, OUString(), + aFilterType, getFileFormats()[nFormat].nFormatType); + + // Without the fixes in place, it would have failed here + CPPUNIT_ASSERT(xDocSh.is()); + ScDocument& rLoadedDoc = xDocSh->GetDocument(); + ASSERT_DOUBLES_EQUAL(190.0, rLoadedDoc.GetValue(ScAddress(0,0,0))); + + ASSERT_DOUBLES_EQUAL(238.0, rLoadedDoc.GetValue(ScAddress(0,10144,0))); + + xDocSh->DoClose(); +} + void ScExportTest::testConditionalFormatExportODS() { ScDocShellRef xShell = loadDoc("new_cond_format_test_export.", FORMAT_ODS); |