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