Kaydet (Commit) 6a944422 authored tarafından Kohei Yoshida's avatar Kohei Yoshida

A bit more.

Change-Id: I7617bfa094ba8e6fb2c19944362bd604f5299732
üst 226aefbc
...@@ -723,17 +723,16 @@ void ScFormulaCell::GetFormula( rtl::OUStringBuffer& rBuffer, ...@@ -723,17 +723,16 @@ void ScFormulaCell::GetFormula( rtl::OUStringBuffer& rBuffer,
* pCell only if (!this->IsInChangeTrack()), * pCell only if (!this->IsInChangeTrack()),
* GetEnglishFormula() omitted that test. * GetEnglishFormula() omitted that test.
* Can we live without in all cases? */ * Can we live without in all cases? */
ScBaseCell* pCell; ScFormulaCell* pCell = NULL;
ScSingleRefData& rRef = p->GetSingleRef(); ScSingleRefData& rRef = p->GetSingleRef();
rRef.CalcAbsIfRel( aPos ); rRef.CalcAbsIfRel( aPos );
if ( rRef.Valid() ) if ( rRef.Valid() )
pCell = pDocument->GetCell( ScAddress( rRef.nCol, pCell = pDocument->GetFormulaCell(
rRef.nRow, rRef.nTab ) ); ScAddress(rRef.nCol, rRef.nRow, rRef.nTab));
else
pCell = NULL; if (pCell)
if (pCell && pCell->GetCellType() == CELLTYPE_FORMULA)
{ {
((ScFormulaCell*)pCell)->GetFormula( rBuffer, eGrammar); pCell->GetFormula( rBuffer, eGrammar);
return; return;
} }
else else
......
...@@ -67,6 +67,7 @@ ...@@ -67,6 +67,7 @@
#include "rangelst.hxx" #include "rangelst.hxx"
#include "reftokenhelper.hxx" #include "reftokenhelper.hxx"
#include "formulaiter.hxx" #include "formulaiter.hxx"
#include "cellvalue.hxx"
#include <vector> #include <vector>
...@@ -821,14 +822,12 @@ sal_uInt16 ScDetectiveFunc::InsertPredLevelArea( const ScRange& rRef, ...@@ -821,14 +822,12 @@ sal_uInt16 ScDetectiveFunc::InsertPredLevelArea( const ScRange& rRef,
sal_uInt16 ScDetectiveFunc::InsertPredLevel( SCCOL nCol, SCROW nRow, ScDetectiveData& rData, sal_uInt16 ScDetectiveFunc::InsertPredLevel( SCCOL nCol, SCROW nRow, ScDetectiveData& rData,
sal_uInt16 nLevel ) sal_uInt16 nLevel )
{ {
ScBaseCell* pCell; ScRefCellValue aCell;
pDoc->GetCell( nCol, nRow, nTab, pCell ); aCell.assign(*pDoc, ScAddress(nCol, nRow, nTab));
if (!pCell) if (aCell.meType != CELLTYPE_FORMULA)
return DET_INS_EMPTY;
if (pCell->GetCellType() != CELLTYPE_FORMULA)
return DET_INS_EMPTY; return DET_INS_EMPTY;
ScFormulaCell* pFCell = (ScFormulaCell*)pCell; ScFormulaCell* pFCell = aCell.mpFormula;
if (pFCell->IsRunning()) if (pFCell->IsRunning())
return DET_INS_CIRCULAR; return DET_INS_CIRCULAR;
...@@ -838,7 +837,7 @@ sal_uInt16 ScDetectiveFunc::InsertPredLevel( SCCOL nCol, SCROW nRow, ScDetective ...@@ -838,7 +837,7 @@ sal_uInt16 ScDetectiveFunc::InsertPredLevel( SCCOL nCol, SCROW nRow, ScDetective
sal_uInt16 nResult = DET_INS_EMPTY; sal_uInt16 nResult = DET_INS_EMPTY;
ScDetectiveRefIter aIter( (ScFormulaCell*) pCell ); ScDetectiveRefIter aIter(pFCell);
ScRange aRef; ScRange aRef;
while ( aIter.GetNextRef( aRef ) ) while ( aIter.GetNextRef( aRef ) )
{ {
...@@ -912,14 +911,12 @@ sal_uInt16 ScDetectiveFunc::FindPredLevel( SCCOL nCol, SCROW nRow, sal_uInt16 nL ...@@ -912,14 +911,12 @@ sal_uInt16 ScDetectiveFunc::FindPredLevel( SCCOL nCol, SCROW nRow, sal_uInt16 nL
{ {
OSL_ENSURE( nLevel<1000, "Level" ); OSL_ENSURE( nLevel<1000, "Level" );
ScBaseCell* pCell; ScRefCellValue aCell;
pDoc->GetCell( nCol, nRow, nTab, pCell ); aCell.assign(*pDoc, ScAddress(nCol, nRow, nTab));
if (!pCell) if (aCell.meType != CELLTYPE_FORMULA)
return nLevel;
if (pCell->GetCellType() != CELLTYPE_FORMULA)
return nLevel; return nLevel;
ScFormulaCell* pFCell = (ScFormulaCell*)pCell; ScFormulaCell* pFCell = aCell.mpFormula;
if (pFCell->IsRunning()) if (pFCell->IsRunning())
return nLevel; return nLevel;
...@@ -935,7 +932,7 @@ sal_uInt16 ScDetectiveFunc::FindPredLevel( SCCOL nCol, SCROW nRow, sal_uInt16 nL ...@@ -935,7 +932,7 @@ sal_uInt16 ScDetectiveFunc::FindPredLevel( SCCOL nCol, SCROW nRow, sal_uInt16 nL
DeleteArrowsAt( nCol, nRow, sal_True ); // Pfeile, die hierher zeigen DeleteArrowsAt( nCol, nRow, sal_True ); // Pfeile, die hierher zeigen
} }
ScDetectiveRefIter aIter( (ScFormulaCell*) pCell ); ScDetectiveRefIter aIter(pFCell);
ScRange aRef; ScRange aRef;
while ( aIter.GetNextRef( aRef) ) while ( aIter.GetNextRef( aRef) )
{ {
...@@ -974,14 +971,12 @@ sal_uInt16 ScDetectiveFunc::FindPredLevel( SCCOL nCol, SCROW nRow, sal_uInt16 nL ...@@ -974,14 +971,12 @@ sal_uInt16 ScDetectiveFunc::FindPredLevel( SCCOL nCol, SCROW nRow, sal_uInt16 nL
sal_uInt16 ScDetectiveFunc::InsertErrorLevel( SCCOL nCol, SCROW nRow, ScDetectiveData& rData, sal_uInt16 ScDetectiveFunc::InsertErrorLevel( SCCOL nCol, SCROW nRow, ScDetectiveData& rData,
sal_uInt16 nLevel ) sal_uInt16 nLevel )
{ {
ScBaseCell* pCell; ScRefCellValue aCell;
pDoc->GetCell( nCol, nRow, nTab, pCell ); aCell.assign(*pDoc, ScAddress(nCol, nRow, nTab));
if (!pCell) if (aCell.meType != CELLTYPE_FORMULA)
return DET_INS_EMPTY;
if (pCell->GetCellType() != CELLTYPE_FORMULA)
return DET_INS_EMPTY; return DET_INS_EMPTY;
ScFormulaCell* pFCell = (ScFormulaCell*)pCell; ScFormulaCell* pFCell = aCell.mpFormula;
if (pFCell->IsRunning()) if (pFCell->IsRunning())
return DET_INS_CIRCULAR; return DET_INS_CIRCULAR;
...@@ -991,7 +986,7 @@ sal_uInt16 ScDetectiveFunc::InsertErrorLevel( SCCOL nCol, SCROW nRow, ScDetectiv ...@@ -991,7 +986,7 @@ sal_uInt16 ScDetectiveFunc::InsertErrorLevel( SCCOL nCol, SCROW nRow, ScDetectiv
sal_uInt16 nResult = DET_INS_EMPTY; sal_uInt16 nResult = DET_INS_EMPTY;
ScDetectiveRefIter aIter( (ScFormulaCell*) pCell ); ScDetectiveRefIter aIter(pFCell);
ScRange aRef; ScRange aRef;
ScAddress aErrorPos; ScAddress aErrorPos;
sal_Bool bHasError = false; sal_Bool bHasError = false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment