diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-11-11 11:10:29 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2019-11-11 14:34:37 +0100 |
commit | 2297f042693a3c788d1eb264c170c6f59c439001 (patch) | |
tree | f021e53b326d9b850bae1793742631b798341108 /basic/source/classes | |
parent | a3c7a8282ddd08c7ed4a15d23089d09e418f8fae (diff) |
call GetSbData just once
Change-Id: Idb63c169c7e39f27bc99e3c3aa9155583f2a65ab
Reviewed-on: https://gerrit.libreoffice.org/82431
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'basic/source/classes')
-rw-r--r-- | basic/source/classes/sbxmod.cxx | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx index 0015aeadc098..bbab27dec8c8 100644 --- a/basic/source/classes/sbxmod.cxx +++ b/basic/source/classes/sbxmod.cxx @@ -1210,26 +1210,28 @@ void SbModule::RunInit() && !pImage->bInit && pImage->IsFlag( SbiImageFlags::INITCODE ) ) { + SbiGlobals* pSbData = GetSbData(); + // Set flag, so that RunInit get active (Testtool) - GetSbData()->bRunInit = true; + pSbData->bRunInit = true; - SbModule* pOldMod = GetSbData()->pMod; - GetSbData()->pMod = this; + SbModule* pOldMod = pSbData->pMod; + pSbData->pMod = this; // The init code starts always here std::unique_ptr<SbiRuntime> pRt(new SbiRuntime( this, nullptr, 0 )); - pRt->pNext = GetSbData()->pInst->pRun; - GetSbData()->pInst->pRun = pRt.get(); + pRt->pNext = pSbData->pInst->pRun; + pSbData->pInst->pRun = pRt.get(); while( pRt->Step() ) {} - GetSbData()->pInst->pRun = pRt->pNext; + pSbData->pInst->pRun = pRt->pNext; pRt.reset(); - GetSbData()->pMod = pOldMod; + pSbData->pMod = pOldMod; pImage->bInit = true; pImage->bFirstInit = false; // RunInit is not active anymore - GetSbData()->bRunInit = false; + pSbData->bRunInit = false; } } |