[Libreoffice-commits] core.git: Branch 'private/mmeeks/formula-iterator' - formula/source include/formula

Michael Meeks michael.meeks at collabora.com
Thu Jun 15 20:15:49 UTC 2017


 formula/source/core/api/token.cxx |   42 ++++++++++++++++++++++++++++++++++++
 include/formula/tokenarray.hxx    |   44 ++++++--------------------------------
 2 files changed, 49 insertions(+), 37 deletions(-)

New commits:
commit ce205a42673096db0c63559f45898f8ab2fdcce3
Author: Michael Meeks <michael.meeks at collabora.com>
Date:   Thu Jun 15 21:10:28 2017 +0100

    Working re-factor.
    
    Change-Id: I357c8699affce78c6ba1f4779c7b655302eec4e7

diff --git a/formula/source/core/api/token.cxx b/formula/source/core/api/token.cxx
index 3a60403e6a9b..ac15aac94de5 100644
--- a/formula/source/core/api/token.cxx
+++ b/formula/source/core/api/token.cxx
@@ -2097,6 +2097,48 @@ FormulaTokenArrayPlainIterator::FormulaTokenArrayPlainIterator( const FormulaTok
 {
 }
 
+// were in-lined.
+
+    void FormulaTokenArrayPlainIterator::Reset()
+    {
+        *mpIndex = 0;
+    }
+
+    sal_uInt16 FormulaTokenArrayPlainIterator::GetIndex() const
+    {
+        return *mpIndex;
+    }
+
+    FormulaToken* FormulaTokenArrayPlainIterator::First()
+    {
+        *mpIndex = 0;
+        return Next();
+    }
+
+    void FormulaTokenArrayPlainIterator::Jump(sal_uInt16 nIndex)
+    {
+        *mpIndex = nIndex;
+    }
+
+    void FormulaTokenArrayPlainIterator::BackOne()
+    {
+        if (*mpIndex > 0)
+            (*mpIndex)--;
+    }
+
+    FormulaToken* FormulaTokenArrayPlainIterator::FirstRPN()
+    {
+        *mpIndex = 0;
+        return NextRPN();
+    }
+
+    FormulaToken* FormulaTokenArrayPlainIterator::LastRPN()
+    {
+        *mpIndex = mpFTA->nRPN;
+        return PrevRPN();
+    }
+
+
 } // formula
 
 
diff --git a/include/formula/tokenarray.hxx b/include/formula/tokenarray.hxx
index a12107091177..54c09718b284 100644
--- a/include/formula/tokenarray.hxx
+++ b/include/formula/tokenarray.hxx
@@ -423,32 +423,11 @@ public:
 
     void assertSanity( FormulaTokenArray *pArr );
 
-    void Reset()
-    {
-        *mpIndex = 0;
-    }
-
-    sal_uInt16 GetIndex() const
-    {
-        return *mpIndex;
-    }
-
-    FormulaToken* First()
-    {
-        *mpIndex = 0;
-        return Next();
-    }
-
-    void Jump(sal_uInt16 nIndex)
-    {
-        *mpIndex = nIndex;
-    }
-
-    void BackOne()
-    {
-        if (*mpIndex > 0)
-            (*mpIndex)--;
-    }
+    void Reset();
+    sal_uInt16 GetIndex() const;
+    FormulaToken* First();
+    void Jump(sal_uInt16 nIndex);
+    void BackOne();
 
     FormulaToken* Next();
     FormulaToken* NextNoSpaces();
@@ -461,19 +440,10 @@ public:
     FormulaToken* PeekPrevNoSpaces() const;    /// Only after Reset/First/Next/Last/Prev!
     FormulaToken* PeekNextNoSpaces() const;    /// Only after Reset/First/Next/Last/Prev!
 
-    FormulaToken* FirstRPN()
-    {
-        *mpIndex = 0;
-        return NextRPN();
-    }
-
+    FormulaToken* FirstRPN();
     FormulaToken* NextRPN();
 
-    FormulaToken* LastRPN()
-    {
-        *mpIndex = mpFTA->nRPN;
-        return PrevRPN();
-    }
+    FormulaToken* LastRPN();
 
     FormulaToken* PrevRPN();
 


More information about the Libreoffice-commits mailing list