summaryrefslogtreecommitdiff
path: root/forms
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 /forms
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 'forms')
-rw-r--r--forms/source/xforms/submission/replace.cxx6
-rw-r--r--forms/source/xforms/submission/submission.hxx4
-rw-r--r--forms/source/xforms/submission/submission_get.cxx10
-rw-r--r--forms/source/xforms/submission/submission_get.hxx4
4 files changed, 12 insertions, 12 deletions
diff --git a/forms/source/xforms/submission/replace.cxx b/forms/source/xforms/submission/replace.cxx
index 9d487cc3c9e9..902ba9cffaf5 100644
--- a/forms/source/xforms/submission/replace.cxx
+++ b/forms/source/xforms/submission/replace.cxx
@@ -41,6 +41,7 @@
#include <com/sun/star/frame/XComponentLoader.hpp>
#include <com/sun/star/frame/FrameSearchFlag.hpp>
#include <com/sun/star/beans/PropertyValue.hpp>
+#include <com/sun/star/task/InteractionHandler.hpp>
#include <ucbhelper/content.hxx>
using namespace com::sun::star::uno;
@@ -129,9 +130,8 @@ SAL_WNODEPRECATED_DECLARATIONS_PUSH
if( _xHandler.is() )
pHelper->m_aInteractionHandler = _xHandler;
else
- pHelper->m_aInteractionHandler = CSS::uno::Reference< XInteractionHandler >(m_aFactory->createInstance(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.task.InteractionHandler") ) ), UNO_QUERY);
- OSL_ENSURE(pHelper->m_aInteractionHandler.is(), "failed to create IntreractionHandler");
+ pHelper->m_aInteractionHandler = CSS::uno::Reference< XInteractionHandler >(
+ InteractionHandler::createDefault(m_xContext), UNO_QUERY_THROW);
CProgressHandlerHelper *pProgressHelper = new CProgressHandlerHelper;
pHelper->m_aProgressHandler = Reference< XProgressHandler >(pProgressHelper);
diff --git a/forms/source/xforms/submission/submission.hxx b/forms/source/xforms/submission/submission.hxx
index 37e0e07d7a58..eb921bc74d98 100644
--- a/forms/source/xforms/submission/submission.hxx
+++ b/forms/source/xforms/submission/submission.hxx
@@ -123,7 +123,7 @@ protected:
CSS::uno::Reference< CSS::xml::xpath::XXPathObject > m_aXPathObject;
CSS::uno::Reference< CSS::xml::dom::XDocumentFragment > m_aFragment;
CSS::uno::Reference< CSS::io::XInputStream > m_aResultStream;
- CSS::uno::Reference< CSS::lang::XMultiServiceFactory > m_aFactory;
+ CSS::uno::Reference< CSS::uno::XComponentContext > m_xContext;
rtl::OUString m_aEncoding;
::std::auto_ptr< CSerialization > createSerialization(const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler >& aHandler
@@ -142,7 +142,7 @@ public:
CSubmission(const rtl::OUString& aURL, const CSS::uno::Reference< CSS::xml::dom::XDocumentFragment >& aFragment)
: m_aURLObj(aURL)
, m_aFragment(aFragment)
- , m_aFactory(::comphelper::getProcessServiceFactory())
+ , m_xContext(::comphelper::getProcessComponentContext())
{}
virtual ~CSubmission() {}
diff --git a/forms/source/xforms/submission/submission_get.cxx b/forms/source/xforms/submission/submission_get.cxx
index 9ae7b6803cc9..156972404302 100644
--- a/forms/source/xforms/submission/submission_get.cxx
+++ b/forms/source/xforms/submission/submission_get.cxx
@@ -39,6 +39,7 @@
#include <comphelper/processfactory.hxx>
#include <ucbhelper/content.hxx>
#include <com/sun/star/io/Pipe.hpp>
+#include <com/sun/star/task/InteractionHandler.hpp>
using namespace CSS::uno;
using namespace CSS::ucb;
@@ -72,9 +73,8 @@ CSubmission::SubmissionResult CSubmissionGet::submit(const CSS::uno::Reference<
if( aInteractionHandler.is() )
pHelper->m_aInteractionHandler = aInteractionHandler;
else
- pHelper->m_aInteractionHandler = CSS::uno::Reference< XInteractionHandler >(m_aFactory->createInstance(
- OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.task.InteractionHandler"))), UNO_QUERY);
- OSL_ENSURE(pHelper->m_aInteractionHandler.is(), "failed to create IntreractionHandler");
+ pHelper->m_aInteractionHandler = CSS::uno::Reference< XInteractionHandler >(
+ CSS::task::InteractionHandler::createDefault(m_xContext), UNO_QUERY_THROW);
CProgressHandlerHelper *pProgressHelper = new CProgressHandlerHelper;
pHelper->m_aProgressHandler = CSS::uno::Reference< XProgressHandler >(pProgressHelper);
@@ -98,8 +98,8 @@ CSubmission::SubmissionResult CSubmissionGet::submit(const CSS::uno::Reference<
aUTF8QueryURL.append(aQueryString.makeStringAndClear());
}
OUString aQueryURL = OStringToOUString(aUTF8QueryURL.makeStringAndClear(), RTL_TEXTENCODING_UTF8);
- ucbhelper::Content aContent(aQueryURL, aEnvironment, comphelper::getComponentContext(m_aFactory));
- CSS::uno::Reference< XOutputStream > aPipe( CSS::io::Pipe::create(comphelper::getComponentContext(m_aFactory)), UNO_QUERY_THROW );
+ ucbhelper::Content aContent(aQueryURL, aEnvironment, m_xContext);
+ CSS::uno::Reference< XOutputStream > aPipe( CSS::io::Pipe::create(m_xContext), UNO_QUERY_THROW );
aContent.openStream(aPipe);
// get reply
try {
diff --git a/forms/source/xforms/submission/submission_get.hxx b/forms/source/xforms/submission/submission_get.hxx
index fe7cde8ba984..2e5e6038edcb 100644
--- a/forms/source/xforms/submission/submission_get.hxx
+++ b/forms/source/xforms/submission/submission_get.hxx
@@ -20,14 +20,14 @@
#ifndef __SUBMISSION_GET_HXX
#define __SUBMISSION_GET_HXX
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
#include "submission.hxx"
class CSubmissionGet : public CSubmission
{
private:
- CSS::uno::Reference< CSS::lang::XMultiServiceFactory > m_aFactory;
+ CSS::uno::Reference< CSS::uno::XComponentContext > m_xContext;
public:
CSubmissionGet(const rtl::OUString& aURL, const CSS::uno::Reference< CSS::xml::dom::XDocumentFragment >& aFragment);
virtual SubmissionResult submit(const CSS::uno::Reference< CSS::task::XInteractionHandler >& aInteractionHandler);