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 /dbaccess/source/core | |
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 'dbaccess/source/core')
-rw-r--r-- | dbaccess/source/core/dataaccess/databasecontext.cxx | 3 | ||||
-rw-r--r-- | dbaccess/source/core/dataaccess/documentdefinition.cxx | 12 |
2 files changed, 7 insertions, 8 deletions
diff --git a/dbaccess/source/core/dataaccess/databasecontext.cxx b/dbaccess/source/core/dataaccess/databasecontext.cxx index 4ca37127c2ca..717661d57e46 100644 --- a/dbaccess/source/core/dataaccess/databasecontext.cxx +++ b/dbaccess/source/core/dataaccess/databasecontext.cxx @@ -44,6 +44,7 @@ #include <com/sun/star/task/InteractionClassification.hpp> #include <com/sun/star/ucb/InteractiveIOException.hpp> #include <com/sun/star/ucb/IOErrorCode.hpp> +#include <com/sun/star/task/InteractionHandler.hpp> #include <com/sun/star/util/XCloseable.hpp> #include <basic/basmgr.hxx> @@ -362,7 +363,7 @@ Reference< XInterface > ODatabaseContext::loadObjectFromURL(const ::rtl::OUStrin ::comphelper::NamedValueCollection aArgs; aArgs.put( "URL", _sURL ); aArgs.put( "MacroExecutionMode", MacroExecMode::USE_CONFIG ); - aArgs.put( "InteractionHandler", m_aContext.createComponent( "com.sun.star.task.InteractionHandler" ) ); + aArgs.put( "InteractionHandler", task::InteractionHandler::createDefault(m_aContext.getUNOContext()) ); Sequence< PropertyValue > aResource( aArgs.getPropertyValues() ); xLoad->load( aResource ); diff --git a/dbaccess/source/core/dataaccess/documentdefinition.cxx b/dbaccess/source/core/dataaccess/documentdefinition.cxx index 4593269de978..fd1ded798872 100644 --- a/dbaccess/source/core/dataaccess/documentdefinition.cxx +++ b/dbaccess/source/core/dataaccess/documentdefinition.cxx @@ -68,7 +68,7 @@ #include "intercept.hxx" #include <com/sun/star/sdb/ErrorCondition.hpp> #include <com/sun/star/sdb/XInteractionDocumentSave.hpp> -#include <com/sun/star/task/XInteractionHandler.hpp> +#include <com/sun/star/task/InteractionHandler.hpp> #include <com/sun/star/sdb/DocumentSaveRequest.hpp> #include <com/sun/star/document/XDocumentPropertiesSupplier.hpp> #include <com/sun/star/document/MacroExecMode.hpp> @@ -1301,9 +1301,8 @@ sal_Bool ODocumentDefinition::save(sal_Bool _bApprove) pRequest->addContinuation(pAbort); // create the handler, let it handle the request - Reference< XInteractionHandler > xHandler( m_aContext.createComponent( (::rtl::OUString)SERVICE_TASK_INTERACTION_HANDLER ), UNO_QUERY ); - if ( xHandler.is() ) - xHandler->handle(xRequest); + Reference< XInteractionHandler > xHandler( InteractionHandler::createDefault(m_aContext.getUNOContext()), UNO_QUERY_THROW ); + xHandler->handle(xRequest); if ( pAbort->wasSelected() ) return sal_False; @@ -1376,9 +1375,8 @@ sal_Bool ODocumentDefinition::saveAs() pRequest->addContinuation(pAbort); // create the handler, let it handle the request - Reference< XInteractionHandler > xHandler(m_aContext.createComponent(::rtl::OUString(SERVICE_TASK_INTERACTION_HANDLER)), UNO_QUERY); - if ( xHandler.is() ) - xHandler->handle(xRequest); + Reference< XInteractionHandler > xHandler( InteractionHandler::createDefault(m_aContext.getUNOContext()), UNO_QUERY_THROW); + xHandler->handle(xRequest); if ( pAbort->wasSelected() ) return sal_False; |