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 /fpicker/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 'fpicker/source')
-rw-r--r-- | fpicker/source/office/fpsmartcontent.cxx | 9 | ||||
-rw-r--r-- | fpicker/source/office/iodlg.cxx | 11 |
2 files changed, 9 insertions, 11 deletions
diff --git a/fpicker/source/office/fpsmartcontent.cxx b/fpicker/source/office/fpsmartcontent.cxx index 5de4395ed362..98cbd32ae464 100644 --- a/fpicker/source/office/fpsmartcontent.cxx +++ b/fpicker/source/office/fpsmartcontent.cxx @@ -20,6 +20,7 @@ #include "fpsmartcontent.hxx" #include <com/sun/star/container/XChild.hpp> +#include <com/sun/star/task/InteractionHandler.hpp> #include <com/sun/star/ucb/ContentInfo.hpp> #include <com/sun/star/ucb/ContentInfoAttribute.hpp> #include <com/sun/star/ucb/XContent.hpp> @@ -79,9 +80,9 @@ namespace svt //-------------------------------------------------------------------- void SmartContent::enableOwnInteractionHandler(::svt::OFilePickerInteractionHandler::EInterceptedInteractions eInterceptions) { - Reference< XMultiServiceFactory > xFactory = ::comphelper::getProcessServiceFactory(); + Reference< XComponentContext > xContext = ::comphelper::getProcessComponentContext(); Reference< XInteractionHandler > xGlobalInteractionHandler = Reference< XInteractionHandler >( - xFactory->createInstance( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.task.InteractionHandler") ) ), UNO_QUERY ); + InteractionHandler::createDefault(xContext), UNO_QUERY_THROW ); m_pOwnInteraction = new ::svt::OFilePickerInteractionHandler(xGlobalInteractionHandler); m_pOwnInteraction->enableInterceptions(eInterceptions); @@ -98,9 +99,9 @@ namespace svt m_pOwnInteraction = NULL; m_xOwnInteraction = Reference< XInteractionHandler >(); - Reference< XMultiServiceFactory > xFactory = ::comphelper::getProcessServiceFactory(); + Reference< XComponentContext > xContext = ::comphelper::getProcessComponentContext(); Reference< XInteractionHandler > xGlobalInteractionHandler = Reference< XInteractionHandler >( - xFactory->createInstance( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.task.InteractionHandler") ) ), UNO_QUERY ); + InteractionHandler::createDefault(xContext), UNO_QUERY_THROW ); m_xCmdEnv = new ucbhelper::CommandEnvironment( xGlobalInteractionHandler, Reference< XProgressHandler >() ); } diff --git a/fpicker/source/office/iodlg.cxx b/fpicker/source/office/iodlg.cxx index 46e2b708f506..264e673b883d 100644 --- a/fpicker/source/office/iodlg.cxx +++ b/fpicker/source/office/iodlg.cxx @@ -72,7 +72,7 @@ #include <osl/file.h> #include <vcl/waitobj.hxx> -#include <com/sun/star/task/XInteractionHandler.hpp> +#include <com/sun/star/task/InteractionHandler.hpp> #include "com/sun/star/ucb/InteractiveAugmentedIOException.hpp" #include "fpinteraction.hxx" #include <osl/process.h> @@ -2001,13 +2001,10 @@ void SvtFileDialog::displayIOException( const String& _rURL, IOErrorCode _eCode pRequest->addContinuation( new ::comphelper::OInteractionAbort( ) ); Reference< XInteractionHandler > xHandler( - ::comphelper::getProcessServiceFactory()->createInstance( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.task.InteractionHandler") ) - ), - UNO_QUERY + InteractionHandler::createDefault( ::comphelper::getProcessComponentContext() ), + UNO_QUERY_THROW ); - if ( xHandler.is() ) - xHandler->handle( xRequest ); + xHandler->handle( xRequest ); } catch( const Exception& ) { |