diff options
author | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-03-28 13:50:51 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-03-28 17:03:55 -0400 |
commit | e5a625100497f1fae86a3b43454c9ce9a4c8dd2c (patch) | |
tree | bbe9a9f0b7d74751a55e371ff25fffa6b3f36839 /sc/source | |
parent | 51b28807b8c72edfb32006da287165b03273a7b8 (diff) |
ScInterpreter is now free of ScBaseCell. Hooray! \o/
Change-Id: I00617da47485e751f6aba41ab382220ad05eb9b6
Diffstat (limited to 'sc/source')
-rw-r--r-- | sc/source/core/inc/interpre.hxx | 2 | ||||
-rw-r--r-- | sc/source/core/tool/interpr4.cxx | 36 | ||||
-rw-r--r-- | sc/source/core/tool/interpr5.cxx | 9 |
3 files changed, 20 insertions, 27 deletions
diff --git a/sc/source/core/inc/interpre.hxx b/sc/source/core/inc/interpre.hxx index 7821b603cbe3..81af5a1c7ff2 100644 --- a/sc/source/core/inc/interpre.hxx +++ b/sc/source/core/inc/interpre.hxx @@ -35,7 +35,6 @@ class ScDocument; class SbxVariable; -class ScBaseCell; class ScValueCell; class ScFormulaCell; class SvNumberFormatter; @@ -190,7 +189,6 @@ double ConvertStringToValue( const String& ); double GetCellValue( const ScAddress&, ScRefCellValue& rCell ); double GetCellValueOrZero( const ScAddress&, ScRefCellValue& rCell ); double GetValueCellValue( const ScAddress&, double fOrig ); -ScBaseCell* GetCell( const ScAddress& rPos ); void GetCellString( OUString& rStr, ScRefCellValue& rCell ); sal_uInt16 GetCellErrCode( const ScRefCellValue& rCell ); diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx index e624c899ae1b..fe05654bf2fe 100644 --- a/sc/source/core/tool/interpr4.cxx +++ b/sc/source/core/tool/interpr4.cxx @@ -510,11 +510,6 @@ double ScInterpreter::GetCellValueOrZero( const ScAddress& rPos, ScRefCellValue& return fValue; } -ScBaseCell* ScInterpreter::GetCell( const ScAddress& rPos ) -{ - return pDok->GetCell( rPos ); -} - void ScInterpreter::GetCellString( OUString& rStr, ScRefCellValue& rCell ) { sal_uInt16 nErr = 0; @@ -678,26 +673,24 @@ bool ScInterpreter::CreateStringArr(SCCOL nCol1, SCROW nRow1, SCTAB nTab1, SCCOL nCol = nCol1; while (nCol <= nCol2) { - ScBaseCell* pCell; - pDok->GetCell(nCol, nRow, nTab, pCell); - if (pCell) + ScRefCellValue aCell; + aCell.assign(*pDok, ScAddress(nCol, nRow, nTab)); + if (!aCell.isEmpty()) { String aStr; sal_uInt16 nErr = 0; bool bOk = true; - switch ( pCell->GetCellType() ) + switch (aCell.meType) { - case CELLTYPE_STRING : - aStr = ((ScStringCell*)pCell)->GetString(); - break; - case CELLTYPE_EDIT : - aStr = ((ScEditCell*)pCell)->GetString(); + case CELLTYPE_STRING: + case CELLTYPE_EDIT: + aStr = aCell.getString(); break; - case CELLTYPE_FORMULA : - if (!((ScFormulaCell*)pCell)->IsValue()) + case CELLTYPE_FORMULA: + if (!aCell.mpFormula->IsValue()) { - nErr = ((ScFormulaCell*)pCell)->GetErrCode(); - aStr = ((ScFormulaCell*)pCell)->GetString(); + nErr = aCell.mpFormula->GetErrCode(); + aStr = aCell.mpFormula->GetString(); } else bOk = false; @@ -3527,9 +3520,10 @@ void ScInterpreter::ScTableOp() iBroadcast != pTableOp->aNotifiedFormulaPos.end(); ++iBroadcast ) { // emulate broadcast and indirectly collect cell pointers - ScBaseCell* pCell = pDok->GetCell( *iBroadcast ); - if ( pCell && pCell->GetCellType() == CELLTYPE_FORMULA ) - ((ScFormulaCell*)pCell)->SetTableOpDirty(); + ScRefCellValue aCell; + aCell.assign(*pDok, *iBroadcast); + if (aCell.meType == CELLTYPE_FORMULA) + aCell.mpFormula->SetTableOpDirty(); } } else diff --git a/sc/source/core/tool/interpr5.cxx b/sc/source/core/tool/interpr5.cxx index 09196d904ff3..7dc9b57a5305 100644 --- a/sc/source/core/tool/interpr5.cxx +++ b/sc/source/core/tool/interpr5.cxx @@ -635,15 +635,16 @@ void ScInterpreter::ScMatValue() { ScAddress aAdr; PopSingleRef( aAdr ); - ScBaseCell* pCell = GetCell( aAdr ); - if (pCell && pCell->GetCellType() == CELLTYPE_FORMULA) + ScRefCellValue aCell; + aCell.assign(*pDok, aAdr); + if (aCell.meType == CELLTYPE_FORMULA) { - sal_uInt16 nErrCode = ((ScFormulaCell*)pCell)->GetErrCode(); + sal_uInt16 nErrCode = aCell.mpFormula->GetErrCode(); if (nErrCode != 0) PushError( nErrCode); else { - const ScMatrix* pMat = ((ScFormulaCell*)pCell)->GetMatrix(); + const ScMatrix* pMat = aCell.mpFormula->GetMatrix(); CalculateMatrixValue(pMat,nC,nR); } } |