[Libreoffice-commits] core.git: Branch 'distro/nisz/libreoffice-6-4' - sc/source

Eike Rathke (via logerrit) logerrit at kemper.freedesktop.org
Tue Jul 28 07:25:16 UTC 2020


 sc/source/core/tool/interpr1.cxx |   12 ++++++++++++
 1 file changed, 12 insertions(+)

New commits:
commit c68bfa15b73ac00402ed6f70ec75b5de02ed064d
Author:     Eike Rathke <erack at redhat.com>
AuthorDate: Tue May 5 18:31:17 2020 +0200
Commit:     Gabor Kelemen <kelemen.gabor2 at nisz.hu>
CommitDate: Tue Jul 28 09:24:43 2020 +0200

    Resolves: tdf#131536 TEXT() support empty format string mimicking Excel
    
    Change-Id: Iffc37179cafb8b8bcfa1232e7aa54ae119ab5846
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93504
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Tested-by: Jenkins
    (cherry picked from commit b7a53077fd592c514d2f255cc19e4f0deb483dca)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99541
    Tested-by: Gabor Kelemen <kelemen.gabor2 at nisz.hu>
    Reviewed-by: Gabor Kelemen <kelemen.gabor2 at nisz.hu>

diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index 9069138c3013..6579cf15f833 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -9561,6 +9561,18 @@ void ScInterpreter::ScText()
         }
         if (nGlobalError != FormulaError::NONE)
             PushError( nGlobalError);
+        else if (sFormatString.isEmpty())
+        {
+            // Mimic the Excel behaviour that
+            // * anything numeric returns an empty string
+            // * text convertible to numeric returns an empty string
+            // * any other text returns that text
+            // Conversion was detected above.
+            if (bString)
+                PushString( aStr);
+            else
+                PushString( OUString());
+        }
         else
         {
             OUString aResult;


More information about the Libreoffice-commits mailing list