summaryrefslogtreecommitdiff
path: root/sc/source
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2015-01-19 23:16:23 +0100
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2015-01-19 22:57:53 +0000
commit250477f8eb2b2240209bffbe1ddeb3e587e3a5cf (patch)
tree15f9a5df653076723fbd5b97a62a45053a69da28 /sc/source
parent0657176b3e42886c4ae14f9991c52b4d61bbe116 (diff)
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.mohrhard@googlemail.com> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Diffstat (limited to 'sc/source')
-rw-r--r--sc/source/core/tool/interpr6.cxx26
1 files changed, 20 insertions, 6 deletions
diff --git a/sc/source/core/tool/interpr6.cxx b/sc/source/core/tool/interpr6.cxx
index 13c603f3d087..7eac4eb90f73 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 :