Kaydet (Commit) d40c2239 authored tarafından Carsten Driesner's avatar Carsten Driesner

fwk153: #i110127# Provide one instance of module accelerator manager in module…

fwk153: #i110127# Provide one instance of module accelerator manager in module ui configuration manager implementation.
üst b3a5ee2e
......@@ -219,6 +219,7 @@ namespace framework
com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > m_xServiceManager;
::cppu::OMultiTypeInterfaceContainerHelper m_aListenerContainer; /// container for ALL Listener
com::sun::star::uno::Reference< com::sun::star::lang::XComponent > m_xModuleImageManager;
com::sun::star::uno::Reference< com::sun::star::uno::XInterface > m_xModuleAcceleratorManager;
};
}
......
......@@ -1246,12 +1246,13 @@ void SAL_CALL XCUBasedAcceleratorConfiguration::changesOccurred(const css::util:
if (! xHAccess.is ())
return;
const sal_Int32 c = aEvent.Changes.getLength();
css::util::ChangesEvent aReceivedEvents( aEvent );
const sal_Int32 c = aReceivedEvents.Changes.getLength();
sal_Int32 i = 0;
for (i=0; i<c; ++i)
{
const css::util::ElementChange& aChange = aEvent.Changes[i];
const css::util::ElementChange& aChange = aReceivedEvents.Changes[i];
// Only path of form "PrimaryKeys/Modules/Module['<module_name>']/Key['<command_url>']/Command[<locale>]" will
// be interesting for use. Sometimes short path values are given also by the broadcaster ... but they must be ignored :-)
......
......@@ -776,18 +776,11 @@ 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 );
try
{
if ( m_xModuleImageManager.is() )
m_xModuleImageManager->dispose();
}
catch ( Exception& )
{
}
Reference< XComponent > xModuleImageManager( m_xModuleImageManager );
m_xModuleImageManager.clear();
m_xModuleAcceleratorManager.clear();
m_aUIElements[LAYER_USERDEFINED].clear();
m_aUIElements[LAYER_DEFAULT].clear();
m_xDefaultConfigStorage.clear();
......@@ -796,6 +789,16 @@ void SAL_CALL ModuleUIConfigurationManager::dispose() throw (::com::sun::star::u
m_bConfigRead = false;
m_bModified = false;
m_bDisposed = true;
aGuard.unlock();
/* SAFE AREA ----------------------------------------------------------------------------------------------- */
try
{
if ( xModuleImageManager.is() )
xModuleImageManager->dispose();
}
catch ( Exception& )
{
}
}
......@@ -1370,17 +1373,20 @@ 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;
if ( !m_xModuleAcceleratorManager.is() )
{
Reference< XInterface > xManager = xSMGR->createInstance(SERVICENAME_MODULEACCELERATORCONFIGURATION);
Reference< XInitialization > xInit (xManager, UNO_QUERY_THROW);
......@@ -1392,8 +1398,10 @@ Reference< XInterface > SAL_CALL ModuleUIConfigurationManager::getShortCutManage
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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment