summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorEike Rathke [er] <eike.rathke@oracle.com>2010-08-18 18:56:10 +0200
committerEike Rathke [er] <eike.rathke@oracle.com>2010-08-18 18:56:10 +0200
commit20cd7f058892c76c9d794c6ff0a776ced306b34d (patch)
treee4bab26f8b796903e96ef0fb40a20bf37b7abe8b /sc
parentf1bcc220319d9d1f2652083f3f5389eb77748081 (diff)
calc58: #i113739# make N return 0 for all strings again
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/tool/interpr1.cxx23
-rw-r--r--sc/source/core/tool/interpr4.cxx6
2 files changed, 13 insertions, 16 deletions
diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index 2e6ce932b466..1e4c02967152 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -2481,22 +2481,13 @@ void ScInterpreter::ScN()
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScN" );
USHORT nErr = nGlobalError;
nGlobalError = 0;
- double fVal;
- if ( GetRawStackType() == svString )
- {
- fVal = 0.0;
- Pop();
- }
- else
- {
- // Temporarily override the ConvertStringToValue() error for
- // GetCellValue() / GetCellValueOrZero()
- USHORT nSErr = mnStringNoValueError;
- mnStringNoValueError = errCellNoValue;
- fVal = GetDouble();
- mnStringNoValueError = nSErr;
- }
- if ( nGlobalError == NOTAVAILABLE || nGlobalError == errIllegalArgument )
+ // Temporarily override the ConvertStringToValue() error for
+ // GetCellValue() / GetCellValueOrZero()
+ USHORT nSErr = mnStringNoValueError;
+ mnStringNoValueError = errCellNoValue;
+ double fVal = GetDouble();
+ mnStringNoValueError = nSErr;
+ if ( nGlobalError == NOTAVAILABLE || nGlobalError == errCellNoValue )
nGlobalError = 0; // N(#NA) and N("text") are ok
if ( !nGlobalError && nErr != NOTAVAILABLE )
nGlobalError = nErr;
diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx
index 5c326001ff02..dccb2355b3d5 100644
--- a/sc/source/core/tool/interpr4.cxx
+++ b/sc/source/core/tool/interpr4.cxx
@@ -231,6 +231,12 @@ double ScInterpreter::ConvertStringToValue( const String& rStr )
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ConvertStringToValue" );
double fValue = 0.0;
+ if (mnStringNoValueError == errCellNoValue)
+ {
+ // Requested that all strings result in 0, error handled by caller.
+ SetError( mnStringNoValueError);
+ return fValue;
+ }
::rtl::OUString aStr( rStr);
rtl_math_ConversionStatus eStatus;
sal_Int32 nParseEnd;