summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-03-28 10:08:06 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-03-29 08:35:43 +0200
commitbc8b3a8d45f60e2d11b5fa8f4ab6dfab9ddba4fc (patch)
treeb065876a49805cabf7a12aa63de4a461774ab55a
parent63c6668f06ca5921432020b5a527e43c251e5154 (diff)
loplugin:useuniqueptr in ScInterpreter
Change-Id: I682fa97a567ecf952214aa050a0ec981b4897ef5 Reviewed-on: https://gerrit.libreoffice.org/52028 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--sc/source/core/inc/interpre.hxx4
-rw-r--r--sc/source/core/tool/interpr4.cxx1
2 files changed, 2 insertions, 3 deletions
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()