From c25cb8a641723ab098980bb842caf75c0dc9b059 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 2 Oct 2012 15:03:12 +0200 Subject: fdo#46808, Adapt task::InteractionHandler UNO service to new style Since we don't need to expose XInitialisation, we can make the new-style service implement XInteractionHandler2. Change-Id: Ib27beed1c12df17592c6472d6f58c233d2c41558 --- desktop/source/app/configinit.cxx | 15 +++------------ desktop/source/app/dispatchwatcher.cxx | 9 +++++---- 2 files changed, 8 insertions(+), 16 deletions(-) (limited to 'desktop/source/app') diff --git a/desktop/source/app/configinit.cxx b/desktop/source/app/configinit.cxx index 393a755ea96b..66b1c6e3d4d0 100644 --- a/desktop/source/app/configinit.cxx +++ b/desktop/source/app/configinit.cxx @@ -36,6 +36,7 @@ #include #include #include +#include // ---------------------------------------------------------------------------- @@ -45,7 +46,6 @@ using rtl::OUString; using uno::UNO_QUERY; // ---------------------------------------------------------------------------- -static char const CONFIGURATION_ERROR_HANDLER[] = "com.sun.star.configuration.backend.InteractionHandler"; // must be aligned with configmgr/source/misc/configinteractionhandler static char const CONFIG_ERROR_HANDLER[] = "configuration.interaction-handler"; @@ -164,17 +164,8 @@ void ConfigurationErrorHandler::deactivate() ConfigurationErrorHandler::InteractionHandler ConfigurationErrorHandler::getDefaultInteractionHandler() { - uno::Reference< lang::XMultiServiceFactory > xServiceManager = ::comphelper::getProcessServiceFactory(); - - OSL_ENSURE( xServiceManager.is(),"No ServiceManager set for ConfigurationErrorHandler"); - - InteractionHandler xHandler; - - if (xServiceManager.is()) - { - xHandler.set( xServiceManager->createInstance(k_ERRORHANDLER), UNO_QUERY ); - } - + uno::Reference< uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext(); + InteractionHandler xHandler( com::sun::star::task::InteractionHandler::createDefault(xContext), UNO_QUERY_THROW ); return xHandler; } //------------------------------------------------------------------------------ diff --git a/desktop/source/app/dispatchwatcher.cxx b/desktop/source/app/dispatchwatcher.cxx index 1ed73d59f48f..091d48465205 100644 --- a/desktop/source/app/dispatchwatcher.cxx +++ b/desktop/source/app/dispatchwatcher.cxx @@ -41,7 +41,7 @@ #include #include #include -#include +#include #include #include #include @@ -73,6 +73,7 @@ using namespace ::com::sun::star::frame; using namespace ::com::sun::star::container; using namespace ::com::sun::star::beans; using namespace ::com::sun::star::view; +using namespace ::com::sun::star::task; namespace desktop { @@ -226,9 +227,9 @@ sal_Bool DispatchWatcher::executeDispatchRequests( const DispatchList& aDispatch } else { - Reference < com::sun::star::task::XInteractionHandler > xInteraction( - ::comphelper::getProcessServiceFactory()->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.task.InteractionHandler")) ), - com::sun::star::uno::UNO_QUERY ); + Reference < XInteractionHandler > xInteraction( + InteractionHandler::createDefault(::comphelper::getProcessComponentContext()), + UNO_QUERY_THROW ); aArgs[1].Name = OUString(RTL_CONSTASCII_USTRINGPARAM( "InteractionHandler" )); aArgs[1].Value <<= xInteraction; -- cgit