Kaydet (Commit) 8b03c959 authored tarafından Tor Lillqvist's avatar Tor Lillqvist

Take new FormulaTokenArrayPlainIterator into use in one more place

Change-Id: Ia93b7759939bce42a4baf9ff55ec3c2b01840d9d
üst 5abb8cc2
......@@ -20,11 +20,12 @@
#ifndef INCLUDED_SC_INC_FORMULAITER_HXX
#define INCLUDED_SC_INC_FORMULAITER_HXX
#include <formula/tokenarray.hxx>
#include "address.hxx"
class ScTokenArray;
class ScFormulaCell;
namespace formula { class FormulaToken; }
/**
* Iterator for references in a formula cell.
......@@ -33,6 +34,7 @@ class ScDetectiveRefIter
{
private:
ScTokenArray* pCode;
formula::FormulaTokenArrayPlainIterator maIter;
ScAddress aPos;
public:
ScDetectiveRefIter( ScFormulaCell* pCell );
......
......@@ -25,11 +25,11 @@
using namespace formula;
ScDetectiveRefIter::ScDetectiveRefIter( ScFormulaCell* pCell )
ScDetectiveRefIter::ScDetectiveRefIter( ScFormulaCell* pCell ) :
pCode(pCell->GetCode()),
maIter(*pCode),
aPos(pCell->aPos)
{
pCode = pCell->GetCode();
pCode->Reset();
aPos = pCell->aPos;
}
static bool lcl_ScDetectiveRefIter_SkipRef( formula::FormulaToken* p, const ScAddress& rPos )
......@@ -65,10 +65,10 @@ bool ScDetectiveRefIter::GetNextRef( ScRange& rRange )
formula::FormulaToken* ScDetectiveRefIter::GetNextRefToken()
{
formula::FormulaToken* p = pCode->GetNextReferenceRPN();
formula::FormulaToken* p = maIter.GetNextReferenceRPN();
while (p && lcl_ScDetectiveRefIter_SkipRef(p, aPos))
{
p = pCode->GetNextReferenceRPN();
p = maIter.GetNextReferenceRPN();
}
return p;
}
......
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