basic/source/classes/sbunoobj.cxx | 8 ++------ basic/source/classes/sbxmod.cxx | 16 ++++++---------- 2 files changed, 8 insertions(+), 16 deletions(-)
New commits: commit 6128d8379a29bb8ce50e34bfb4c7627459c2d796 Author: Mike Kaganski <[email protected]> AuthorDate: Thu Jan 26 21:55:33 2023 +0300 Commit: Mike Kaganski <[email protected]> CommitDate: Thu Jan 26 22:15:25 2023 +0000 Simplify a bit Change-Id: I970feb9897018c69173b899392484a2818c184f2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146193 Tested-by: Jenkins Reviewed-by: Mike Kaganski <[email protected]> diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx index 8d3dac965593..71ef915e942a 100644 --- a/basic/source/classes/sbunoobj.cxx +++ b/basic/source/classes/sbunoobj.cxx @@ -4295,17 +4295,13 @@ Any SAL_CALL ModuleInvocationProxy::invoke( const OUString& rFunction, OUString aFunctionName = m_aPrefix + rFunction; - bool bSetRescheduleBack = false; - bool bOldReschedule = true; + bool bOldReschedule = false; SbiInstance* pInst = GetSbData()->pInst; if( pInst && pInst->IsCompatibility() ) { bOldReschedule = pInst->IsReschedule(); if ( bOldReschedule ) - { pInst->EnableReschedule( false ); - bSetRescheduleBack = true; - } } SbxVariable* p = xScopeObj->Find( aFunctionName, SbxClassType::Method ); @@ -4340,7 +4336,7 @@ Any SAL_CALL ModuleInvocationProxy::invoke( const OUString& rFunction, aRet = sbxToUnoValue( xValue.get() ); pMeth->SetParameters( nullptr ); - if( bSetRescheduleBack ) + if (bOldReschedule) pInst->EnableReschedule( bOldReschedule ); // TODO: OutParameter? commit e6120153b7fc455ac7979f17236dcb877ad8929c Author: Mike Kaganski <[email protected]> AuthorDate: Thu Jan 26 21:55:02 2023 +0300 Commit: Mike Kaganski <[email protected]> CommitDate: Thu Jan 26 22:15:12 2023 +0000 Simplify a bit Change-Id: Ib3507d5083116fc621def9c8168c95267a914bed Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146192 Tested-by: Jenkins Reviewed-by: Mike Kaganski <[email protected]> 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;
