[Libreoffice-commits] core.git: Branch 'private/kohei/calc-shared-string' - sc/source
Kohei Yoshida
kohei.yoshida at collabora.com
Fri Oct 18 16:49:04 PDT 2013
sc/source/core/tool/scmatrix.cxx | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
New commits:
commit deb0edfacb7e601741fb641b58261917b3e8fb3b
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date: Fri Oct 18 19:49:14 2013 -0400
Try constructing & initializing the matrix in one step.
This uses multi_type_matrix's new constructor that allows array data
assignment.
Change-Id: Ief01aefc1cc770aca702de7117c7e72c51fd4c33
diff --git a/sc/source/core/tool/scmatrix.cxx b/sc/source/core/tool/scmatrix.cxx
index f711e05..cf399c9 100644
--- a/sc/source/core/tool/scmatrix.cxx
+++ b/sc/source/core/tool/scmatrix.cxx
@@ -122,11 +122,11 @@ class CompareMatrixElemFunc : std::unary_function<MatrixImplType::element_block_
{
static _Comp maComp;
- MatrixImplType maNewMat;
std::vector<bool> maNewMatValues;
+ size_t mnRow;
+ size_t mnCol;
public:
- CompareMatrixElemFunc( size_t nRow, size_t nCol ) :
- maNewMat(nRow, nCol, false)
+ CompareMatrixElemFunc( size_t nRow, size_t nCol ) : mnRow(nRow), mnCol(nCol)
{
maNewMatValues.reserve(nRow*nCol);
}
@@ -178,8 +178,8 @@ public:
void swap( MatrixImplType& rMat )
{
- maNewMat.set(0, 0, maNewMatValues.begin(), maNewMatValues.end());
- rMat.swap(maNewMat);
+ MatrixImplType aNewMat(mnRow, mnCol, maNewMatValues.begin(), maNewMatValues.end());
+ rMat.swap(aNewMat);
}
};
More information about the Libreoffice-commits
mailing list