diff options
author | Noel Grandin <noel@peralex.com> | 2012-10-02 15:03:12 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2012-10-04 14:42:52 +0200 |
commit | c25cb8a641723ab098980bb842caf75c0dc9b059 (patch) | |
tree | e264e2727309789e06147a7275b91abd05f9fcff /cui/source | |
parent | 0f3f9cb63056715845d9c3565bde69470c73efb2 (diff) |
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
Diffstat (limited to 'cui/source')
-rw-r--r-- | cui/source/dialogs/insdlg.cxx | 25 | ||||
-rw-r--r-- | cui/source/options/webconninfo.cxx | 10 |
2 files changed, 11 insertions, 24 deletions
diff --git a/cui/source/dialogs/insdlg.cxx b/cui/source/dialogs/insdlg.cxx index f0158b61ec1d..95b2eb13f0d5 100644 --- a/cui/source/dialogs/insdlg.cxx +++ b/cui/source/dialogs/insdlg.cxx @@ -38,7 +38,7 @@ #include <com/sun/star/beans/PropertyValue.hpp> #include <com/sun/star/embed/XInsertObjectDialog.hpp> #include <com/sun/star/ucb/CommandAbortedException.hpp> -#include <com/sun/star/task/XInteractionHandler.hpp> +#include <com/sun/star/task/InteractionHandler.hpp> #include "insdlg.hxx" #include <dialmgr.hxx> @@ -341,24 +341,13 @@ short SvInsertOleDlg::Execute() aMedium[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "URL" ) ); aMedium[0].Value <<= ::rtl::OUString( aFileName ); - uno::Reference< task::XInteractionHandler > xInteraction; - uno::Reference< lang::XMultiServiceFactory > xFactory = ::comphelper::getProcessServiceFactory(); - if ( xFactory.is() ) - xInteraction = uno::Reference< task::XInteractionHandler >( - xFactory->createInstance( - DEFINE_CONST_UNICODE("com.sun.star.task.InteractionHandler") ), - uno::UNO_QUERY_THROW ); + uno::Reference< uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext(); + uno::Reference< task::XInteractionHandler > xInteraction( + task::InteractionHandler::createDefault(xContext), + uno::UNO_QUERY_THROW ); - if ( xInteraction.is() ) - { - aMedium[1].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "InteractionHandler" ) ); - aMedium[1].Value <<= xInteraction; - } - else - { - OSL_FAIL( "Can not get InteractionHandler!\n" ); - aMedium.realloc( 1 ); - } + aMedium[1].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "InteractionHandler" ) ); + aMedium[1].Value <<= xInteraction; // create object from media descriptor if ( bLink ) diff --git a/cui/source/options/webconninfo.cxx b/cui/source/options/webconninfo.cxx index 0bfdd2527cbf..5b4ca5fcb09f 100644 --- a/cui/source/options/webconninfo.cxx +++ b/cui/source/options/webconninfo.cxx @@ -29,6 +29,7 @@ #include <dialmgr.hxx> #include <cuires.hrc> #include <sal/macros.h> +#include <com/sun/star/task/InteractionHandler.hpp> #include <com/sun/star/task/PasswordContainer.hpp> #include <com/sun/star/task/UrlRecord.hpp> #include <com/sun/star/task/XPasswordContainer2.hpp> @@ -187,9 +188,8 @@ void WebConnectionInfoDialog::FillPasswordList() if ( xMasterPasswd->isPersistentStoringAllowed() ) { uno::Reference< task::XInteractionHandler > xInteractionHandler( - comphelper::getProcessServiceFactory()->createInstance( - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.task.InteractionHandler" ) ) ), - uno::UNO_QUERY_THROW ); + task::InteractionHandler::createDefault(comphelper::getProcessComponentContext()), + uno::UNO_QUERY_THROW); uno::Sequence< task::UrlRecord > aURLEntries = xMasterPasswd->getAllPersistent( xInteractionHandler ); sal_Int32 nCount = 0; @@ -297,9 +297,7 @@ IMPL_LINK_NOARG(WebConnectionInfoDialog, ChangePasswordHdl) uno::Reference< task::XInteractionRequest > rRequest( pPasswordRequest ); uno::Reference< task::XInteractionHandler > xInteractionHandler( - comphelper::getProcessServiceFactory()->createInstance( - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( - "com.sun.star.task.InteractionHandler" ) ) ), + task::InteractionHandler::createDefault(comphelper::getProcessComponentContext()), uno::UNO_QUERY_THROW ); xInteractionHandler->handle( rRequest ); |