[Libreoffice-commits] core.git: sc/source

Tor Lillqvist tml at collabora.com
Mon Jun 12 09:00:43 UTC 2017


 sc/source/core/data/validat.cxx |   14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

New commits:
commit 6b3722c2cc21bd80758ecb00b4d823d4dbb30af4
Author: Tor Lillqvist <tml at collabora.com>
Date:   Mon Jun 12 11:58:48 2017 +0300

    Take new FormulaTokenArrayPlainIterator into use in one more file
    
    Change-Id: I0a7565e2cc666151440d9fdb0a0e7b90263a88e5

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)


More information about the Libreoffice-commits mailing list