diff options
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 ); |