[Libreoffice-commits] core.git: Branch 'feature/formula-core-rework' - sc/inc sc/source

Kohei Yoshida kohei.yoshida at gmail.com
Mon Jul 29 16:47:11 PDT 2013


 sc/inc/compiler.hxx              |    7 ---
 sc/source/core/tool/compiler.cxx |   88 ---------------------------------------
 2 files changed, 95 deletions(-)

New commits:
commit 804ed5ab354a328a2efbbaf45ab02c5feb971a5e
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date:   Mon Jul 29 19:47:46 2013 -0400

    These methods are now unused.
    
    Change-Id: Ief17166537b78efb6401f0a310e3acaaae217a65

diff --git a/sc/inc/compiler.hxx b/sc/inc/compiler.hxx
index 4792f79..9ecb893 100644
--- a/sc/inc/compiler.hxx
+++ b/sc/inc/compiler.hxx
@@ -441,18 +441,11 @@ public:
     static void MoveRelWrap( ScTokenArray& rArr, ScDocument* pDoc, const ScAddress& rPos,
                              SCCOL nMaxCol, SCROW nMaxRow );
 
-    bool UpdateNameReference( UpdateRefMode eUpdateRefMode,
-                              const ScRange&,
-                              SCsCOL nDx, SCsROW nDy, SCsTAB nDz,
-                              bool& rChanged, bool bSharedFormula = false, bool bLocal = false);
-
     void UpdateReference( UpdateRefMode eUpdateRefMode,
                                   const ScAddress& rOldPos, const ScRange&,
                                   SCsCOL nDx, SCsROW nDy, SCsTAB nDz,
                                   bool& rChanged, bool& rRefSizeChanged );
 
-    bool HasModifiedRange();
-
     /** If the character is allowed as first character in sheet names or
         references, includes '$' and '?'. */
     static inline bool IsCharWordChar( String const & rStr,
diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index 5e020d5..ed60c30 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -4071,50 +4071,6 @@ bool ScCompiler::HandleExternalReference(const FormulaToken& _aToken)
     return true;
 }
 
-
-//---------------------------------------------------------------------------
-
-
-//---------------------------------------------------------------------------
-// Append token to RPN code
-//---------------------------------------------------------------------------
-
-
-//-----------------------------------------------------------------------------
-
-//---------------------------------------------------------------------------
-// RPN creation by recursion
-//---------------------------------------------------------------------------
-
-
-
-//-----------------------------------------------------------------------------
-
-bool ScCompiler::HasModifiedRange()
-{
-    pArr->Reset();
-    for ( FormulaToken* t = pArr->Next(); t; t = pArr->Next() )
-    {
-        OpCode eOpCode = t->GetOpCode();
-        if ( eOpCode == ocName )
-        {
-            const ScRangeData* pRangeData = GetRangeData( *t);
-            if (pRangeData && pRangeData->IsModified())
-                return true;
-        }
-        else if ( eOpCode == ocDBArea )
-        {
-            ScDBData* pDBData = pDoc->GetDBCollection()->getNamedDBs().findByIndex(t->GetIndex());
-            if (pDBData && pDBData->IsModified())
-                return true;
-        }
-    }
-    return false;
-}
-
-
-//---------------------------------------------------------------------------
-
 template< typename T, typename S >
 static S lcl_adjval( S& n, T pos, T max, bool bRel )
 {
@@ -4315,50 +4271,6 @@ void ScCompiler::UpdateReference(UpdateRefMode eUpdateRefMode,
     }
 }
 
-bool ScCompiler::UpdateNameReference(UpdateRefMode eUpdateRefMode,
-                                     const ScRange& r,
-                                     SCsCOL nDx, SCsROW nDy, SCsTAB nDz,
-                                     bool& rChanged, bool bSharedFormula, bool bLocal)
-{
-    bool bRelRef = false;   // set if relative reference
-    rChanged = false;
-    pArr->Reset();
-    ScToken* t;
-    while ( (t = static_cast<ScToken*>(pArr->GetNextReference())) != NULL )
-    {
-        SingleDoubleRefModifier aMod( *t );
-        ScComplexRefData& rRef = aMod.Ref();
-        bRelRef = rRef.Ref1.IsColRel() || rRef.Ref1.IsRowRel() ||
-            rRef.Ref1.IsTabRel();
-        if (!bRelRef && t->GetType() == svDoubleRef)
-            bRelRef = rRef.Ref2.IsColRel() || rRef.Ref2.IsRowRel() ||
-                rRef.Ref2.IsTabRel();
-        bool bUpdate = !rRef.Ref1.IsColRel() || !rRef.Ref1.IsRowRel() ||
-            !rRef.Ref1.IsTabRel();
-        if (!bUpdate && t->GetType() == svDoubleRef)
-            bUpdate = !rRef.Ref2.IsColRel() || !rRef.Ref2.IsRowRel() ||
-                !rRef.Ref2.IsTabRel();
-        if (!bSharedFormula && !bLocal)
-        {
-            // We cannot update names with sheet-relative references, they may
-            // be used on other sheets as well and the resulting reference
-            // would be wrong. This is a dilemma if col/row would need to be
-            // updated for the current usage.
-            bUpdate = bUpdate && !rRef.Ref1.IsTabRel() && !rRef.Ref2.IsTabRel();
-        }
-        if (bUpdate)
-        {
-            ScRange aRefRange = rRef.toAbs(aPos);
-            if (ScRefUpdate::Update(pDoc, eUpdateRefMode, aPos, r, nDx, nDy, nDz, rRef, aRefRange, ScRefUpdate::ABSOLUTE) != UR_NOTHING)
-            {
-                rRef.SetRange(aRefRange, aPos);
-                rChanged = true;
-            }
-        }
-    }
-    return bRelRef;
-}
-
 void ScCompiler::CreateStringFromExternal(OUStringBuffer& rBuffer, FormulaToken* pTokenP)
 {
     FormulaToken* t = pTokenP;


More information about the Libreoffice-commits mailing list