From 4970e292fb44f482e84822fa97188bcbdfce2ed4 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 16 Oct 2012 14:44:28 +0200 Subject: fdo#46808, convert comphelper::ConfigurationHelper to XComponentContext Convert the helper methods to take an XComponentContext parameter, instead of XMultiServiceFactory Change-Id: Id662d674c6d3c4ddfd35be5fc2e802b73bc6de90 --- comphelper/inc/comphelper/seekableinput.hxx | 8 ++++---- comphelper/source/streaming/seekableinput.cxx | 14 +++++++------- 2 files changed, 11 insertions(+), 11 deletions(-) (limited to 'comphelper') diff --git a/comphelper/inc/comphelper/seekableinput.hxx b/comphelper/inc/comphelper/seekableinput.hxx index 4f12db1cda8d..02c4997a2cb6 100644 --- a/comphelper/inc/comphelper/seekableinput.hxx +++ b/comphelper/inc/comphelper/seekableinput.hxx @@ -21,7 +21,7 @@ #include #include -#include +#include #include #include #include @@ -35,7 +35,7 @@ class COMPHELPER_DLLPUBLIC OSeekableInputWrapper : public ::cppu::WeakImplHelper { ::osl::Mutex m_aMutex; - ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xFactory; + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext; ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > m_xOriginalStream; @@ -48,13 +48,13 @@ private: public: OSeekableInputWrapper( const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& xInStream, - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xFactory ); + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext ); virtual ~OSeekableInputWrapper(); static ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > CheckSeekableCanWrap( const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& xInStream, - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xFactory ); + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext ); // XInputStream virtual sal_Int32 SAL_CALL readBytes( ::com::sun::star::uno::Sequence< sal_Int8 >& aData, sal_Int32 nBytesToRead ) throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); diff --git a/comphelper/source/streaming/seekableinput.cxx b/comphelper/source/streaming/seekableinput.cxx index 795b3b73a4a4..fdd62f3cfe34 100644 --- a/comphelper/source/streaming/seekableinput.cxx +++ b/comphelper/source/streaming/seekableinput.cxx @@ -55,11 +55,11 @@ void copyInputToOutput_Impl( const uno::Reference< io::XInputStream >& xIn, //--------------------------------------------------------------------------- OSeekableInputWrapper::OSeekableInputWrapper( const uno::Reference< io::XInputStream >& xInStream, - const uno::Reference< lang::XMultiServiceFactory >& xFactory ) -: m_xFactory( xFactory ) + const uno::Reference< uno::XComponentContext >& rxContext ) +: m_xContext( rxContext ) , m_xOriginalStream( xInStream ) { - if ( !m_xFactory.is() ) + if ( !m_xContext.is() ) throw uno::RuntimeException(); } @@ -71,7 +71,7 @@ OSeekableInputWrapper::~OSeekableInputWrapper() //--------------------------------------------------------------------------- uno::Reference< io::XInputStream > OSeekableInputWrapper::CheckSeekableCanWrap( const uno::Reference< io::XInputStream >& xInStream, - const uno::Reference< lang::XMultiServiceFactory >& xFactory ) + const uno::Reference< uno::XComponentContext >& rxContext ) { // check that the stream is seekable and just wrap it if it is not uno::Reference< io::XSeekable > xSeek( xInStream, uno::UNO_QUERY ); @@ -80,7 +80,7 @@ uno::Reference< io::XInputStream > OSeekableInputWrapper::CheckSeekableCanWrap( uno::Reference< io::XInputStream > xNewStream( static_cast< io::XInputStream* >( - new OSeekableInputWrapper( xInStream, xFactory ) ) ); + new OSeekableInputWrapper( xInStream, rxContext ) ) ); return xNewStream; } @@ -89,11 +89,11 @@ void OSeekableInputWrapper::PrepareCopy_Impl() { if ( !m_xCopyInput.is() ) { - if ( !m_xFactory.is() ) + if ( !m_xContext.is() ) throw uno::RuntimeException(); uno::Reference< io::XOutputStream > xTempOut( - io::TempFile::create(comphelper::getComponentContext(m_xFactory)), + io::TempFile::create(m_xContext), uno::UNO_QUERY_THROW ); copyInputToOutput_Impl( m_xOriginalStream, xTempOut ); -- cgit