diff options
author | Noel Grandin <noel@peralex.com> | 2013-06-04 16:08:54 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2013-06-05 08:13:23 +0200 |
commit | 546fa9f365ef1b19abe6739d2f42389f82576437 (patch) | |
tree | 3d12482a228e71df0deebeab032212bb1d944484 /svl/source/fsstor | |
parent | 8c799984cc5b76c20baccffea818e07c440c2330 (diff) |
fdo#46808, Convert XMultiServiceFactory in svl module
Change-Id: Ia51d748af3b29a6021e6f5307a60d87f17917f24
Diffstat (limited to 'svl/source/fsstor')
-rw-r--r-- | svl/source/fsstor/fsfactory.cxx | 6 | ||||
-rw-r--r-- | svl/source/fsstor/fsstorage.cxx | 28 | ||||
-rw-r--r-- | svl/source/fsstor/fsstorage.hxx | 2 |
3 files changed, 16 insertions, 20 deletions
diff --git a/svl/source/fsstor/fsfactory.cxx b/svl/source/fsstor/fsfactory.cxx index 06ca47b721a0..2379cf1858f3 100644 --- a/svl/source/fsstor/fsfactory.cxx +++ b/svl/source/fsstor/fsfactory.cxx @@ -55,7 +55,7 @@ OUString SAL_CALL FSStorageFactory::impl_staticGetImplementationName() uno::Reference< uno::XInterface > SAL_CALL FSStorageFactory::impl_staticCreateSelfInstance( const uno::Reference< lang::XMultiServiceFactory >& xServiceManager ) { - return uno::Reference< uno::XInterface >( *new FSStorageFactory( xServiceManager ) ); + return uno::Reference< uno::XInterface >( *new FSStorageFactory( comphelper::getComponentContext(xServiceManager) ) ); } //------------------------------------------------------------------------- @@ -78,7 +78,7 @@ uno::Reference< uno::XInterface > SAL_CALL FSStorageFactory::createInstance() static_cast< OWeakObject* >( new FSStorage( aResultContent, embed::ElementModes::READWRITE, - m_xFactory ) ), + m_xContext ) ), uno::UNO_QUERY ); } @@ -160,7 +160,7 @@ uno::Reference< uno::XInterface > SAL_CALL FSStorageFactory::createInstanceWithA return uno::Reference< uno::XInterface >( static_cast< OWeakObject* >( new FSStorage( aResultContent, nStorageMode, - m_xFactory ) ), + m_xContext ) ), uno::UNO_QUERY ); } diff --git a/svl/source/fsstor/fsstorage.cxx b/svl/source/fsstor/fsstorage.cxx index 41bf495b4195..bb8c6c86c5a1 100644 --- a/svl/source/fsstor/fsstorage.cxx +++ b/svl/source/fsstor/fsstorage.cxx @@ -96,27 +96,27 @@ struct FSStorage_Impl ::cppu::OInterfaceContainerHelper* m_pListenersContainer; // list of listeners ::cppu::OTypeCollection* m_pTypeCollection; - uno::Reference< lang::XMultiServiceFactory > m_xFactory; + uno::Reference< uno::XComponentContext > m_xContext; - FSStorage_Impl( const OUString& aURL, sal_Int32 nMode, uno::Reference< lang::XMultiServiceFactory > xFactory ) + FSStorage_Impl( const OUString& aURL, sal_Int32 nMode, uno::Reference< uno::XComponentContext > xContext ) : m_aURL( aURL ) , m_pContent( NULL ) , m_nMode( nMode ) , m_pListenersContainer( NULL ) , m_pTypeCollection( NULL ) - , m_xFactory( xFactory ) + , m_xContext( xContext ) { OSL_ENSURE( !m_aURL.isEmpty(), "The URL must not be empty" ); } - FSStorage_Impl( const ::ucbhelper::Content& aContent, sal_Int32 nMode, uno::Reference< lang::XMultiServiceFactory > xFactory ) + FSStorage_Impl( const ::ucbhelper::Content& aContent, sal_Int32 nMode, uno::Reference< uno::XComponentContext > xContext ) : m_aURL( aContent.getURL() ) , m_pContent( new ::ucbhelper::Content( aContent ) ) , m_nMode( nMode ) , m_pListenersContainer( NULL ) , m_pTypeCollection( NULL ) - , m_xFactory( xFactory ) + , m_xContext( xContext ) { OSL_ENSURE( !m_aURL.isEmpty(), "The URL must not be empty" ); } @@ -143,11 +143,11 @@ FSStorage_Impl::~FSStorage_Impl() //----------------------------------------------- FSStorage::FSStorage( const ::ucbhelper::Content& aContent, sal_Int32 nMode, - uno::Reference< lang::XMultiServiceFactory > xFactory ) -: m_pImpl( new FSStorage_Impl( aContent, nMode, xFactory ) ) + uno::Reference< uno::XComponentContext > xContext ) +: m_pImpl( new FSStorage_Impl( aContent, nMode, xContext ) ) { // TODO: use properties - if ( !xFactory.is() ) + if ( !xContext.is() ) throw uno::RuntimeException(); GetContent(); @@ -473,8 +473,7 @@ uno::Reference< io::XStream > SAL_CALL FSStorage::openStreamElement( if ( isLocalFile_Impl( aFileURL.GetMainURL( INetURLObject::NO_DECODE ) ) ) { uno::Reference<ucb::XSimpleFileAccess3> xSimpleFileAccess( - ucb::SimpleFileAccess::create( - comphelper::getComponentContext(m_pImpl->m_xFactory) ) ); + ucb::SimpleFileAccess::create( m_pImpl->m_xContext ) ); xResult = xSimpleFileAccess->openFileReadWrite( aFileURL.GetMainURL( INetURLObject::NO_DECODE ) ); } else @@ -620,7 +619,7 @@ uno::Reference< embed::XStorage > SAL_CALL FSStorage::openStorageElement( xResult = uno::Reference< embed::XStorage >( static_cast< OWeakObject* >( new FSStorage( aResultContent, nStorageMode, - m_pImpl->m_xFactory ) ), + m_pImpl->m_xContext ) ), uno::UNO_QUERY ); } catch( embed::InvalidStorageException& ) @@ -682,9 +681,7 @@ uno::Reference< io::XStream > SAL_CALL FSStorage::cloneStreamElement( const OUSt ::ucbhelper::Content aResultContent( aFileURL.GetMainURL( INetURLObject::NO_DECODE ), xDummyEnv, comphelper::getProcessComponentContext() ); uno::Reference< io::XInputStream > xInStream = aResultContent.openStream(); - xTempResult = uno::Reference < io::XStream >( - io::TempFile::create(comphelper::getComponentContext(m_pImpl->m_xFactory)), - uno::UNO_QUERY_THROW ); + xTempResult = io::TempFile::create(m_pImpl->m_xContext); uno::Reference < io::XOutputStream > xTempOut = xTempResult->getOutputStream(); uno::Reference < io::XInputStream > xTempIn = xTempResult->getInputStream(); @@ -1463,8 +1460,7 @@ uno::Reference< embed::XExtendedStorageStream > SAL_CALL FSStorage::openStreamEl if ( isLocalFile_Impl( aFileURL.GetMainURL( INetURLObject::NO_DECODE ) ) ) { uno::Reference<ucb::XSimpleFileAccess3> xSimpleFileAccess( - ucb::SimpleFileAccess::create( - comphelper::getComponentContext(m_pImpl->m_xFactory) ) ); + ucb::SimpleFileAccess::create( m_pImpl->m_xContext ) ); uno::Reference< io::XStream > xStream = xSimpleFileAccess->openFileReadWrite( aFileURL.GetMainURL( INetURLObject::NO_DECODE ) ); diff --git a/svl/source/fsstor/fsstorage.hxx b/svl/source/fsstor/fsstorage.hxx index 71dcf676e5d6..ef4a1f681de0 100644 --- a/svl/source/fsstor/fsstorage.hxx +++ b/svl/source/fsstor/fsstorage.hxx @@ -51,7 +51,7 @@ public: FSStorage( const ::ucbhelper::Content& aContent, sal_Int32 nMode, - ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xFactory ); + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > xContext ); virtual ~FSStorage(); |