diff options
author | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-03-27 23:27:30 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-03-28 01:12:51 -0400 |
commit | 629c793388f071ff9624e78c578a76eadef2fc34 (patch) | |
tree | 88cf305aa7ddcf4d48629709eb4a9761daab9276 /sc/qa | |
parent | e610388522c31455bb989c957e9480fa7fbcdf6c (diff) |
More on replacing ScBaseCell.
Change-Id: I2a512d0421ddac5bf92ad128ea2dde5772f854dd
Diffstat (limited to 'sc/qa')
-rw-r--r-- | sc/qa/unit/ucalc.cxx | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx index ec0769588db1..6d4895632e7a 100644 --- a/sc/qa/unit/ucalc.cxx +++ b/sc/qa/unit/ucalc.cxx @@ -4397,10 +4397,11 @@ void Test::testStreamValid() CPPUNIT_ASSERT_MESSAGE("Cell A1 should not have moved.", test.equals(a1)); test = m_pDoc->GetString(0, 3, 0); CPPUNIT_ASSERT_MESSAGE("the old cell A2 should now be at A4.", test.equals(a2)); - const ScBaseCell* pCell = m_pDoc->GetCell(ScAddress(0, 1, 0)); - CPPUNIT_ASSERT_MESSAGE("Cell A2 should be empty.", pCell == NULL); - pCell = m_pDoc->GetCell(ScAddress(0, 2, 0)); - CPPUNIT_ASSERT_MESSAGE("Cell A3 should be empty.", pCell == NULL); + ScRefCellValue aCell; + aCell.assign(*m_pDoc, ScAddress(0,1,0)); + CPPUNIT_ASSERT_MESSAGE("Cell A2 should be empty.", aCell.isEmpty()); + aCell.assign(*m_pDoc, ScAddress(0,2,0)); + CPPUNIT_ASSERT_MESSAGE("Cell A3 should be empty.", aCell.isEmpty()); // After the move, Sheet1, Sheet2, and Sheet4 should have their stream // invalidated, whereas Sheet3's stream should still be valid. @@ -6256,17 +6257,17 @@ void Test::testFormulaGrouping() for (unsigned j = 0; j < SAL_N_ELEMENTS( aGroupTests[0].pFormula ); j++) { - ScBaseCell *pCell = NULL; - m_pDoc->GetCell( 0, (SCROW)j, 0, pCell ); - if( !pCell ) + ScRefCellValue aCell; + aCell.assign(*m_pDoc, ScAddress(0, (SCROW)j, 0)); + if (aCell.isEmpty()) { CPPUNIT_ASSERT_MESSAGE("invalid empty cell", !aGroupTests[i].bGroup[j]); continue; } - CPPUNIT_ASSERT_MESSAGE("Cell expected, but not there.", pCell != NULL); + CPPUNIT_ASSERT_MESSAGE("Cell expected, but not there.", !aCell.isEmpty()); CPPUNIT_ASSERT_MESSAGE("Cell wrong type.", - pCell->GetCellType() == CELLTYPE_FORMULA); - ScFormulaCell *pCur = static_cast< ScFormulaCell *>( pCell ); + aCell.meType == CELLTYPE_FORMULA); + ScFormulaCell *pCur = aCell.mpFormula; if( !!pCur->GetCellGroup().get() ^ aGroupTests[i].bGroup[j] ) { |