sc/source/core/tool/interpr6.cxx |   26 ++++++++++++++++++++------
 1 file changed, 20 insertions(+), 6 deletions(-)

New commits:
commit 250477f8eb2b2240209bffbe1ddeb3e587e3a5cf
Author: Eike Rathke <er...@redhat.com>
Date:   Mon Jan 19 23:16:23 2015 +0100

    in COUNT() use ConvertStringToValue() for literal string arguments
    
    ... to evaluate the string conversion configuration, instead of the hard
    coded locale dependent IsNumberFormat()
    
    This only for literals, not referenced cell values.
    
    Change-Id: I774b52f1e258294014d8ea6a62374dd1d262f022
    (cherry picked from commit b5fab0c20550b724986ad8a59973b92b181e0478)
    Reviewed-on: https://gerrit.libreoffice.org/14026
    Tested-by: Markus Mohrhard <markus.mohrh...@googlemail.com>
    Reviewed-by: Markus Mohrhard <markus.mohrh...@googlemail.com>

diff --git a/sc/source/core/tool/interpr6.cxx b/sc/source/core/tool/interpr6.cxx
index 13c603f..7eac4eb 100644
--- a/sc/source/core/tool/interpr6.cxx
+++ b/sc/source/core/tool/interpr6.cxx
@@ -429,9 +429,19 @@ double ScInterpreter::IterateParameters( ScIterFunc eFunc, 
bool bTextAsZero )
                 if( eFunc == ifCOUNT )
                 {
                     OUString aStr = PopString().getString();
-                    sal_uInt32 nFIndex = 0;                 // damit default 
Land/Spr.
-                    if ( bTextAsZero || pFormatter->IsNumberFormat(aStr, 
nFIndex, fVal))
+                    if ( bTextAsZero )
                         nCount++;
+                    else
+                    {
+                        // Only check if string can be converted to number, no
+                        // error propagation.
+                        sal_uInt16 nErr = nGlobalError;
+                        nGlobalError = 0;
+                        ConvertStringToValue( aStr );
+                        if (!nGlobalError)
+                            ++nCount;
+                        nGlobalError = nErr;
+                    }
                 }
                 else
                 {
@@ -955,7 +965,6 @@ void ScInterpreter::ScCount()
     else
     {
         short nParamCount = GetByte();
-        double fVal = 0.0;
         sal_uLong nCount = 0;
         ScAddress aAdr;
         ScRange aRange;
@@ -970,9 +979,14 @@ void ScInterpreter::ScCount()
                 case svString:
                 {
                     OUString aStr = PopString().getString();
-                    sal_uInt32 nFIndex = 0;                 // damit default 
Land/Spr.
-                    if (pFormatter->IsNumberFormat(aStr, nFIndex, fVal))
-                        nCount++;
+                    // Only check if string can be converted to number, no
+                    // error propagation.
+                    sal_uInt16 nErr = nGlobalError;
+                    nGlobalError = 0;
+                    ConvertStringToValue( aStr );
+                    if (!nGlobalError)
+                        ++nCount;
+                    nGlobalError = nErr;
                 }
                 break;
                 case svDouble    :
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to