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

Noel Grandin noel.grandin at collabora.co.uk
Thu Mar 29 06:36:09 UTC 2018


 sc/source/core/inc/interpre.hxx  |    4 ++--
 sc/source/core/tool/interpr4.cxx |    1 -
 2 files changed, 2 insertions(+), 3 deletions(-)

New commits:
commit bc8b3a8d45f60e2d11b5fa8f4ab6dfab9ddba4fc
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Wed Mar 28 10:08:06 2018 +0200

    loplugin:useuniqueptr in ScInterpreter
    
    Change-Id: I682fa97a567ecf952214aa050a0ec981b4897ef5
    Reviewed-on: https://gerrit.libreoffice.org/52028
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/sc/source/core/inc/interpre.hxx b/sc/source/core/inc/interpre.hxx
index 8f68245f99d7..71bf46a80c50 100644
--- a/sc/source/core/inc/interpre.hxx
+++ b/sc/source/core/inc/interpre.hxx
@@ -205,7 +205,7 @@ private:
     svl::SharedStringPool& mrStrPool;
     formula::FormulaConstTokenRef  xResult;
     ScJumpMatrix*   pJumpMatrix;        // currently active array condition, if any
-    ScTokenMatrixMap* pTokenMatrixMap;  // map FormulaToken* to formula::FormulaTokenRef if in array condition
+    std::unique_ptr<ScTokenMatrixMap> pTokenMatrixMap;  // map FormulaToken* to formula::FormulaTokenRef if in array condition
     ScFormulaCell* pMyFormulaCell;      // the cell of this formula expression
     SvNumberFormatter* pFormatter;
 
@@ -1031,7 +1031,7 @@ inline bool ScInterpreter::MatrixParameterConversion()
 inline ScTokenMatrixMap& ScInterpreter::GetTokenMatrixMap()
 {
     if (!pTokenMatrixMap)
-        pTokenMatrixMap = CreateTokenMatrixMap();
+        pTokenMatrixMap.reset(CreateTokenMatrixMap());
     return *pTokenMatrixMap;
 }
 
diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx
index f3e855f04828..b6f55e7bb7bc 100644
--- a/sc/source/core/tool/interpr4.cxx
+++ b/sc/source/core/tool/interpr4.cxx
@@ -3861,7 +3861,6 @@ ScInterpreter::~ScInterpreter()
         bGlobalStackInUse = false;
     else
         delete pStackObj;
-    delete pTokenMatrixMap;
 }
 
 ScCalcConfig& ScInterpreter::GetOrCreateGlobalConfig()


More information about the Libreoffice-commits mailing list