summaryrefslogtreecommitdiff
path: root/comphelper
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2012-10-16 14:44:28 +0200
committerStephan Bergmann <sbergman@redhat.com>2012-10-24 16:49:49 +0200
commit4970e292fb44f482e84822fa97188bcbdfce2ed4 (patch)
tree4e956e261703083b48f68d7ae7c36900bf5ae750 /comphelper
parent4cc5ccef4bccc779f6286ac369b00dfd42ca9cdb (diff)
fdo#46808, convert comphelper::ConfigurationHelper to XComponentContext
Convert the helper methods to take an XComponentContext parameter, instead of XMultiServiceFactory Change-Id: Id662d674c6d3c4ddfd35be5fc2e802b73bc6de90
Diffstat (limited to 'comphelper')
-rw-r--r--comphelper/inc/comphelper/seekableinput.hxx8
-rw-r--r--comphelper/source/streaming/seekableinput.cxx14
2 files changed, 11 insertions, 11 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 );