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 /svtools | |
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 'svtools')
-rw-r--r-- | svtools/source/contnr/fileview.cxx | 12 | ||||
-rw-r--r-- | svtools/source/contnr/templwin.cxx | 10 | ||||
-rw-r--r-- | svtools/source/dialogs/ServerDetailsControls.cxx | 6 | ||||
-rw-r--r-- | svtools/source/dialogs/addresstemplate.cxx | 8 |
4 files changed, 21 insertions, 15 deletions
diff --git a/svtools/source/contnr/fileview.cxx b/svtools/source/contnr/fileview.cxx index a390c458fd40..dc182678dd05 100644 --- a/svtools/source/contnr/fileview.cxx +++ b/svtools/source/contnr/fileview.cxx @@ -40,7 +40,7 @@ #include <svtools/AccessibleBrowseBoxObjType.hxx> #include <com/sun/star/util/DateTime.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> -#include <com/sun/star/task/XInteractionHandler.hpp> +#include <com/sun/star/task/InteractionHandler.hpp> #include <com/sun/star/ucb/XProgressHandler.hpp> #include <com/sun/star/sdbc/XResultSet.hpp> #include <com/sun/star/ucb/XAnyCompareFactory.hpp> @@ -698,9 +698,9 @@ ViewTabListBox_Impl::ViewTabListBox_Impl( Window* pParentWin, maResetQuickSearch.SetTimeout( QUICK_SEARCH_TIMEOUT ); maResetQuickSearch.SetTimeoutHdl( LINK( this, ViewTabListBox_Impl, ResetQuickSearch_Impl ) ); - Reference< XMultiServiceFactory > xFactory = ::comphelper::getProcessServiceFactory(); + Reference< XComponentContext > xContext = ::comphelper::getProcessComponentContext(); Reference< XInteractionHandler > xInteractionHandler = Reference< XInteractionHandler > ( - xFactory->createInstance( OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.uui.InteractionHandler") ) ), UNO_QUERY ); + InteractionHandler::createDefault(xContext), UNO_QUERY_THROW ); mxCmdEnv = new ::ucbhelper::CommandEnvironment( xInteractionHandler, Reference< XProgressHandler >() ); @@ -1160,8 +1160,9 @@ SvtFileView::SvtFileView( Window* pParent, const ResId& rResId, if ( bMultiSelection ) nFlags |= FILEVIEW_MULTISELECTION; + Reference< XComponentContext > xContext = ::comphelper::getProcessComponentContext(); Reference< XInteractionHandler > xInteractionHandler = Reference< XInteractionHandler > ( - ::comphelper::getProcessServiceFactory()->createInstance( OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.uui.InteractionHandler") ) ), UNO_QUERY ); + InteractionHandler::createDefault(xContext), UNO_QUERY_THROW ); Reference < XCommandEnvironment > xCmdEnv = new ::ucbhelper::CommandEnvironment( xInteractionHandler, Reference< XProgressHandler >() ); mpImp = new SvtFileView_Impl( this, xCmdEnv, nFlags, bOnlyFolder ); @@ -1177,8 +1178,9 @@ SvtFileView::SvtFileView( Window* pParent, const ResId& rResId, sal_uInt8 nFlags Control( pParent, rResId ) { + Reference< XComponentContext > xContext = ::comphelper::getProcessComponentContext(); Reference< XInteractionHandler > xInteractionHandler = Reference< XInteractionHandler > ( - ::comphelper::getProcessServiceFactory()->createInstance( OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.uui.InteractionHandler") ) ), UNO_QUERY ); + InteractionHandler::createDefault(xContext), UNO_QUERY_THROW ); Reference < XCommandEnvironment > xCmdEnv = new ::ucbhelper::CommandEnvironment( xInteractionHandler, Reference< XProgressHandler >() ); mpImp = new SvtFileView_Impl( this, xCmdEnv, nFlags, nFlags & FILEVIEW_ONLYFOLDER ); diff --git a/svtools/source/contnr/templwin.cxx b/svtools/source/contnr/templwin.cxx index 9a77b770a851..9579759419b3 100644 --- a/svtools/source/contnr/templwin.cxx +++ b/svtools/source/contnr/templwin.cxx @@ -71,6 +71,7 @@ #include <com/sun/star/script/XTypeConverter.hpp> #include <com/sun/star/system/SystemShellExecute.hpp> #include <com/sun/star/system/SystemShellExecuteFlags.hpp> +#include <com/sun/star/task/InteractionHandler.hpp> #include <unotools/localedatawrapper.hxx> #include <com/sun/star/container/XNameContainer.hpp> #include <vcl/waitobj.hxx> @@ -669,8 +670,9 @@ void SvtFrameWindow_Impl::ShowDocInfo( const String& rURL ) { try { - uno::Reference < task::XInteractionHandler > xInteractionHandler( ::comphelper::getProcessServiceFactory()->createInstance( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.task.InteractionHandler" )) ), uno::UNO_QUERY ); + uno::Reference < task::XInteractionHandler > xInteractionHandler( + task::InteractionHandler::createDefault(::comphelper::getProcessComponentContext()), + uno::UNO_QUERY_THROW ); uno::Sequence < beans::PropertyValue> aProps(1); aProps[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "InteractionHandler" )); aProps[0].Value <<= xInteractionHandler; @@ -752,8 +754,8 @@ void SvtFrameWindow_Impl::OpenFile( const String& rURL, sal_Bool bPreview, sal_B aArgs[1].Value.setValue( &b, ::getBooleanCppuType() ); aArgs[2].Name = ASCII_STR("AsTemplate"); // prevents getting an empty URL with getURL()! - uno::Reference < task::XInteractionHandler > xInteractionHandler( ::comphelper::getProcessServiceFactory()->createInstance( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.task.InteractionHandler" )) ), uno::UNO_QUERY ); + uno::Reference < task::XInteractionHandler > xInteractionHandler( + task::InteractionHandler::createDefault(::comphelper::getProcessComponentContext()), uno::UNO_QUERY_THROW ); aArgs[3].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "InteractionHandler" )); aArgs[3].Value <<= xInteractionHandler; diff --git a/svtools/source/dialogs/ServerDetailsControls.cxx b/svtools/source/dialogs/ServerDetailsControls.cxx index e93be567293b..3417d5531606 100644 --- a/svtools/source/dialogs/ServerDetailsControls.cxx +++ b/svtools/source/dialogs/ServerDetailsControls.cxx @@ -27,7 +27,7 @@ */ #include <com/sun/star/lang/XMultiServiceFactory.hpp> -#include <com/sun/star/task/XInteractionHandler.hpp> +#include <com/sun/star/task/InteractionHandler.hpp> #include <com/sun/star/ucb/XCommandEnvironment.hpp> #include <com/sun/star/ucb/XContentAccess.hpp> #include <com/sun/star/sdbc/XResultSet.hpp> @@ -292,9 +292,9 @@ CmisDetailsContainer::CmisDetailsContainer( ) : m_sUsername( ), m_xCmdEnv( ) { - 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 ); m_xCmdEnv = new ucbhelper::CommandEnvironment( xGlobalInteractionHandler, Reference< XProgressHandler >() ); } diff --git a/svtools/source/dialogs/addresstemplate.cxx b/svtools/source/dialogs/addresstemplate.cxx index 49f7ca5204ba..a59b378746a4 100644 --- a/svtools/source/dialogs/addresstemplate.cxx +++ b/svtools/source/dialogs/addresstemplate.cxx @@ -52,7 +52,7 @@ #include <com/sun/star/sdb/SQLContext.hpp> #include <com/sun/star/sdbc/SQLWarning.hpp> #include <com/sun/star/sdbc/XConnection.hpp> -#include <com/sun/star/task/XInteractionHandler.hpp> +#include <com/sun/star/task/InteractionHandler.hpp> #include <com/sun/star/sdbcx/XTablesSupplier.hpp> #include <com/sun/star/sdbcx/XColumnsSupplier.hpp> #include <com/sun/star/sdb/CommandType.hpp> @@ -847,15 +847,17 @@ void AssignmentPersistentData::Commit() m_aDatasource.SaveValue(); // create an interaction handler (may be needed for connecting) - const rtl::OUString sInteractionHandlerServiceName("com.sun.star.task.InteractionHandler"); Reference< XInteractionHandler > xHandler; try { - xHandler = Reference< XInteractionHandler >(m_xORB->createInstance(sInteractionHandlerServiceName), UNO_QUERY); + xHandler = Reference< XInteractionHandler >( + InteractionHandler::createDefault(comphelper::getComponentContext(m_xORB)), + UNO_QUERY_THROW ); } catch(Exception&) { } if (!xHandler.is()) { + const rtl::OUString sInteractionHandlerServiceName("com.sun.star.task.InteractionHandler"); ShowServiceNotAvailableError(this, sInteractionHandlerServiceName, sal_True); return; } |