diff options
Diffstat (limited to 'sc')
-rw-r--r-- | sc/qa/unit/ucalc.cxx | 10 | ||||
-rw-r--r-- | sc/source/core/tool/scmatrix.cxx | 2 |
2 files changed, 12 insertions, 0 deletions
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx index 4b7e4fd5c1eb..6a8af5de996b 100644 --- a/sc/qa/unit/ucalc.cxx +++ b/sc/qa/unit/ucalc.cxx @@ -1548,6 +1548,16 @@ void Test::testMatrix() pMat->PutString(aStr, 8, 2); pMat->PutEmptyPath(8, 11); checkMatrixElements<PartiallyFilledEmptyMatrix>(*pMat); + + // Test resizing. + pMat = new ScMatrix(0, 0); + pMat->Resize(2, 2, 1.5); + pMat->PutEmpty(1, 1); + + CPPUNIT_ASSERT_EQUAL(1.5, pMat->GetDouble(0, 0)); + CPPUNIT_ASSERT_EQUAL(1.5, pMat->GetDouble(0, 1)); + CPPUNIT_ASSERT_EQUAL(1.5, pMat->GetDouble(1, 0)); + CPPUNIT_ASSERT_MESSAGE("PutEmpty() call failed.", pMat->IsEmpty(1, 1)); } void Test::testEnterMixedMatrix() diff --git a/sc/source/core/tool/scmatrix.cxx b/sc/source/core/tool/scmatrix.cxx index 66dcb2f83155..0a92ffc2721a 100644 --- a/sc/source/core/tool/scmatrix.cxx +++ b/sc/source/core/tool/scmatrix.cxx @@ -418,11 +418,13 @@ bool ScMatrixImpl::IsImmutable() const void ScMatrixImpl::Resize(SCSIZE nC, SCSIZE nR) { maMat.resize(nR, nC); + maMatFlag.resize(nR, nC); } void ScMatrixImpl::Resize(SCSIZE nC, SCSIZE nR, double fVal) { maMat.resize(nR, nC, fVal); + maMatFlag.resize(nR, nC); } void ScMatrixImpl::SetErrorInterpreter( ScInterpreter* p) |