[Libreoffice-commits] core.git: Branch 'libreoffice-5-1' - sc/source
Eike Rathke
erack at redhat.com
Fri May 20 21:53:49 UTC 2016
sc/source/core/tool/interpr4.cxx | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
New commits:
commit 81af926d186b22f3cddf34ffcd3a9447d5574cd9
Author: Eike Rathke <erack at redhat.com>
Date: Fri May 20 18:21:10 2016 +0200
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 at libreoffice.org>
Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx
index 011d9c9..92e1304 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;
More information about the Libreoffice-commits
mailing list