diff options
author | Noel Grandin <noel@peralex.com> | 2012-12-10 15:58:49 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2012-12-13 05:20:58 +0200 |
commit | e52a5e298b55125534cd8548ed4c1f8b694bfef6 (patch) | |
tree | cd05d4866578c0f63142a24c8ef7607778b3c78a /svtools | |
parent | fdo#46808, use service constructor for embed::FileSystemStorageFactory (diff) | |
download | core-e52a5e298b55125534cd8548ed4c1f8b694bfef6.tar.gz core-e52a5e298b55125534cd8548ed4c1f8b694bfef6.zip |
fdo#46808, use service constructor for ui::GlobalAcceleratorConfiguration
Change-Id: Icab69ba138b28c3baed4352da86a1b3b0c0cc195
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/inc/svtools/acceleratorexecute.hxx | 5 | ||||
-rw-r--r-- | svtools/source/misc/acceleratorexecute.cxx | 20 |
2 files changed, 9 insertions, 16 deletions
diff --git a/svtools/inc/svtools/acceleratorexecute.hxx b/svtools/inc/svtools/acceleratorexecute.hxx index b3682858e77e..15a7ae4c4683 100644 --- a/svtools/inc/svtools/acceleratorexecute.hxx +++ b/svtools/inc/svtools/acceleratorexecute.hxx @@ -25,6 +25,7 @@ #include <vector> #include <com/sun/star/lang/XMultiServiceFactory.hpp> +#include <com/sun/star/uno/XComponentContext.hpp> #include <com/sun/star/frame/XFrame.hpp> #include <com/sun/star/frame/XDispatchProvider.hpp> #include <com/sun/star/ui/XAcceleratorConfiguration.hpp> @@ -201,11 +202,11 @@ class SVT_DLLPUBLIC AcceleratorExecute : private TMutexInit //--------------------------------------- /** TODO document me */ - static css::uno::Reference< css::ui::XAcceleratorConfiguration > st_openGlobalConfig(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR); + static css::uno::Reference< css::ui::XAcceleratorConfiguration > st_openGlobalConfig(const css::uno::Reference< css::uno::XComponentContext >& rxContext); //--------------------------------------- /** TODO document me */ - static css::uno::Reference< css::ui::XAcceleratorConfiguration > st_openModuleConfig(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR , + static css::uno::Reference< css::ui::XAcceleratorConfiguration > st_openModuleConfig(const css::uno::Reference< css::uno::XComponentContext >& rxContext , const css::uno::Reference< css::frame::XFrame >& xFrame); //--------------------------------------- diff --git a/svtools/source/misc/acceleratorexecute.cxx b/svtools/source/misc/acceleratorexecute.cxx index 144a211f25f4..ea21f8640d9c 100644 --- a/svtools/source/misc/acceleratorexecute.cxx +++ b/svtools/source/misc/acceleratorexecute.cxx @@ -21,6 +21,7 @@ #include <com/sun/star/frame/ModuleManager.hpp> #include <com/sun/star/frame/XDesktop.hpp> +#include <com/sun/star/ui/GlobalAcceleratorConfiguration.hpp> #include <com/sun/star/ui/XUIConfigurationManager.hpp> #include <com/sun/star/ui/ModuleUIConfigurationManagerSupplier.hpp> #include <com/sun/star/ui/XUIConfigurationManagerSupplier.hpp> @@ -142,11 +143,11 @@ void AcceleratorExecute::init(const css::uno::Reference< css::lang::XMultiServic css::uno::Reference< css::ui::XAcceleratorConfiguration > xDocCfg ; // global cfg - xGlobalCfg = AcceleratorExecute::st_openGlobalConfig(xSMGR); + xGlobalCfg = css::ui::GlobalAcceleratorConfiguration::create(comphelper::getComponentContext(xSMGR)); if (!bDesktopIsUsed) { // module cfg - xModuleCfg = AcceleratorExecute::st_openModuleConfig(xSMGR, xEnv); + xModuleCfg = AcceleratorExecute::st_openModuleConfig(comphelper::getComponentContext(xSMGR), xEnv); // doc cfg css::uno::Reference< css::frame::XController > xController; @@ -365,20 +366,11 @@ KeyCode AcceleratorExecute::st_AWTKey2VCLKey(const css::awt::KeyEvent& aAWTKey) } //----------------------------------------------- -css::uno::Reference< css::ui::XAcceleratorConfiguration > AcceleratorExecute::st_openGlobalConfig(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR) -{ - css::uno::Reference< css::ui::XAcceleratorConfiguration > xAccCfg( - xSMGR->createInstance(::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ui.GlobalAcceleratorConfiguration" ))), - css::uno::UNO_QUERY_THROW); - return xAccCfg; -} - -//----------------------------------------------- -css::uno::Reference< css::ui::XAcceleratorConfiguration > AcceleratorExecute::st_openModuleConfig(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR , +css::uno::Reference< css::ui::XAcceleratorConfiguration > AcceleratorExecute::st_openModuleConfig(const css::uno::Reference< css::uno::XComponentContext >& rxContext, const css::uno::Reference< css::frame::XFrame >& xFrame) { css::uno::Reference< css::frame::XModuleManager2 > xModuleDetection( - css::frame::ModuleManager::create(comphelper::getComponentContext(xSMGR))); + css::frame::ModuleManager::create(rxContext)); ::rtl::OUString sModule; try @@ -391,7 +383,7 @@ css::uno::Reference< css::ui::XAcceleratorConfiguration > AcceleratorExecute::st { return css::uno::Reference< css::ui::XAcceleratorConfiguration >(); } css::uno::Reference< css::ui::XModuleUIConfigurationManagerSupplier > xUISupplier( - css::ui::ModuleUIConfigurationManagerSupplier::create(comphelper::getComponentContext(xSMGR)) ); + css::ui::ModuleUIConfigurationManagerSupplier::create(rxContext) ); css::uno::Reference< css::ui::XAcceleratorConfiguration > xAccCfg; try |