Kaydet (Commit) 4d0f0c4b authored tarafından Eike Rathke's avatar Eike Rathke Kaydeden (comit) Andras Timar

Revert "Resolves: tdf#94869 propagate error when obtaining a scalar double value"

This reverts commit bfd51e38.

Calculating with NaN cries for even more problems..

Change-Id: Ie1b7cddc4f157859ee3087b0eadb3a082672a1c7
Reviewed-on: https://gerrit.libreoffice.org/19286Reviewed-by: 's avatarEike Rathke <erack@redhat.com>
Tested-by: 's avatarEike Rathke <erack@redhat.com>
(cherry picked from commit c366c0ff)
üst 5c645aed
...@@ -1082,7 +1082,7 @@ double ScInterpreter::PopDouble() ...@@ -1082,7 +1082,7 @@ double ScInterpreter::PopDouble()
} }
else else
SetError( errUnknownStackVariable); SetError( errUnknownStackVariable);
return CreateDoubleError( nGlobalError); return 0.0;
} }
svl::SharedString ScInterpreter::PopString() svl::SharedString ScInterpreter::PopString()
...@@ -2186,10 +2186,7 @@ bool ScInterpreter::DoubleRefToPosSingleRef( const ScRange& rRange, ScAddress& r ...@@ -2186,10 +2186,7 @@ bool ScInterpreter::DoubleRefToPosSingleRef( const ScRange& rRange, ScAddress& r
double ScInterpreter::GetDoubleFromMatrix(const ScMatrixRef& pMat) double ScInterpreter::GetDoubleFromMatrix(const ScMatrixRef& pMat)
{ {
if (!pMat) if (!pMat)
{ return 0.0;
SetError( errParameterExpected);
return CreateDoubleError( nGlobalError);
}
if ( !pJumpMatrix ) if ( !pJumpMatrix )
return pMat->GetDouble( 0 ); return pMat->GetDouble( 0 );
...@@ -2202,7 +2199,7 @@ double ScInterpreter::GetDoubleFromMatrix(const ScMatrixRef& pMat) ...@@ -2202,7 +2199,7 @@ double ScInterpreter::GetDoubleFromMatrix(const ScMatrixRef& pMat)
return pMat->GetDouble( nC, nR); return pMat->GetDouble( nC, nR);
SetError( errNoValue); SetError( errNoValue);
return CreateDoubleError( nGlobalError); return 0.0;
} }
double ScInterpreter::GetDouble() double ScInterpreter::GetDouble()
...@@ -2236,6 +2233,8 @@ double ScInterpreter::GetDouble() ...@@ -2236,6 +2233,8 @@ double ScInterpreter::GetDouble()
aCell.assign(*pDok, aAdr); aCell.assign(*pDok, aAdr);
nVal = GetCellValue(aAdr, aCell); nVal = GetCellValue(aAdr, aCell);
} }
else
nVal = 0.0;
} }
break; break;
case svExternalSingleRef: case svExternalSingleRef:
...@@ -2264,6 +2263,7 @@ double ScInterpreter::GetDouble() ...@@ -2264,6 +2263,7 @@ double ScInterpreter::GetDouble()
break; break;
case svError: case svError:
PopError(); PopError();
nVal = 0.0;
break; break;
case svEmptyCell: case svEmptyCell:
case svMissing: case svMissing:
...@@ -2273,16 +2273,8 @@ double ScInterpreter::GetDouble() ...@@ -2273,16 +2273,8 @@ double ScInterpreter::GetDouble()
default: default:
PopError(); PopError();
SetError( errIllegalParameter); 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 ) if ( nFuncFmtType == nCurFmtType )
nFuncFmtIndex = nCurFmtIndex; nFuncFmtIndex = nCurFmtIndex;
return nVal; return nVal;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment