diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-08-22 13:54:36 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-08-22 21:50:45 +0200 |
commit | 735a230c00f06392d9076b08d5bf573f4ba30e7d (patch) | |
tree | e9a79fa887aa7b2c331a62e14a5fbb7e4550f14f | |
parent | fbcc3469a635508c3af273453f24017bee4fd943 (diff) |
replace StackCleaner with std::unique_ptr
it is doing the same thing
Change-Id: Ieaf0931c4dffc62fda2792f34d900c9c01ba82e8
Reviewed-on: https://gerrit.libreoffice.org/59444
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | sc/source/core/data/formulacell.cxx | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/sc/source/core/data/formulacell.cxx b/sc/source/core/data/formulacell.cxx index 72925d6c3352..660ea65f0a1a 100644 --- a/sc/source/core/data/formulacell.cxx +++ b/sc/source/core/data/formulacell.cxx @@ -1803,17 +1803,6 @@ void ScFormulaCell::Interpret() #endif } -namespace { -class StackCleaner -{ - std::unique_ptr<ScInterpreter> pInt; - public: - StackCleaner( ScInterpreter* pI ) - : pInt(pI) - {} -}; -} - void ScFormulaCell::InterpretTail( ScInterpreterContext& rContext, ScInterpretTailParameter eTailParam ) { RecursionCounter aRecursionCounter( pDocument->GetRecursionHelper(), this); @@ -1841,8 +1830,7 @@ void ScFormulaCell::InterpretTail( ScInterpreterContext& rContext, ScInterpretTa if( pCode->GetCodeLen() && pDocument ) { - ScInterpreter* pInterpreter = new ScInterpreter( this, pDocument, rContext, aPos, *pCode ); - StackCleaner aStackCleaner(pInterpreter); + std::unique_ptr<ScInterpreter> pInterpreter(new ScInterpreter( this, pDocument, rContext, aPos, *pCode )); FormulaError nOldErrCode = aResult.GetResultError(); if ( nSeenInIteration == 0 ) { // Only the first time @@ -2244,8 +2232,7 @@ void ScFormulaCell::HandleStuffAfterParallelCalculation() if ( !pCode->IsRecalcModeAlways() ) pDocument->RemoveFromFormulaTree( this ); - ScInterpreter* pInterpreter = new ScInterpreter( this, pDocument, pDocument->GetNonThreadedContext(), aPos, *pCode ); - StackCleaner aStackCleaner(pInterpreter); + std::unique_ptr<ScInterpreter> pInterpreter(new ScInterpreter( this, pDocument, pDocument->GetNonThreadedContext(), aPos, *pCode )); switch (pInterpreter->GetVolatileType()) { |