diff options
author | Carsten Driesner <cd@openoffice.org> | 2010-08-18 10:52:09 +0200 |
---|---|---|
committer | Carsten Driesner <cd@openoffice.org> | 2010-08-18 10:52:09 +0200 |
commit | cee18c6b582e045958a70cee8222a83598f4c437 (patch) | |
tree | c59bc7c683aebdcb6101cae372cf7a2bdc27f800 /framework/source/uiconfiguration | |
parent | 556bd4d205fa74157f378d0a8baf57dacd08bfaa (diff) |
fwk153: #i110127# Provide one instance of module accelerator manager in module ui configuration manager implementation.
Diffstat (limited to 'framework/source/uiconfiguration')
-rw-r--r-- | framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx | 78 |
1 files changed, 43 insertions, 35 deletions
diff --git a/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx b/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx index a4827dc24b..54f8ecf506 100644 --- a/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx +++ b/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx @@ -776,26 +776,29 @@ void SAL_CALL ModuleUIConfigurationManager::dispose() throw (::com::sun::star::u css::lang::EventObject aEvent( xThis ); m_aListenerContainer.disposeAndClear( aEvent ); + /* SAFE AREA ----------------------------------------------------------------------------------------------- */ + ResetableGuard aGuard( m_aLock ); + Reference< XComponent > xModuleImageManager( m_xModuleImageManager ); + m_xModuleImageManager.clear(); + m_xModuleAcceleratorManager.clear(); + m_aUIElements[LAYER_USERDEFINED].clear(); + m_aUIElements[LAYER_DEFAULT].clear(); + m_xDefaultConfigStorage.clear(); + m_xUserConfigStorage.clear(); + m_xUserRootCommit.clear(); + m_bConfigRead = false; + m_bModified = false; + m_bDisposed = true; + aGuard.unlock(); + /* SAFE AREA ----------------------------------------------------------------------------------------------- */ + + try + { + if ( xModuleImageManager.is() ) + xModuleImageManager->dispose(); + } + catch ( Exception& ) { - ResetableGuard aGuard( m_aLock ); - try - { - if ( m_xModuleImageManager.is() ) - m_xModuleImageManager->dispose(); - } - catch ( Exception& ) - { - } - - m_xModuleImageManager.clear(); - m_aUIElements[LAYER_USERDEFINED].clear(); - m_aUIElements[LAYER_DEFAULT].clear(); - m_xDefaultConfigStorage.clear(); - m_xUserConfigStorage.clear(); - m_xUserRootCommit.clear(); - m_bConfigRead = false; - m_bModified = false; - m_bDisposed = true; } } @@ -1370,30 +1373,35 @@ Reference< XInterface > SAL_CALL ModuleUIConfigurationManager::getImageManager() } return Reference< XInterface >( m_xModuleImageManager, UNO_QUERY ); - -// return Reference< XInterface >(); } Reference< XInterface > SAL_CALL ModuleUIConfigurationManager::getShortCutManager() throw (::com::sun::star::uno::RuntimeException) { ResetableGuard aGuard( m_aLock ); + + if ( m_bDisposed ) + throw DisposedException(); + Reference< XMultiServiceFactory > xSMGR = m_xServiceManager; - ::rtl::OUString aModule = /*m_aModuleShortName*/m_aModuleIdentifier; - aGuard.unlock(); + ::rtl::OUString aModule = m_aModuleIdentifier; - Reference< XInterface > xManager = xSMGR->createInstance(SERVICENAME_MODULEACCELERATORCONFIGURATION); - Reference< XInitialization > xInit (xManager, UNO_QUERY_THROW); - - PropertyValue aProp; - aProp.Name = ::rtl::OUString::createFromAscii("ModuleIdentifier"); - aProp.Value <<= aModule; - - Sequence< Any > lArgs(1); - lArgs[0] <<= aProp; - - xInit->initialize(lArgs); + if ( !m_xModuleAcceleratorManager.is() ) + { + Reference< XInterface > xManager = xSMGR->createInstance(SERVICENAME_MODULEACCELERATORCONFIGURATION); + Reference< XInitialization > xInit (xManager, UNO_QUERY_THROW); + + PropertyValue aProp; + aProp.Name = ::rtl::OUString::createFromAscii("ModuleIdentifier"); + aProp.Value <<= aModule; + + Sequence< Any > lArgs(1); + lArgs[0] <<= aProp; + + xInit->initialize(lArgs); + m_xModuleAcceleratorManager = Reference< XInterface >( xManager, UNO_QUERY ); + } - return xManager; + return m_xModuleAcceleratorManager; } Reference< XInterface > SAL_CALL ModuleUIConfigurationManager::getEventsManager() throw (::com::sun::star::uno::RuntimeException) |