diff options
author | Eike Rathke <erack@redhat.com> | 2016-05-20 18:21:10 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2016-05-20 21:53:28 +0000 |
commit | 81af926d186b22f3cddf34ffcd3a9447d5574cd9 (patch) | |
tree | 0a28a5fb68984c0074dd4c1e21304408d24da5f5 /sc | |
parent | 3fefe33f2eeec3118b9abfdfcb2f253eee8c4c99 (diff) |
use vector replication for single row/column arrays
... also in GetStringFromMatrix() and GetDoubleOrStringFromMatrix(), not only
in GetDoubleFromMatrix().
Change-Id: Idb4bd7d7ed7574cf80d2998d1e5bfa5a6015b833
(cherry picked from commit ccc49b79a8425138d46e7be2acf3ef43b5aa232f)
Reviewed-on: https://gerrit.libreoffice.org/25218
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/tool/interpr4.cxx | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx index 011d9c9070d7..92e130408848 100644 --- a/sc/source/core/tool/interpr4.cxx +++ b/sc/source/core/tool/interpr4.cxx @@ -2122,12 +2122,11 @@ svl::SharedString ScInterpreter::GetStringFromMatrix(const ScMatrixRef& pMat) SCSIZE nCols, nRows, nC, nR; pMat->GetDimensions( nCols, nRows); 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); - } - else - SetError( errNoValue); + + SetError( errNoValue); } return svl::SharedString::getEmptyString(); } @@ -2168,7 +2167,8 @@ ScMatValType ScInterpreter::GetDoubleOrStringFromMatrix( SCSIZE nCols, nRows, nC, nR; pMat->GetDimensions( nCols, nRows); 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); nMatValType = nMatVal.nType; |