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

Tor Lillqvist tml at collabora.com
Fri Dec 19 08:34:40 PST 2014


 formula/source/core/api/FormulaCompiler.cxx |   11 -----------
 formula/source/core/api/token.cxx           |    8 +-------
 include/formula/tokenarray.hxx              |    3 ---
 sc/source/core/tool/compiler.cxx            |    3 +--
 sc/source/core/tool/token.cxx               |    2 --
 5 files changed, 2 insertions(+), 25 deletions(-)

New commits:
commit 9adb00cf4df13e6f251c0ff5f71bce5ca2c7525d
Author: Tor Lillqvist <tml at collabora.com>
Date:   Fri Dec 19 15:44:32 2014 +0200

    The value of the nRefs field is not used anywhere
    
    Change-Id: I9116611d04846af7f00cb366e9174fd99e741d5c

diff --git a/formula/source/core/api/FormulaCompiler.cxx b/formula/source/core/api/FormulaCompiler.cxx
index 9b7da1a..cda306e 100644
--- a/formula/source/core/api/FormulaCompiler.cxx
+++ b/formula/source/core/api/FormulaCompiler.cxx
@@ -1108,14 +1108,6 @@ bool FormulaCompiler::GetToken()
     {
         return HandleDbData();
     }
-    else if( mpToken->GetType() == svSingleRef )
-    {
-        pArr->nRefs++;
-    }
-    else if( mpToken->GetType() == svDoubleRef )
-    {
-        pArr->nRefs++;
-    }
     return true;
 }
 
@@ -1636,7 +1628,6 @@ bool FormulaCompiler::MergeRangeReference( FormulaToken * * const pCode1, Formul
     p2->DecRef();
     *pCode1 = p.get();
     --pCode, --pc;
-    pArr->nRefs--;
 
     return true;
 }
@@ -1652,7 +1643,6 @@ bool FormulaCompiler::CompileTokenArray()
             aCorrectedFormula.clear();
             aCorrectedSymbol.clear();
         }
-        pArr->nRefs = 0;    // count from start
         pArr->DelRPN();
         pStack = NULL;
         FormulaToken* pData[ FORMULA_MAXTOKENS ];
@@ -1708,7 +1698,6 @@ void FormulaCompiler::PopTokenArray()
     {
         FormulaArrayStack* p = pStack;
         pStack = p->pNext;
-        p->pArr->nRefs = sal::static_int_cast<short>( p->pArr->nRefs + pArr->nRefs );
         // obtain special RecalcMode from SharedFormula
         if ( pArr->IsRecalcModeAlways() )
             p->pArr->SetExclusiveRecalcModeAlways();
diff --git a/formula/source/core/api/token.cxx b/formula/source/core/api/token.cxx
index fe7b113..1824c7a 100644
--- a/formula/source/core/api/token.cxx
+++ b/formula/source/core/api/token.cxx
@@ -695,7 +695,6 @@ FormulaTokenArray::FormulaTokenArray() :
     nRPN(0),
     nIndex(0),
     nError(0),
-    nRefs(0),
     nMode(RECALCMODE_NORMAL),
     bHyperLink(false)
 {
@@ -717,7 +716,6 @@ void FormulaTokenArray::Assign( const FormulaTokenArray& r )
     nRPN   = r.nRPN;
     nIndex = r.nIndex;
     nError = r.nError;
-    nRefs  = r.nRefs;
     nMode  = r.nMode;
     bHyperLink = r.bHyperLink;
     pCode  = NULL;
@@ -769,7 +767,6 @@ FormulaTokenArray* FormulaTokenArray::Clone() const
     FormulaTokenArray* p = new FormulaTokenArray;
     p->nLen = nLen;
     p->nRPN = nRPN;
-    p->nRefs = nRefs;
     p->nMode = nMode;
     p->nError = nError;
     p->bHyperLink = bHyperLink;
@@ -828,7 +825,7 @@ void FormulaTokenArray::Clear()
         delete [] pCode;
     }
     pCode = NULL; pRPN = NULL;
-    nError = nLen = nIndex = nRPN = nRefs = 0;
+    nError = nLen = nIndex = nRPN = 0;
     bHyperLink = false;
     ClearRecalcMode();
 }
@@ -856,9 +853,6 @@ FormulaToken* FormulaTokenArray::Add( FormulaToken* t )
     {
         CheckToken(*t);
         pCode[ nLen++ ] = t;
-        if( t->GetOpCode() == ocPush
-            && ( t->GetType() == svSingleRef || t->GetType() == svDoubleRef ) )
-            nRefs++;
         t->IncRef();
         if( t->GetOpCode() == ocArrayClose )
             return MergeArray();
diff --git a/include/formula/tokenarray.hxx b/include/formula/tokenarray.hxx
index ceb8425..043e349 100644
--- a/include/formula/tokenarray.hxx
+++ b/include/formula/tokenarray.hxx
@@ -103,7 +103,6 @@ protected:
     sal_uInt16          nRPN;                   // Length of RPN array
     sal_uInt16          nIndex;                 // Current step index
     sal_uInt16          nError;                 // Error code
-    short           nRefs;                  // Count of cell references
     ScRecalcMode    nMode;                  // Flags to indicate when to recalc this code
     bool            bHyperLink;             // If HYPERLINK() occurs in the formula.
 
@@ -176,8 +175,6 @@ public:
     void      Reset()            { nIndex = 0; }
     sal_uInt16    GetCodeError() const      { return nError; }
     void      SetCodeError( sal_uInt16 n )  { nError = n; }
-    short     GetRefs()  const { return nRefs;  }
-    void      IncrementRefs() { ++nRefs; }
     void      SetHyperLink( bool bVal ) { bHyperLink = bVal; }
     bool      IsHyperLink() const       { return bHyperLink; }
 
diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index fbf8fb9..0c273b3 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -4000,8 +4000,7 @@ bool ScCompiler::HandleExternalReference(const FormulaToken& _aToken)
     {
         case svExternalSingleRef:
         case svExternalDoubleRef:
-            pArr->IncrementRefs();
-        break;
+            break;
         case svExternalName:
         {
             ScExternalRefManager* pRefMgr = pDoc->GetExternalRefManager();
diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index f0ba930..e52d581 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -1574,7 +1574,6 @@ ScTokenArray* ScTokenArray::Clone() const
     ScTokenArray* p = new ScTokenArray();
     p->nLen = nLen;
     p->nRPN = nRPN;
-    p->nRefs = nRefs;
     p->nMode = nMode;
     p->nError = nError;
     p->bHyperLink = bHyperLink;
@@ -1832,7 +1831,6 @@ FormulaToken* ScTokenArray::MergeRangeReference( const ScAddress & rPos )
             p3->DecRef();
             nLen -= 2;
             pCode[ nLen-1 ] = p.get();
-            nRefs--;
         }
     }
     return pCode[ nLen-1 ];


More information about the Libreoffice-commits mailing list