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 /sfx2/source/dialog/recfloat.cxx | |
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 'sfx2/source/dialog/recfloat.cxx')
-rw-r--r-- | sfx2/source/dialog/recfloat.cxx | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/sfx2/source/dialog/recfloat.cxx b/sfx2/source/dialog/recfloat.cxx index a43b9fba17db..fb30ecc42f1b 100644 --- a/sfx2/source/dialog/recfloat.cxx +++ b/sfx2/source/dialog/recfloat.cxx @@ -18,7 +18,7 @@ */ #include <com/sun/star/frame/XDispatchRecorderSupplier.hpp> -#include <com/sun/star/frame/XModuleManager.hpp> +#include <com/sun/star/frame/ModuleManager.hpp> #include <com/sun/star/container/XNameAccess.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/ui/UICommandDescription.hpp> @@ -26,7 +26,6 @@ #include <svl/eitem.hxx> #include <svtools/generictoolboxcontroller.hxx> #include <vcl/msgbox.hxx> -#include <comphelper/componentcontext.hxx> #include <comphelper/processfactory.hxx> #include "recfloat.hxx" @@ -46,37 +45,32 @@ static rtl::OUString GetLabelFromCommandURL( const rtl::OUString& rCommandURL, c rtl::OUString aLabel; rtl::OUString aModuleIdentifier; uno::Reference< container::XNameAccess > xUICommandLabels; - uno::Reference< lang::XMultiServiceFactory > xServiceManager; + uno::Reference< uno::XComponentContext > xContext; uno::Reference< container::XNameAccess > xUICommandDescription; uno::Reference< ::com::sun::star::frame::XModuleManager > xModuleManager; - static uno::WeakReference< lang::XMultiServiceFactory > xTmpServiceManager; - static uno::WeakReference< container::XNameAccess > xTmpNameAccess; + static uno::WeakReference< uno::XComponentContext > xTmpContext; + static uno::WeakReference< container::XNameAccess > xTmpNameAccess; static uno::WeakReference< ::com::sun::star::frame::XModuleManager > xTmpModuleMgr; - xServiceManager = xTmpServiceManager; - if ( !xServiceManager.is() ) + xContext = xTmpContext; + if ( !xContext.is() ) { - xServiceManager = ::comphelper::getProcessServiceFactory(); - xTmpServiceManager = xServiceManager; + xContext = ::comphelper::getProcessComponentContext(); + xTmpContext = xContext; } xUICommandDescription = xTmpNameAccess; if ( !xUICommandDescription.is() ) { - xUICommandDescription = uno::Reference< container::XNameAccess >( - ui::UICommandDescription::create(comphelper::ComponentContext(xServiceManager).getUNOContext()) ); + xUICommandDescription = uno::Reference< container::XNameAccess >( ui::UICommandDescription::create(xContext) ); xTmpNameAccess = xUICommandDescription; } xModuleManager = xTmpModuleMgr; if ( !xModuleManager.is() ) { - xModuleManager = uno::Reference< ::com::sun::star::frame::XModuleManager >( - xServiceManager->createInstance( - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( - "com.sun.star.frame.ModuleManager" ))), - uno::UNO_QUERY_THROW ); + xModuleManager = uno::Reference< frame::XModuleManager >( frame::ModuleManager::create(xContext), uno::UNO_QUERY_THROW ); xTmpModuleMgr = xModuleManager; } |