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 /sw/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 'sw/source')
-rw-r--r-- | sw/source/ui/dbui/addresslistdialog.cxx | 6 | ||||
-rw-r--r-- | sw/source/ui/dbui/dbmgr.cxx | 10 |
2 files changed, 8 insertions, 8 deletions
diff --git a/sw/source/ui/dbui/addresslistdialog.cxx b/sw/source/ui/dbui/addresslistdialog.cxx index 8a549263be4c..045436becc2c 100644 --- a/sw/source/ui/dbui/addresslistdialog.cxx +++ b/sw/source/ui/dbui/addresslistdialog.cxx @@ -53,6 +53,7 @@ #include <com/sun/star/sdb/XSingleSelectQueryComposer.hpp> #include <com/sun/star/sdbcx/XTablesSupplier.hpp> #include <com/sun/star/sdb/XQueriesSupplier.hpp> +#include <com/sun/star/task/InteractionHandler.hpp> #include <com/sun/star/ui/dialogs/XExecutableDialog.hpp> #include <com/sun/star/frame/XStorable.hpp> #include <swunohelper.hxx> @@ -559,9 +560,8 @@ void SwAddressListDialog::DetectTablesAndQueries( m_xDBContext->getByName(m_aDBData.sDataSource) >>= xComplConnection; pUserData->xSource = uno::Reference<XDataSource>(xComplConnection, UNO_QUERY); - uno::Reference< XMultiServiceFactory > xMgr( ::comphelper::getProcessServiceFactory() ); - uno::Reference< XInteractionHandler > xHandler( - xMgr->createInstance( C2U( "com.sun.star.task.InteractionHandler" )), UNO_QUERY); + uno::Reference< XComponentContext > xContext( ::comphelper::getProcessComponentContext() ); + uno::Reference< XInteractionHandler > xHandler( InteractionHandler::createDefault(xContext), UNO_QUERY ); pUserData->xConnection = SharedConnection( xComplConnection->connectWithCompletion( xHandler ) ); } if(pUserData->xConnection.is()) diff --git a/sw/source/ui/dbui/dbmgr.cxx b/sw/source/ui/dbui/dbmgr.cxx index f8824aea4db8..276639271d9c 100644 --- a/sw/source/ui/dbui/dbmgr.cxx +++ b/sw/source/ui/dbui/dbmgr.cxx @@ -44,6 +44,7 @@ #include <com/sun/star/container/XChild.hpp> #include <com/sun/star/text/MailMergeEvent.hpp> #include <com/sun/star/frame/XStorable.hpp> +#include <com/sun/star/task/InteractionHandler.hpp> #include <com/sun/star/ui/dialogs/TemplateDescription.hpp> #include <com/sun/star/ui/dialogs/XFilePicker.hpp> #include <com/sun/star/ui/dialogs/XFilterManager.hpp> @@ -101,6 +102,7 @@ #include <com/sun/star/sdbc/DataType.hpp> #include <com/sun/star/sdbc/ResultSetType.hpp> #include <com/sun/star/mail/MailAttachment.hpp> +#include <comphelper/componentcontext.hxx> #include <comphelper/processfactory.hxx> #include <comphelper/property.hxx> #include <comphelper/string.hxx> @@ -1571,7 +1573,6 @@ uno::Reference< sdbc::XConnection> SwNewDBMgr::GetConnection(const String& rData uno::Reference<XDataSource>& rxSource) { Reference< sdbc::XConnection> xConnection; - Reference< XMultiServiceFactory > xMgr( ::comphelper::getProcessServiceFactory() ); Reference< XComponentContext > xContext( ::comphelper::getProcessComponentContext() ); try { @@ -1579,9 +1580,8 @@ uno::Reference< sdbc::XConnection> SwNewDBMgr::GetConnection(const String& rData if ( xComplConnection.is() ) { rxSource.set(xComplConnection,UNO_QUERY); - Reference< XInteractionHandler > xHandler( - xMgr->createInstance( C2U( "com.sun.star.task.InteractionHandler" )), UNO_QUERY); - xConnection = xComplConnection->connectWithCompletion( xHandler ); + Reference< XInteractionHandler > xHandler( InteractionHandler::createDefault(xContext), UNO_QUERY_THROW ); + xConnection = xComplConnection->connectWithCompletion( xHandler ); } } catch(const Exception&) @@ -2661,7 +2661,7 @@ uno::Reference<XResultSet> SwNewDBMgr::createCursor(const ::rtl::OUString& _sDat if ( xRowSet.is() ) { - uno::Reference< XInteractionHandler > xHandler(xMgr->createInstance(C2U("com.sun.star.task.InteractionHandler")), UNO_QUERY); + uno::Reference< XInteractionHandler > xHandler( InteractionHandler::createDefault(comphelper::getComponentContext(xMgr)), UNO_QUERY_THROW ); xRowSet->executeWithCompletion(xHandler); } xResultSet = uno::Reference<XResultSet>(xRowSet, UNO_QUERY); |