diff options
author | Tor Lillqvist <tml@collabora.com> | 2017-06-12 11:58:48 +0300 |
---|---|---|
committer | Tor Lillqvist <tml@collabora.com> | 2017-06-12 12:00:13 +0300 |
commit | 6b3722c2cc21bd80758ecb00b4d823d4dbb30af4 (patch) | |
tree | 1b647af49762278948fa26ee11ffeed61ec9a7d6 /sc | |
parent | f11818696a6b810a16c8b13707d76d5c358036e5 (diff) |
Take new FormulaTokenArrayPlainIterator into use in one more file
Change-Id: I0a7565e2cc666151440d9fdb0a0e7b90263a88e5
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/data/validat.cxx | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/sc/source/core/data/validat.cxx b/sc/source/core/data/validat.cxx index d68a50b1c7e8..78b51ea480c4 100644 --- a/sc/source/core/data/validat.cxx +++ b/sc/source/core/data/validat.cxx @@ -556,7 +556,7 @@ class ScStringTokenIterator { public: explicit ScStringTokenIterator( ScTokenArray& rTokArr ) : - mrTokArr( rTokArr ), mbSkipEmpty( true ), mbOk( true ) {} + maIter( rTokArr ), mbSkipEmpty( true ), mbOk( true ) {} /** Returns the string of the first string token or NULL on error or empty token array. */ rtl_uString* First(); @@ -568,14 +568,14 @@ public: private: svl::SharedString maCurString; /// Current string. - ScTokenArray& mrTokArr; /// The token array for iteration. + FormulaTokenArrayPlainIterator maIter; bool mbSkipEmpty; /// Ignore empty strings. bool mbOk; /// true = correct token or end of token array. }; rtl_uString* ScStringTokenIterator::First() { - mrTokArr.Reset(); + maIter.Reset(); mbOk = true; return Next(); } @@ -586,9 +586,9 @@ rtl_uString* ScStringTokenIterator::Next() return nullptr; // seek to next non-separator token - const FormulaToken* pToken = mrTokArr.NextNoSpaces(); + const FormulaToken* pToken = maIter.NextNoSpaces(); while( pToken && (pToken->GetOpCode() == ocSep) ) - pToken = mrTokArr.NextNoSpaces(); + pToken = maIter.NextNoSpaces(); mbOk = !pToken || (pToken->GetType() == formula::svString); @@ -679,9 +679,9 @@ bool ScValidationData::GetSelectionFromFormula( ScRange aRange; ScTokenArray* pArr = const_cast<ScTokenArray*>(&rTokArr); - pArr->Reset(); + formula::FormulaTokenArrayPlainIterator aIter(*pArr); formula::FormulaToken* t = nullptr; - if (pArr->GetLen() == 1 && (t = pArr->GetNextReferenceOrName()) != nullptr) + if (pArr->GetLen() == 1 && (t = aIter.GetNextReferenceOrName()) != nullptr) { OpCode eOpCode = t->GetOpCode(); if (eOpCode == ocDBArea || eOpCode == ocTableRef) |