From bc8b3a8d45f60e2d11b5fa8f4ab6dfab9ddba4fc Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Wed, 28 Mar 2018 10:08:06 +0200 Subject: loplugin:useuniqueptr in ScInterpreter Change-Id: I682fa97a567ecf952214aa050a0ec981b4897ef5 Reviewed-on: https://gerrit.libreoffice.org/52028 Tested-by: Jenkins Reviewed-by: Noel Grandin --- sc/source/core/inc/interpre.hxx | 4 ++-- sc/source/core/tool/interpr4.cxx | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'sc/source') 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 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() -- cgit