summaryrefslogtreecommitdiff
path: root/sc/source/core/tool/interpr5.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/core/tool/interpr5.cxx')
-rw-r--r--sc/source/core/tool/interpr5.cxx21
1 files changed, 13 insertions, 8 deletions
diff --git a/sc/source/core/tool/interpr5.cxx b/sc/source/core/tool/interpr5.cxx
index aa425b39aa47..7b46fd88956b 100644
--- a/sc/source/core/tool/interpr5.cxx
+++ b/sc/source/core/tool/interpr5.cxx
@@ -1092,7 +1092,6 @@ static inline SCSIZE lcl_GetMinExtent( SCSIZE n1, SCSIZE n2 )
template<class _Function>
static ScMatrixRef lcl_MatrixCalculation(
- svl::SharedStringPool& rPool,
const ScMatrix& rMat1, const ScMatrix& rMat2, ScInterpreter* pInterpreter)
{
static _Function Op;
@@ -1111,13 +1110,19 @@ static ScMatrixRef lcl_MatrixCalculation(
{
for (j = 0; j < nMinR; j++)
{
+ sal_uInt16 nErr;
if (rMat1.IsValueOrEmpty(i,j) && rMat2.IsValueOrEmpty(i,j))
{
double d = Op(rMat1.GetDouble(i,j), rMat2.GetDouble(i,j));
xResMat->PutDouble( d, i, j);
}
+ else if (((nErr = rMat1.GetErrorIfNotString(i,j)) != 0) ||
+ ((nErr = rMat2.GetErrorIfNotString(i,j)) != 0))
+ {
+ xResMat->PutError( nErr, i, j);
+ }
else
- xResMat->PutString(rPool.intern(ScGlobal::GetRscString(STR_NO_VALUE)), i, j);
+ xResMat->PutError( errNoValue, i, j);
}
}
}
@@ -1246,11 +1251,11 @@ void ScInterpreter::CalculateAddSub(bool _bSub)
ScMatrixRef pResMat;
if ( _bSub )
{
- pResMat = lcl_MatrixCalculation<MatrixSub>(mrStrPool, *pMat1, *pMat2, this);
+ pResMat = lcl_MatrixCalculation<MatrixSub>( *pMat1, *pMat2, this);
}
else
{
- pResMat = lcl_MatrixCalculation<MatrixAdd>(mrStrPool, *pMat1, *pMat2, this);
+ pResMat = lcl_MatrixCalculation<MatrixAdd>( *pMat1, *pMat2, this);
}
if (!pResMat)
@@ -1443,7 +1448,7 @@ void ScInterpreter::ScMul()
}
if (pMat1 && pMat2)
{
- ScMatrixRef pResMat = lcl_MatrixCalculation<MatrixMul>(mrStrPool, *pMat1, *pMat2, this);
+ ScMatrixRef pResMat = lcl_MatrixCalculation<MatrixMul>( *pMat1, *pMat2, this);
if (!pResMat)
PushNoValue();
else
@@ -1516,7 +1521,7 @@ void ScInterpreter::ScDiv()
}
if (pMat1 && pMat2)
{
- ScMatrixRef pResMat = lcl_MatrixCalculation<MatrixDiv>(mrStrPool, *pMat1, *pMat2, this);
+ ScMatrixRef pResMat = lcl_MatrixCalculation<MatrixDiv>( *pMat1, *pMat2, this);
if (!pResMat)
PushNoValue();
else
@@ -1595,7 +1600,7 @@ void ScInterpreter::ScPow()
fVal1 = GetDouble();
if (pMat1 && pMat2)
{
- ScMatrixRef pResMat = lcl_MatrixCalculation<MatrixPow>(mrStrPool, *pMat1, *pMat2, this);
+ ScMatrixRef pResMat = lcl_MatrixCalculation<MatrixPow>( *pMat1, *pMat2, this);
if (!pResMat)
PushNoValue();
else
@@ -1792,7 +1797,7 @@ void ScInterpreter::ScSumXMY2()
PushNoValue();
return;
} // if (nC1 != nC2 || nR1 != nR2)
- ScMatrixRef pResMat = lcl_MatrixCalculation<MatrixSub>(mrStrPool, *pMat1, *pMat2, this);
+ ScMatrixRef pResMat = lcl_MatrixCalculation<MatrixSub>( *pMat1, *pMat2, this);
if (!pResMat)
{
PushNoValue();