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); } };