basic/source/classes/sbxmod.cxx |   16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)

New commits:
commit ab07e43f38455f3ba4f97275e72dd4eba1027040
Author:     Mike Kaganski <mike.kagan...@collabora.com>
AuthorDate: Thu Jan 26 21:55:02 2023 +0300
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Wed Feb 22 08:10:33 2023 +0000

    Simplify a bit
    
    Change-Id: Ib3507d5083116fc621def9c8168c95267a914bed
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146192
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com>
    Signed-off-by: Xisco Fauli <xiscofa...@libreoffice.org>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147388

diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx
index 2766d9be6ab2..60bdc9171b48 100644
--- a/basic/source/classes/sbxmod.cxx
+++ b/basic/source/classes/sbxmod.cxx
@@ -1166,16 +1166,14 @@ void SbModule::Run( SbMethod* pMeth )
                 pSbData->pInst->CalcBreakCallLevel( pMeth->GetDebugFlags() );
             }
 
-            auto xRuntimeGuard(std::make_unique<RunGuard>(this, pMeth, 
pMeth->nStart, pSbData, bDelInst));
-
-            if ( mbVBACompat )
             {
-                pSbData->pInst->EnableCompatibility( true );
-            }
+                RunGuard xRuntimeGuard(this, pMeth, pMeth->nStart, pSbData, 
bDelInst);
 
-            xRuntimeGuard->run();
+                if (mbVBACompat)
+                    pSbData->pInst->EnableCompatibility(true);
 
-            xRuntimeGuard.reset();
+                xRuntimeGuard.run();
+            }
 
             if( bDelInst )
             {
@@ -1254,9 +1252,7 @@ void SbModule::RunInit()
     pSbData->bRunInit = true;
 
     // The init code starts always here
-    auto xRuntimeGuard(std::make_unique<RunInitGuard>(this, nullptr, 0, 
pSbData));
-    xRuntimeGuard->run();
-    xRuntimeGuard.reset();
+    RunInitGuard(this, nullptr, 0, pSbData).run();
 
     pImage->bInit = true;
     pImage->bFirstInit = false;

Reply via email to