sc/qa/unit/data/ods/tdf134332.ods     |binary
 sc/qa/unit/subsequent_export-test.cxx |   29 +++++++++++++++++++++++++++++
 2 files changed, 29 insertions(+)

New commits:
commit c60ce3d48dbccd616cfa989ca3d8f1ded4ccd411
Author:     Xisco Fauli <xiscofa...@libreoffice.org>
AuthorDate: Tue Jul 14 15:57:05 2020 +0200
Commit:     Luboš Luňák <l.lu...@collabora.com>
CommitDate: Thu Jul 16 13:03:36 2020 +0200

    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.lu...@collabora.com>
    Reviewed-by: Luboš Luňák <l.lu...@collabora.com>

diff --git a/sc/qa/unit/data/ods/tdf134332.ods 
b/sc/qa/unit/data/ods/tdf134332.ods
new file mode 100644
index 000000000000..2046093bd926
Binary files /dev/null and b/sc/qa/unit/data/ods/tdf134332.ods differ
diff --git a/sc/qa/unit/subsequent_export-test.cxx 
b/sc/qa/unit/subsequent_export-test.cxx
index 95b69860433b..cfdaebe86902 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();
@@ -255,6 +256,7 @@ public:
     CPPUNIT_TEST(test);
     CPPUNIT_TEST(testTdf111876);
     CPPUNIT_TEST(testPasswordExportODS);
+    CPPUNIT_TEST(testTdf134332);
     CPPUNIT_TEST(testConditionalFormatExportODS);
     CPPUNIT_TEST(testCondFormatExportCellIs);
     CPPUNIT_TEST(testConditionalFormatExportXLSX);
@@ -544,6 +546,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);
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to