diff options
-rw-r--r-- | comphelper/inc/comphelper/seekableinput.hxx | 8 | ||||
-rw-r--r-- | comphelper/source/streaming/seekableinput.cxx | 14 | ||||
-rw-r--r-- | package/source/zippackage/ZipPackage.cxx | 2 | ||||
-rw-r--r-- | package/source/zippackage/ZipPackageStream.cxx | 4 | ||||
-rw-r--r-- | ucb/source/ucp/webdav-neon/DAVResourceAccess.cxx | 7 |
5 files changed, 18 insertions, 17 deletions
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 <osl/mutex.hxx> #include <com/sun/star/uno/Reference.hxx> -#include <com/sun/star/lang/XMultiServiceFactory.hpp> +#include <com/sun/star/uno/XComponentContext.hpp> #include <com/sun/star/io/XInputStream.hpp> #include <com/sun/star/io/XSeekable.hpp> #include <cppuhelper/implbase2.hxx> @@ -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 ); diff --git a/package/source/zippackage/ZipPackage.cxx b/package/source/zippackage/ZipPackage.cxx index 35484bc26571..b6b853d7bac2 100644 --- a/package/source/zippackage/ZipPackage.cxx +++ b/package/source/zippackage/ZipPackage.cxx @@ -730,7 +730,7 @@ void SAL_CALL ZipPackage::initialize( const uno::Sequence< Any >& aArguments ) if ( m_xContentStream.is() ) { // the stream must be seekable, if it is not it will be wrapped - m_xContentStream = ::comphelper::OSeekableInputWrapper::CheckSeekableCanWrap( m_xContentStream, m_xFactory ); + m_xContentStream = ::comphelper::OSeekableInputWrapper::CheckSeekableCanWrap( m_xContentStream, comphelper::getComponentContext( m_xFactory ) ); m_xContentSeek = uno::Reference < XSeekable > ( m_xContentStream, UNO_QUERY ); if ( ! m_xContentSeek.is() ) throw com::sun::star::uno::Exception (OSL_LOG_PREFIX "The package component _requires_ an XSeekable interface!", diff --git a/package/source/zippackage/ZipPackageStream.cxx b/package/source/zippackage/ZipPackageStream.cxx index 550486f9ad90..7352b8c3d3e0 100644 --- a/package/source/zippackage/ZipPackageStream.cxx +++ b/package/source/zippackage/ZipPackageStream.cxx @@ -144,7 +144,7 @@ uno::Reference< io::XInputStream > ZipPackageStream::GetOwnSeekStream() // The only exception is a nonseekable stream that is provided only for storing, if such a stream // is accessed before commit it MUST be wrapped. // Wrap the stream in case it is not seekable - xStream = ::comphelper::OSeekableInputWrapper::CheckSeekableCanWrap( xStream, m_xFactory ); + xStream = ::comphelper::OSeekableInputWrapper::CheckSeekableCanWrap( xStream, comphelper::getComponentContext( m_xFactory ) ); uno::Reference< io::XSeekable > xSeek( xStream, UNO_QUERY ); if ( !xSeek.is() ) throw RuntimeException( OSL_LOG_PREFIX "The stream must support XSeekable!", @@ -625,7 +625,7 @@ void SAL_CALL ZipPackageStream::setRawStream( const uno::Reference< io::XInputSt RuntimeException ) { // wrap the stream in case it is not seekable - uno::Reference< io::XInputStream > xNewStream = ::comphelper::OSeekableInputWrapper::CheckSeekableCanWrap( aStream, m_xFactory ); + uno::Reference< io::XInputStream > xNewStream = ::comphelper::OSeekableInputWrapper::CheckSeekableCanWrap( aStream, comphelper::getComponentContext( m_xFactory ) ); uno::Reference< io::XSeekable > xSeek( xNewStream, UNO_QUERY ); if ( !xSeek.is() ) throw RuntimeException(OSL_LOG_PREFIX "The stream must support XSeekable!", diff --git a/ucb/source/ucp/webdav-neon/DAVResourceAccess.cxx b/ucb/source/ucp/webdav-neon/DAVResourceAccess.cxx index 890f94ba03cf..b001e1444f2e 100644 --- a/ucb/source/ucp/webdav-neon/DAVResourceAccess.cxx +++ b/ucb/source/ucp/webdav-neon/DAVResourceAccess.cxx @@ -33,6 +33,7 @@ #include "com/sun/star/ucb/XWebDAVCommandEnvironment.hpp" #include "ucbhelper/simpleauthenticationrequest.hxx" +#include "comphelper/processfactory.hxx" #include "comphelper/seekableinput.hxx" #include "DAVAuthListenerImpl.hxx" @@ -597,7 +598,7 @@ void DAVResourceAccess::PUT( // Make stream seekable, if it not. Needed, if request must be retried. uno::Reference< io::XInputStream > xSeekableStream = comphelper::OSeekableInputWrapper::CheckSeekableCanWrap( - rStream, m_xSMgr ); + rStream, comphelper::getComponentContext(m_xSMgr) ); int errorCount = 0; bool bRetry = false; @@ -646,7 +647,7 @@ uno::Reference< io::XInputStream > DAVResourceAccess::POST( // Make stream seekable, if it not. Needed, if request must be retried. uno::Reference< io::XInputStream > xSeekableStream = comphelper::OSeekableInputWrapper::CheckSeekableCanWrap( - rInputStream, m_xSMgr ); + rInputStream, comphelper::getComponentContext(m_xSMgr) ); uno::Reference< io::XInputStream > xStream; int errorCount = 0; @@ -710,7 +711,7 @@ void DAVResourceAccess::POST( // Make stream seekable, if it not. Needed, if request must be retried. uno::Reference< io::XInputStream > xSeekableStream = comphelper::OSeekableInputWrapper::CheckSeekableCanWrap( - rInputStream, m_xSMgr ); + rInputStream, comphelper::getComponentContext(m_xSMgr) ); int errorCount = 0; bool bRetry = false; |