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
This commit is contained in:
Noel Grandin
2012-10-02 15:03:12 +02:00
committed by Stephan Bergmann
parent 0f3f9cb630
commit c25cb8a641
84 changed files with 370 additions and 435 deletions

View File

@@ -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);

View File

@@ -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() {}

View File

@@ -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 {

View File

@@ -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);