Kaydet (Commit) 388014fc authored tarafından Eike Rathke's avatar Eike Rathke

Resolves: tdf#100409 do not return coded double error for single matrix value

Change-Id: I94477bf64ee7972e9822921a8a15d935cb01e53b
üst 5c8ad526
...@@ -2021,14 +2021,36 @@ double ScInterpreter::GetDoubleFromMatrix(const ScMatrixRef& pMat) ...@@ -2021,14 +2021,36 @@ double ScInterpreter::GetDoubleFromMatrix(const ScMatrixRef& pMat)
return 0.0; return 0.0;
if ( !pJumpMatrix ) if ( !pJumpMatrix )
return pMat->GetDoubleWithStringConversion( 0, 0); {
double fVal = pMat->GetDoubleWithStringConversion( 0, 0);
sal_uInt16 nErr = GetDoubleErrorValue( fVal);
if (nErr)
{
// Do not propagate the coded double error, but set nGlobalError in
// case the matrix did not have an error interpreter set.
SetError( nErr);
fVal = 0.0;
}
return fVal;
}
SCSIZE nCols, nRows, nC, nR; SCSIZE nCols, nRows, nC, nR;
pMat->GetDimensions( nCols, nRows); pMat->GetDimensions( nCols, nRows);
pJumpMatrix->GetPos( nC, nR); pJumpMatrix->GetPos( nC, nR);
// Use vector replication for single row/column arrays. // Use vector replication for single row/column arrays.
if ( (nC < nCols || nCols == 1) && (nR < nRows || nRows == 1) ) if ( (nC < nCols || nCols == 1) && (nR < nRows || nRows == 1) )
return pMat->GetDoubleWithStringConversion( nC, nR); {
double fVal = pMat->GetDoubleWithStringConversion( nC, nR);
sal_uInt16 nErr = GetDoubleErrorValue( fVal);
if (nErr)
{
// Do not propagate the coded double error, but set nGlobalError in
// case the matrix did not have an error interpreter set.
SetError( nErr);
fVal = 0.0;
}
return fVal;
}
SetError( errNoValue); SetError( errNoValue);
return 0.0; return 0.0;
......
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