Commits

Anonymous committed c8bc742

calc58: #i113739# make N return 0 for all strings again

Comments (0)

Files changed (2)

sc/source/core/tool/interpr1.cxx

     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;

sc/source/core/tool/interpr4.cxx

 {
     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;