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

Remove the last use of GetFirst() & GetNext().

Though I had to cheat this by using getHackedBaseCell(). So I still
need to rework the call site to not rely on ScBaseCell...

Change-Id: I53fc715770b99ef1f2091f90046091d28cdaaee8
üst d799201c
......@@ -229,7 +229,6 @@ private:
ScFormulaCell* mpCurFormula; // points to the original.
};
ScBaseCell* GetThis();
void init();
bool getCurrent();
public:
......@@ -239,8 +238,7 @@ public:
bool bSTotal = false);
ScCellIterator(ScDocument* pDoc,
const ScRange& rRange, bool bSTotal = false);
ScBaseCell* GetFirst();
ScBaseCell* GetNext();
const ScAddress& GetPos() const { return maCurPos; }
CellType getType() const;
......
......@@ -993,70 +993,6 @@ void ScCellIterator::init()
}
}
ScBaseCell* ScCellIterator::GetThis()
{
ScColumn* pCol = &(mpDoc->maTabs[maCurPos.Tab()])->aCol[maCurPos.Col()];
for ( ;; )
{
if (maCurPos.Row() > maEndPos.Row())
{
maCurPos.SetRow(maStartPos.Row());
do
{
maCurPos.IncCol();
if (maCurPos.Col() > maEndPos.Col())
{
maCurPos.SetCol(maStartPos.Col());
maCurPos.IncTab();
if (maCurPos.Tab() > maEndPos.Tab())
return NULL; // Over and out
}
pCol = &(mpDoc->maTabs[maCurPos.Tab()])->aCol[maCurPos.Col()];
} while ( pCol->maItems.empty() );
pCol->Search(maCurPos.Row(), mnIndex);
}
while ( (mnIndex < pCol->maItems.size()) && (pCol->maItems[mnIndex].nRow < maCurPos.Row()) )
++mnIndex;
if (mnIndex < pCol->maItems.size() && pCol->maItems[mnIndex].nRow <= maEndPos.Row())
{
maCurPos.SetRow(pCol->maItems[mnIndex].nRow);
if (!mbSubTotal || !mpDoc->maTabs[maCurPos.Tab()]->RowFiltered(maCurPos.Row()))
{
ScBaseCell* pCell = pCol->maItems[mnIndex].pCell;
if ( mbSubTotal && pCell->GetCellType() == CELLTYPE_FORMULA
&& ((ScFormulaCell*)pCell)->IsSubTotal() )
maCurPos.IncRow(); // Don't subtotal rows
else
return pCell; // Found it!
}
else
maCurPos.IncRow();
}
else
maCurPos.SetRow(maEndPos.Row() + 1); // Next column
}
}
ScBaseCell* ScCellIterator::GetFirst()
{
if ( !ValidTab(maCurPos.Tab()) )
return NULL;
maCurPos = maStartPos;
ScColumn* pCol = &(mpDoc->maTabs[maCurPos.Tab()])->aCol[maCurPos.Col()];
pCol->Search(maCurPos.Row(), mnIndex);
return GetThis();
}
ScBaseCell* ScCellIterator::GetNext()
{
maCurPos.IncRow();
return GetThis();
}
bool ScCellIterator::getCurrent()
{
ScColumn* pCol = &(mpDoc->maTabs[maCurPos.Tab()])->aCol[maCurPos.Col()];
......
......@@ -2655,9 +2655,9 @@ void ScChangeTrack::LookUpContents( const ScRange& rOrgRange,
ScAddress aPos;
ScBigAddress aBigPos;
ScCellIterator aIter( pRefDoc, rOrgRange );
ScBaseCell* pCell = aIter.GetFirst();
while ( pCell )
for (bool bHas = aIter.first(); bHas; bHas = aIter.next())
{
ScBaseCell* pCell = aIter.getHackedBaseCell();
if ( ScChangeActionContent::GetContentCellType( pCell ) )
{
aBigPos.Set( aIter.GetPos().Col() + nDx, aIter.GetPos().Row() + nDy,
......@@ -2673,7 +2673,6 @@ void ScChangeTrack::LookUpContents( const ScRange& rOrgRange,
//! korrekt zu erfassen
}
}
pCell = aIter.GetNext();
}
}
}
......
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