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

Tor Lillqvist tml at collabora.com
Wed Aug 30 08:53:22 UTC 2017


 sc/source/core/data/grouptokenconverter.cxx |    2 +-
 sc/source/core/inc/grouptokenconverter.hxx  |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 310efe2d580598b1143148559c057dd52b32a42b
Author: Tor Lillqvist <tml at collabora.com>
Date:   Wed Aug 30 11:31:10 2017 +0300

    This can be const
    
    Change-Id: I5d9f96111a17ec49deeb5716e1a8d38e444dad20

diff --git a/sc/source/core/inc/grouptokenconverter.hxx b/sc/source/core/inc/grouptokenconverter.hxx
index c2bb268abc5d..43b3ac3f6fd5 100644
--- a/sc/source/core/inc/grouptokenconverter.hxx
+++ b/sc/source/core/inc/grouptokenconverter.hxx
@@ -22,7 +22,7 @@ class SC_DLLPUBLIC ScGroupTokenConverter
     ScTokenArray& mrGroupTokens;
     ScDocument& mrDoc;
     std::shared_ptr<sc::FormulaGroupContext> mxFormulaGroupContext;
-    ScFormulaCell& mrCell;
+    const ScFormulaCell& mrCell;
     const ScAddress& mrPos;
 
     bool isSelfReferenceRelative(const ScAddress& rRefPos, SCROW nRelRow);
commit 1cfb07cb0b8dfa1d2db945622f52a2a9bead7083
Author: Tor Lillqvist <tml at collabora.com>
Date:   Wed Aug 30 11:14:28 2017 +0300

    This variable can be const, and calculated once before the loop
    
    Change-Id: I18aa862a6568891f1c44d5b6da78fc2ac45e8075

diff --git a/sc/source/core/data/grouptokenconverter.cxx b/sc/source/core/data/grouptokenconverter.cxx
index f32632d7adab..0418cf98fc3b 100644
--- a/sc/source/core/data/grouptokenconverter.cxx
+++ b/sc/source/core/data/grouptokenconverter.cxx
@@ -102,6 +102,7 @@ bool ScGroupTokenConverter::convert( const ScTokenArray& rCode, sc::FormulaLogge
     }
 #endif
 
+    const SCROW nLen = mrCell.GetCellGroup()->mnLength;
     formula::FormulaTokenArrayPlainIterator aIter(rCode);
     for (const formula::FormulaToken* p = aIter.First(); p; p = aIter.Next())
     {
@@ -110,7 +111,6 @@ bool ScGroupTokenConverter::convert( const ScTokenArray& rCode, sc::FormulaLogge
         // vector reference token.  Note: we only care about relative vs
         // absolute reference state for row directions.
 
-        SCROW nLen = mrCell.GetCellGroup()->mnLength;
         switch (p->GetType())
         {
             case svSingleRef:


More information about the Libreoffice-commits mailing list