Simplify the code a bit.

Change-Id: I57581fb0f3439ddc4a4848466f6925d962b04aea
This commit is contained in:
Matúš Kukan
2014-02-10 11:30:52 +01:00
parent cc5ec80521
commit e034b0323c
2 changed files with 6 additions and 24 deletions

View File

@@ -1483,14 +1483,9 @@ Reference< ui::XAcceleratorConfiguration > SAL_CALL ModuleUIConfigurationManager
if ( m_bDisposed ) if ( m_bDisposed )
throw DisposedException(); throw DisposedException();
Reference< XComponentContext > xContext = m_xContext;
OUString aModule = m_aModuleIdentifier;
if ( !m_xModuleAcceleratorManager.is() ) if ( !m_xModuleAcceleratorManager.is() )
{ m_xModuleAcceleratorManager = ui::ModuleAcceleratorConfiguration::
Reference< ui::XAcceleratorConfiguration > xManager = ui::ModuleAcceleratorConfiguration::createWithModuleIdentifier(xContext, aModule); createWithModuleIdentifier(m_xContext, m_aModuleIdentifier);
m_xModuleAcceleratorManager = xManager;
}
return m_xModuleAcceleratorManager; return m_xModuleAcceleratorManager;
} }

View File

@@ -1178,24 +1178,11 @@ Reference< XAcceleratorConfiguration > SAL_CALL UIConfigurationManager::getShort
// SAFE -> // SAFE ->
ResetableGuard aGuard( m_aLock ); ResetableGuard aGuard( m_aLock );
if (m_xAccConfig.is()) if (!m_xAccConfig.is())
return m_xAccConfig; m_xAccConfig = DocumentAcceleratorConfiguration::
createWithDocumentRoot(m_xContext, m_xDocConfigStorage);
Reference< XComponentContext > xContext = m_xContext; return m_xAccConfig;
Reference< XStorage > xDocumentRoot = m_xDocConfigStorage;
aGuard.unlock();
// <- SAFE
Reference< XAcceleratorConfiguration > xAccConfig = DocumentAcceleratorConfiguration::createWithDocumentRoot(xContext, xDocumentRoot);
// SAFE ->
aGuard.lock();
m_xAccConfig = xAccConfig;
aGuard.unlock();
// <- SAFE
return xAccConfig;
} }
Reference< XInterface > SAL_CALL UIConfigurationManager::getEventsManager() throw (::com::sun::star::uno::RuntimeException) Reference< XInterface > SAL_CALL UIConfigurationManager::getEventsManager() throw (::com::sun::star::uno::RuntimeException)