diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-02-06 10:09:28 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-02-07 08:19:14 +0100 |
commit | 536a6d6ca67d01c8470c242c6f1fd0750496eed4 (patch) | |
tree | cc2aed75621456aaeb31d26e910cc61baf3bfdd7 /sfx2/source/doc/objxtor.cxx | |
parent | 53a318196859140deb4b3c317db583a90cfd604c (diff) |
loplugin:flatten in sfx2
Change-Id: If4e07d497ead58a2ff58b5fdedd282b8784be421
Reviewed-on: https://gerrit.libreoffice.org/67435
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sfx2/source/doc/objxtor.cxx')
-rw-r--r-- | sfx2/source/doc/objxtor.cxx | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx index 093fbbc4ecc9..4bf33375a479 100644 --- a/sfx2/source/doc/objxtor.cxx +++ b/sfx2/source/doc/objxtor.cxx @@ -890,30 +890,30 @@ void SfxObjectShell::SetCurrentComponent( const Reference< XInterface >& _rxComp #if HAVE_FEATURE_SCRIPTING BasicManager* pAppMgr = SfxApplication::GetBasicManager(); rTheCurrentComponent = _rxComponent; - if ( pAppMgr ) - { - // set "ThisComponent" for Basic - pAppMgr->SetGlobalUNOConstant( "ThisComponent", Any( _rxComponent ) ); + if ( !pAppMgr ) + return; + + // set "ThisComponent" for Basic + pAppMgr->SetGlobalUNOConstant( "ThisComponent", Any( _rxComponent ) ); - // set new current component for VBA compatibility - if ( _rxComponent.is() ) + // set new current component for VBA compatibility + if ( _rxComponent.is() ) + { + OUString aVBAConstName = lclGetVBAGlobalConstName( _rxComponent ); + if ( !aVBAConstName.isEmpty() ) { - OUString aVBAConstName = lclGetVBAGlobalConstName( _rxComponent ); - if ( !aVBAConstName.isEmpty() ) - { - pAppMgr->SetGlobalUNOConstant( aVBAConstName, Any( _rxComponent ) ); - s_aRegisteredVBAConstants[ _rxComponent.get() ] = aVBAConstName; - } + pAppMgr->SetGlobalUNOConstant( aVBAConstName, Any( _rxComponent ) ); + s_aRegisteredVBAConstants[ _rxComponent.get() ] = aVBAConstName; } - // no new component passed -> remove last registered VBA component - else if ( xOldCurrentComp.is() ) + } + // no new component passed -> remove last registered VBA component + else if ( xOldCurrentComp.is() ) + { + OUString aVBAConstName = lclGetVBAGlobalConstName( xOldCurrentComp ); + if ( !aVBAConstName.isEmpty() ) { - OUString aVBAConstName = lclGetVBAGlobalConstName( xOldCurrentComp ); - if ( !aVBAConstName.isEmpty() ) - { - pAppMgr->SetGlobalUNOConstant( aVBAConstName, Any( Reference< XInterface >() ) ); - s_aRegisteredVBAConstants.erase( xOldCurrentComp.get() ); - } + pAppMgr->SetGlobalUNOConstant( aVBAConstName, Any( Reference< XInterface >() ) ); + s_aRegisteredVBAConstants.erase( xOldCurrentComp.get() ); } } #endif |