diff options
author | Noel Grandin <noel@peralex.com> | 2012-09-04 14:56:48 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2012-09-05 14:56:19 +0200 |
commit | 1c7a54e3a14ad932e68b9281420e6c469e5dd2e5 (patch) | |
tree | 8d2d64a9536e738cc6cda4f0690993c98b658bdd /svtools | |
parent | 55aa40bcd6ae3116c63a0eac18056bcfd011f43a (diff) |
fdo#46808, Adapt frame::ModuleManager UNO service to new style
Create a merged XModuleManager2 interface for this service to implement.
Which is backwards-compatible, but does not require creating a new service.
Explicitly document the XNameReplace interface in the IDL, which
is already implemented by the service, since there is code currently using it.
Change-Id: Ib46349174b1ce495c240031e93c9427fc33d9853
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/source/misc/acceleratorexecute.cxx | 4 | ||||
-rw-r--r-- | svtools/source/uno/contextmenuhelper.cxx | 34 |
2 files changed, 16 insertions, 22 deletions
diff --git a/svtools/source/misc/acceleratorexecute.cxx b/svtools/source/misc/acceleratorexecute.cxx index bb07a8917fa8..881383d42045 100644 --- a/svtools/source/misc/acceleratorexecute.cxx +++ b/svtools/source/misc/acceleratorexecute.cxx @@ -28,7 +28,7 @@ #include <svtools/acceleratorexecute.hxx> -#include <com/sun/star/frame/XModuleManager.hpp> +#include <com/sun/star/frame/ModuleManager.hpp> #include <com/sun/star/frame/XDesktop.hpp> #include <com/sun/star/ui/XUIConfigurationManager.hpp> #include <com/sun/star/ui/ModuleUIConfigurationManagerSupplier.hpp> @@ -389,7 +389,7 @@ css::uno::Reference< css::ui::XAcceleratorConfiguration > AcceleratorExecute::st const css::uno::Reference< css::frame::XFrame >& xFrame) { css::uno::Reference< css::frame::XModuleManager > xModuleDetection( - xSMGR->createInstance(::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.ModuleManager" ))), + css::frame::ModuleManager::create(comphelper::ComponentContext(xSMGR).getUNOContext()), css::uno::UNO_QUERY_THROW); ::rtl::OUString sModule; diff --git a/svtools/source/uno/contextmenuhelper.cxx b/svtools/source/uno/contextmenuhelper.cxx index 8e28720798ef..a452e6b95b30 100644 --- a/svtools/source/uno/contextmenuhelper.cxx +++ b/svtools/source/uno/contextmenuhelper.cxx @@ -33,7 +33,7 @@ #include <com/sun/star/frame/XDispatch.hpp> #include <com/sun/star/frame/XDispatchProvider.hpp> -#include <com/sun/star/frame/XModuleManager.hpp> +#include <com/sun/star/frame/ModuleManager.hpp> #include <com/sun/star/frame/XStatusListener.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/ui/XUIConfigurationManagerSupplier.hpp> @@ -417,29 +417,23 @@ ContextMenuHelper::associateUIConfigurationManagers() } } - uno::Reference< frame::XModuleManager > xModuleManager( - ::comphelper::getProcessServiceFactory()->createInstance( - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( - "com.sun.star.frame.ModuleManager" ))), - uno::UNO_QUERY ); + uno::Reference< frame::XModuleManager2 > xModuleManager( + frame::ModuleManager::create( ::comphelper::getProcessComponentContext() ) ); uno::Reference< ui::XImageManager > xModuleImageManager; rtl::OUString aModuleId; - if ( xModuleManager.is() ) + // retrieve module image manager + aModuleId = xModuleManager->identify( xFrame ); + + uno::Reference< ui::XModuleUIConfigurationManagerSupplier > xModuleCfgMgrSupplier( + ui::ModuleUIConfigurationManagerSupplier::create( + ::comphelper::getProcessComponentContext() ) ); + uno::Reference< ui::XUIConfigurationManager > xUICfgMgr( + xModuleCfgMgrSupplier->getUIConfigurationManager( aModuleId )); + if ( xUICfgMgr.is() ) { - // retrieve module image manager - aModuleId = xModuleManager->identify( xFrame ); - - uno::Reference< ui::XModuleUIConfigurationManagerSupplier > xModuleCfgMgrSupplier( - ui::ModuleUIConfigurationManagerSupplier::create( - ::comphelper::getProcessComponentContext() ) ); - uno::Reference< ui::XUIConfigurationManager > xUICfgMgr( - xModuleCfgMgrSupplier->getUIConfigurationManager( aModuleId )); - if ( xUICfgMgr.is() ) - { - m_xModuleImageMgr = uno::Reference< ui::XImageManager >( - xUICfgMgr->getImageManager(), uno::UNO_QUERY ); - } + m_xModuleImageMgr = uno::Reference< ui::XImageManager >( + xUICfgMgr->getImageManager(), uno::UNO_QUERY ); } uno::Reference< container::XNameAccess > xNameAccess( |