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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Aug 22 19:51:11 UTC 2018


 sc/source/core/data/formulacell.cxx |   17 ++---------------
 1 file changed, 2 insertions(+), 15 deletions(-)

New commits:
commit 735a230c00f06392d9076b08d5bf573f4ba30e7d
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Wed Aug 22 13:54:36 2018 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Wed Aug 22 21:50:45 2018 +0200

    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 at collabora.co.uk>

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())
         {


More information about the Libreoffice-commits mailing list