summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2015-10-09 18:28:13 +0200
committerEike Rathke <erack@redhat.com>2015-10-09 18:28:13 +0200
commit53ce26978f72d75516a1a91652a2ad96c223ad7c (patch)
treea94f427b3750209f1611a7753935cdb7a34997d6
parentd2a07cd3214af27c5af601992e3c4a1a6e3b3dad (diff)
Revert "Resolves: tdf#94869 propagate error when obtaining a scalar double value"
This reverts commit 934e47958c78d1184beaaefdf3baefd3eecbea05. Calculating with NaN cries for even more problems..
-rw-r--r--sc/source/core/tool/interpr4.cxx22
1 files changed, 7 insertions, 15 deletions
diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx
index 69d13cbdbef6..e8a3b1d454aa 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;