[Libreoffice-commits] core.git: sc/source

Eike Rathke erack at redhat.com
Fri Oct 9 09:29:18 PDT 2015


 sc/source/core/tool/interpr4.cxx |   22 +++++++---------------
 1 file changed, 7 insertions(+), 15 deletions(-)

New commits:
commit 53ce26978f72d75516a1a91652a2ad96c223ad7c
Author: Eike Rathke <erack at redhat.com>
Date:   Fri Oct 9 18:28:13 2015 +0200

    Revert "Resolves: tdf#94869 propagate error when obtaining a scalar double value"
    
    This reverts commit 934e47958c78d1184beaaefdf3baefd3eecbea05.
    
    Calculating with NaN cries for even more problems..

diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx
index 69d13cb..e8a3b1d 100644
--- a/sc/source/core/tool/interpr4.cxx
+++ b/sc/source/core/tool/interpr4.cxx
@@ -821,7 +821,7 @@ double ScInterpreter::PopDouble()
     }
     else
         SetError( errUnknownStackVariable);
-    return CreateDoubleError( nGlobalError);
+    return 0.0;
 }
 
 svl::SharedString ScInterpreter::PopString()
@@ -1925,10 +1925,7 @@ bool ScInterpreter::DoubleRefToPosSingleRef( const ScRange& rRange, ScAddress& r
 double ScInterpreter::GetDoubleFromMatrix(const ScMatrixRef& pMat)
 {
     if (!pMat)
-    {
-        SetError( errParameterExpected);
-        return CreateDoubleError( nGlobalError);
-    }
+        return 0.0;
 
     if ( !pJumpMatrix )
         return pMat->GetDouble( 0 );
@@ -1941,7 +1938,7 @@ double ScInterpreter::GetDoubleFromMatrix(const ScMatrixRef& pMat)
         return pMat->GetDouble( nC, nR);
 
     SetError( errNoValue);
-    return CreateDoubleError( nGlobalError);
+    return 0.0;
 }
 
 double ScInterpreter::GetDouble()
@@ -1975,6 +1972,8 @@ double ScInterpreter::GetDouble()
                 aCell.assign(*pDok, aAdr);
                 nVal = GetCellValue(aAdr, aCell);
             }
+            else
+                nVal = 0.0;
         }
         break;
         case svExternalSingleRef:
@@ -2003,6 +2002,7 @@ double ScInterpreter::GetDouble()
         break;
         case svError:
             PopError();
+            nVal = 0.0;
         break;
         case svEmptyCell:
         case svMissing:
@@ -2012,16 +2012,8 @@ double ScInterpreter::GetDouble()
         default:
             PopError();
             SetError( errIllegalParameter);
+            nVal = 0.0;
     }
-
-    // Propagate error also as double error, so matrix operations where one
-    // operand is a scalar get that propagated if there is no specific
-    // nGlobalError check, and when the matrix is pushed the error is cleared
-    // because the matrix is assumed to hold double errors at the corresponding
-    // positions. See PushMatrix().
-    if (nGlobalError)
-        nVal = CreateDoubleError( nGlobalError);
-
     if ( nFuncFmtType == nCurFmtType )
         nFuncFmtIndex = nCurFmtIndex;
     return nVal;


More information about the Libreoffice-commits mailing list