summaryrefslogtreecommitdiff
path: root/ucb
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2012-11-27 11:00:51 +0200
committerStephan Bergmann <sbergman@redhat.com>2012-11-28 13:06:18 +0100
commit7470cc532fe408dc9d8735cde0e2eb5bb62fd69c (patch)
tree3815c10cbd2473a19915d8057ca1eb19046592bc /ucb
parent56ea15091c69d280310aa8b28bb1e9488eaad756 (diff)
fdo#46808, Adapt reflection::ProxyFactory UNO service to new style
The service is deprecated, but we still have a handful of in-tree users, and converting it lets me thread XComponentContext through a bunch of classes. Change-Id: Iffdfe537ada6b9e4a89f9b3c8dd82ca85f4bfaba
Diffstat (limited to 'ucb')
-rw-r--r--ucb/source/ucp/tdoc/tdoc_stgelems.cxx44
-rw-r--r--ucb/source/ucp/tdoc/tdoc_stgelems.hxx6
-rw-r--r--ucb/source/ucp/tdoc/tdoc_storage.cxx9
3 files changed, 21 insertions, 38 deletions
diff --git a/ucb/source/ucp/tdoc/tdoc_stgelems.cxx b/ucb/source/ucp/tdoc/tdoc_stgelems.cxx
index 8d24314ab437..ea6d12d1ac5d 100644
--- a/ucb/source/ucp/tdoc/tdoc_stgelems.cxx
+++ b/ucb/source/ucp/tdoc/tdoc_stgelems.cxx
@@ -27,7 +27,7 @@
*************************************************************************/
#include "com/sun/star/lang/DisposedException.hpp"
-#include "com/sun/star/reflection/XProxyFactory.hpp"
+#include "com/sun/star/reflection/ProxyFactory.hpp"
#include "tdoc_uri.hxx"
@@ -63,7 +63,7 @@ ParentStorageHolder::ParentStorageHolder(
//=========================================================================
//=========================================================================
-Storage::Storage( const uno::Reference< lang::XMultiServiceFactory > & xSMgr,
+Storage::Storage( const uno::Reference< uno::XComponentContext > & rxContext,
const rtl::Reference< StorageElementFactory > & xFactory,
const rtl::OUString & rUri,
const uno::Reference< embed::XStorage > & xParentStorage,
@@ -88,15 +88,9 @@ Storage::Storage( const uno::Reference< lang::XMultiServiceFactory > & xSMgr,
// Use proxy factory service to create aggregatable proxy.
try
{
- uno::Reference< reflection::XProxyFactory > xProxyFac(
- xSMgr->createInstance(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.reflection.ProxyFactory" ) ) ),
- uno::UNO_QUERY );
- if ( xProxyFac.is() )
- {
- m_xAggProxy = xProxyFac->createProxy( m_xWrappedStorage );
- }
+ uno::Reference< reflection::XProxyFactory > xProxyFac =
+ reflection::ProxyFactory::create( rxContext );
+ m_xAggProxy = xProxyFac->createProxy( m_xWrappedStorage );
}
catch ( uno::Exception const & )
{
@@ -576,7 +570,7 @@ void SAL_CALL Storage::revert()
//=========================================================================
OutputStream::OutputStream(
- const uno::Reference< lang::XMultiServiceFactory > & xSMgr,
+ const uno::Reference< uno::XComponentContext > & rxContext,
const rtl::OUString & rUri,
const uno::Reference< embed::XStorage > & xParentStorage,
const uno::Reference< io::XOutputStream > & xStreamToWrap )
@@ -597,15 +591,9 @@ OutputStream::OutputStream(
// Use proxy factory service to create aggregatable proxy.
try
{
- uno::Reference< reflection::XProxyFactory > xProxyFac(
- xSMgr->createInstance(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.reflection.ProxyFactory" ) ) ),
- uno::UNO_QUERY );
- if ( xProxyFac.is() )
- {
- m_xAggProxy = xProxyFac->createProxy( m_xWrappedStream );
- }
+ uno::Reference< reflection::XProxyFactory > xProxyFac =
+ reflection::ProxyFactory::create( rxContext );
+ m_xAggProxy = xProxyFac->createProxy( m_xWrappedStream );
}
catch ( uno::Exception const & )
{
@@ -774,7 +762,7 @@ OutputStream::removeEventListener(
//=========================================================================
Stream::Stream(
- const uno::Reference< lang::XMultiServiceFactory > & xSMgr,
+ const uno::Reference< uno::XComponentContext > & rxContext,
const rtl::OUString & rUri,
const uno::Reference< embed::XStorage > & xParentStorage,
const uno::Reference< io::XStream > & xStreamToWrap )
@@ -798,15 +786,9 @@ Stream::Stream(
// Use proxy factory service to create aggregatable proxy.
try
{
- uno::Reference< reflection::XProxyFactory > xProxyFac(
- xSMgr->createInstance(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.reflection.ProxyFactory" ) ) ),
- uno::UNO_QUERY );
- if ( xProxyFac.is() )
- {
- m_xAggProxy = xProxyFac->createProxy( m_xWrappedStream );
- }
+ uno::Reference< reflection::XProxyFactory > xProxyFac =
+ reflection::ProxyFactory::create( rxContext );
+ m_xAggProxy = xProxyFac->createProxy( m_xWrappedStream );
}
catch ( uno::Exception const & )
{
diff --git a/ucb/source/ucp/tdoc/tdoc_stgelems.hxx b/ucb/source/ucp/tdoc/tdoc_stgelems.hxx
index d69407ea48fe..2d4d23de7420 100644
--- a/ucb/source/ucp/tdoc/tdoc_stgelems.hxx
+++ b/ucb/source/ucp/tdoc/tdoc_stgelems.hxx
@@ -81,7 +81,7 @@ class Storage : public StorageUNOBase, public ParentStorageHolder
public:
Storage(
const com::sun::star::uno::Reference<
- com::sun::star::lang::XMultiServiceFactory > & xSMgr,
+ com::sun::star::uno::XComponentContext > & rxContext,
const rtl::Reference< StorageElementFactory > & xFactory,
const rtl::OUString & rUri,
const com::sun::star::uno::Reference<
@@ -316,7 +316,7 @@ class OutputStream : public OutputStreamUNOBase, public ParentStorageHolder
public:
OutputStream(
const com::sun::star::uno::Reference<
- com::sun::star::lang::XMultiServiceFactory > & xSMgr,
+ com::sun::star::uno::XComponentContext > & rxContext,
const rtl::OUString & rUri,
const com::sun::star::uno::Reference<
com::sun::star::embed::XStorage > & xParentStorage,
@@ -398,7 +398,7 @@ class Stream : public StreamUNOBase, public ParentStorageHolder
public:
Stream(
const com::sun::star::uno::Reference<
- com::sun::star::lang::XMultiServiceFactory > & xSMgr,
+ com::sun::star::uno::XComponentContext > & rxContext,
const rtl::OUString & rUri,
const com::sun::star::uno::Reference<
com::sun::star::embed::XStorage > & xParentStorage,
diff --git a/ucb/source/ucp/tdoc/tdoc_storage.cxx b/ucb/source/ucp/tdoc/tdoc_storage.cxx
index b71d6149134e..dd86cff85a92 100644
--- a/ucb/source/ucp/tdoc/tdoc_storage.cxx
+++ b/ucb/source/ucp/tdoc/tdoc_storage.cxx
@@ -22,6 +22,7 @@
#include "com/sun/star/beans/XPropertySet.hpp"
#include "com/sun/star/embed/ElementModes.hpp"
#include "com/sun/star/lang/XSingleServiceFactory.hpp"
+#include "comphelper/processfactory.hxx"
#include "tdoc_uri.hxx"
#include "tdoc_docmgr.hxx"
@@ -184,7 +185,7 @@ StorageElementFactory::createStorage( const rtl::OUString & rUri,
|| ( eMode == READ_WRITE_CREATE ) );
std::auto_ptr< Storage > xElement(
- new Storage( m_xSMgr, this, aUriKey, xParentStorage, xStorage ) );
+ new Storage( comphelper::getComponentContext(m_xSMgr), this, aUriKey, xParentStorage, xStorage ) );
aIt = m_aMap.insert(
StorageMap::value_type(
@@ -234,7 +235,7 @@ StorageElementFactory::createStorage( const rtl::OUString & rUri,
}
aIt->second
- = new Storage( m_xSMgr, this, aUriKey, xParentStorage, xStorage );
+ = new Storage( comphelper::getComponentContext(m_xSMgr), this, aUriKey, xParentStorage, xStorage );
aIt->second->m_aContainerIt = aIt;
return aIt->second;
}
@@ -312,7 +313,7 @@ StorageElementFactory::createOutputStream( const rtl::OUString & rUri,
// read-only instance!)
return uno::Reference< io::XOutputStream >(
new OutputStream(
- m_xSMgr, rUri, xParentStorage, xStream->getOutputStream() ) );
+ comphelper::getComponentContext(m_xSMgr), rUri, xParentStorage, xStream->getOutputStream() ) );
}
//=========================================================================
@@ -352,7 +353,7 @@ StorageElementFactory::createStream( const rtl::OUString & rUri,
}
return uno::Reference< io::XStream >(
- new Stream( m_xSMgr, rUri, xParentStorage, xStream ) );
+ new Stream( comphelper::getComponentContext(m_xSMgr), rUri, xParentStorage, xStream ) );
}
//=========================================================================