summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2012-10-02 15:03:12 +0200
committerStephan Bergmann <sbergman@redhat.com>2012-10-04 14:42:52 +0200
commitc25cb8a641723ab098980bb842caf75c0dc9b059 (patch)
treee264e2727309789e06147a7275b91abd05f9fcff /sw
parent0f3f9cb63056715845d9c3565bde69470c73efb2 (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')
-rw-r--r--sw/CppunitTest_sw_subsequent_odfexport.mk1
-rw-r--r--sw/CppunitTest_sw_subsequent_odfimport.mk1
-rw-r--r--sw/source/ui/dbui/addresslistdialog.cxx6
-rw-r--r--sw/source/ui/dbui/dbmgr.cxx10
4 files changed, 10 insertions, 8 deletions
diff --git a/sw/CppunitTest_sw_subsequent_odfexport.mk b/sw/CppunitTest_sw_subsequent_odfexport.mk
index 4ba12b90b0db..ed559ba069cd 100644
--- a/sw/CppunitTest_sw_subsequent_odfexport.mk
+++ b/sw/CppunitTest_sw_subsequent_odfexport.mk
@@ -84,6 +84,7 @@ $(eval $(call gb_CppunitTest_use_components,sw_subsequent_odfexport,\
ucb/source/ucp/file/ucpfile1 \
unotools/util/utl \
unoxml/source/service/unoxml \
+ uui/util/uui \
$(if $(filter DESKTOP,$(BUILD_TYPE)),xmlhelp/util/ucpchelp1) \
))
diff --git a/sw/CppunitTest_sw_subsequent_odfimport.mk b/sw/CppunitTest_sw_subsequent_odfimport.mk
index 9c9a1560d5ca..9cd82706f2cf 100644
--- a/sw/CppunitTest_sw_subsequent_odfimport.mk
+++ b/sw/CppunitTest_sw_subsequent_odfimport.mk
@@ -83,6 +83,7 @@ $(eval $(call gb_CppunitTest_use_components,sw_subsequent_odfimport,\
ucb/source/ucp/file/ucpfile1 \
unotools/util/utl \
unoxml/source/service/unoxml \
+ uui/util/uui \
$(if $(filter DESKTOP,$(BUILD_TYPE)),xmlhelp/util/ucpchelp1) \
))
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);