[Libreoffice-commits] core.git: sc/qa

Xisco Fauli (via logerrit) logerrit at kemper.freedesktop.org
Thu Jul 8 14:03:00 UTC 2021


 sc/qa/unit/data/xlsx/tdf122191.xlsx    |binary
 sc/qa/unit/subsequent_export-test2.cxx |   33 +++++++++++++++++++++++++++++++++
 2 files changed, 33 insertions(+)

New commits:
commit aa5acdda9a1bd05263e482c4f527be6d088edde6
Author:     Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Thu Jul 8 11:42:28 2021 +0200
Commit:     Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Thu Jul 8 16:02:26 2021 +0200

    tdf#122191: sc_subsequent_export-test2: Add unittest
    
    Change-Id: Ib71b76766f1f20d73226c6551348c623077c06a3
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118611
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>

diff --git a/sc/qa/unit/data/xlsx/tdf122191.xlsx b/sc/qa/unit/data/xlsx/tdf122191.xlsx
new file mode 100644
index 000000000000..023fa849cc28
Binary files /dev/null and b/sc/qa/unit/data/xlsx/tdf122191.xlsx differ
diff --git a/sc/qa/unit/subsequent_export-test2.cxx b/sc/qa/unit/subsequent_export-test2.cxx
index 74e795709b0e..e222c202e885 100644
--- a/sc/qa/unit/subsequent_export-test2.cxx
+++ b/sc/qa/unit/subsequent_export-test2.cxx
@@ -146,6 +146,7 @@ public:
     void testTdf91634XLSX();
     void testTdf115159();
     void testTdf112567();
+    void testTdf122191();
     void testTdf112567b();
     void testTdf123645XLSX();
     void testTdf125173XLSX();
@@ -245,6 +246,7 @@ public:
     CPPUNIT_TEST(testTdf91634XLSX);
     CPPUNIT_TEST(testTdf115159);
     CPPUNIT_TEST(testTdf112567);
+    CPPUNIT_TEST(testTdf122191);
     CPPUNIT_TEST(testTdf112567b);
     CPPUNIT_TEST(testTdf123645XLSX);
     CPPUNIT_TEST(testTdf125173XLSX);
@@ -1341,6 +1343,37 @@ void ScExportTest2::testTdf112567()
     xDocSh->DoClose();
 }
 
+void ScExportTest2::testTdf122191()
+{
+    // Set the system locale to Hungarian
+    SvtSysLocaleOptions aOptions;
+    OUString sLocaleConfigString = aOptions.GetLanguageTag().getBcp47();
+    aOptions.SetLocaleConfigString("hu-HU");
+    aOptions.Commit();
+    comphelper::ScopeGuard g([&aOptions, &sLocaleConfigString] {
+        aOptions.SetLocaleConfigString(sLocaleConfigString);
+        aOptions.Commit();
+    });
+
+    ScDocShellRef xShell = loadDoc(u"tdf122191.", FORMAT_XLSX);
+    CPPUNIT_ASSERT(xShell.is());
+
+    ScDocument& rDoc = xShell->GetDocument();
+    CPPUNIT_ASSERT_EQUAL(OUString("IGAZ"), rDoc.GetString(0, 0, 0));
+
+    ScDocShellRef xDocSh = saveAndReload(xShell.get(), FORMAT_XLSX);
+    CPPUNIT_ASSERT(xDocSh.is());
+    xShell->DoClose();
+
+    ScDocument& rDoc2 = xDocSh->GetDocument();
+    // Without the fix in place, this test would have failed with
+    // - Expected: IGAZ
+    // - Actual  : BOOL00AN
+    CPPUNIT_ASSERT_EQUAL(OUString("IGAZ"), rDoc2.GetString(0, 0, 0));
+
+    xDocSh->DoClose();
+}
+
 void ScExportTest2::testTdf112567b()
 {
     // Set the system locale to Hungarian (a language with different range separator)


More information about the Libreoffice-commits mailing list