use vector replication for single row/column arrays

... also in GetStringFromMatrix() and GetDoubleOrStringFromMatrix(), not only
in GetDoubleFromMatrix().

Change-Id: Idb4bd7d7ed7574cf80d2998d1e5bfa5a6015b833
This commit is contained in:
Eike Rathke
2016-05-20 18:21:10 +02:00
parent b4c53a6eae
commit ccc49b79a8

View File

@@ -2154,12 +2154,11 @@ svl::SharedString ScInterpreter::GetStringFromMatrix(const ScMatrixRef& pMat)
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);
if ( nC < nCols && nR < nRows ) // Use vector replication for single row/column arrays.
{ if ( (nC < nCols || nCols == 1) && (nR < nRows || nRows == 1) )
return pMat->GetString( *pFormatter, nC, nR); return pMat->GetString( *pFormatter, nC, nR);
}
else SetError( errNoValue);
SetError( errNoValue);
} }
return svl::SharedString::getEmptyString(); return svl::SharedString::getEmptyString();
} }
@@ -2200,7 +2199,8 @@ ScMatValType ScInterpreter::GetDoubleOrStringFromMatrix(
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);
if ( nC < nCols && nR < nRows ) // Use vector replication for single row/column arrays.
if ( (nC < nCols || nCols == 1) && (nR < nRows || nRows == 1) )
{ {
nMatVal = pMat->Get( nC, nR); nMatVal = pMat->Get( nC, nR);
nMatValType = nMatVal.nType; nMatValType = nMatVal.nType;