From a130c38bbcc9a0a5bb32e084ffbda34e561b2373 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Fri, 18 Oct 2013 19:49:14 -0400 Subject: [PATCH] Try constructing & initializing the matrix in one step. This uses multi_type_matrix's new constructor that allows array data assignment. Change-Id: Ief01aefc1cc770aca702de7117c7e72c51fd4c33 --- sc/source/core/tool/scmatrix.cxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sc/source/core/tool/scmatrix.cxx b/sc/source/core/tool/scmatrix.cxx index f711e055d031..cf399c9686c7 100644 --- a/sc/source/core/tool/scmatrix.cxx +++ b/sc/source/core/tool/scmatrix.cxx @@ -122,11 +122,11 @@ class CompareMatrixElemFunc : std::unary_function 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); } };