summaryrefslogtreecommitdiff
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
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
-rw-r--r--accessibility/source/extended/accessibleeditbrowseboxcell.cxx2
-rw-r--r--accessibility/source/standard/vclxaccessibletoolbox.cxx12
-rw-r--r--basic/source/classes/sbxmod.cxx8
-rw-r--r--comphelper/inc/comphelper/accessiblewrapper.hxx18
-rw-r--r--comphelper/inc/comphelper/proxyaggregation.hxx14
-rw-r--r--comphelper/source/misc/accessiblewrapper.cxx22
-rw-r--r--comphelper/source/misc/proxyaggregation.cxx53
-rw-r--r--connectivity/inc/connectivity/ConnectionWrapper.hxx3
-rw-r--r--connectivity/source/commontools/ConnectionWrapper.cxx6
-rw-r--r--connectivity/source/cpool/ZPoolCollection.cxx20
-rw-r--r--connectivity/source/drivers/hsqldb/HConnection.cxx11
-rw-r--r--connectivity/source/drivers/hsqldb/HDriver.cxx2
-rw-r--r--connectivity/source/inc/hsqldb/HConnection.hxx4
-rw-r--r--dbaccess/source/core/dataaccess/connection.cxx6
-rw-r--r--dbaccess/source/core/dataaccess/datasource.cxx10
-rw-r--r--offapi/type_reference/types.rdbbin7655424 -> 7646208 bytes
-rw-r--r--reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx6
-rw-r--r--reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx6
-rw-r--r--scripting/source/provider/BrowseNodeFactoryImpl.cxx9
-rw-r--r--svx/source/accessibility/AccessibleControlShape.cxx10
-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
-rw-r--r--udkapi/UnoApi_udkapi.mk2
-rw-r--r--udkapi/com/sun/star/reflection/ProxyFactory.idl7
25 files changed, 121 insertions, 169 deletions
diff --git a/accessibility/source/extended/accessibleeditbrowseboxcell.cxx b/accessibility/source/extended/accessibleeditbrowseboxcell.cxx
index e9c312267140..8232bd99011f 100644
--- a/accessibility/source/extended/accessibleeditbrowseboxcell.cxx
+++ b/accessibility/source/extended/accessibleeditbrowseboxcell.cxx
@@ -46,7 +46,7 @@ namespace accessibility
sal_Int32 _nRowPos,
sal_uInt16 _nColPos)
:AccessibleBrowseBoxCell( _rxParent, _rBrowseBox, _xFocusWindow, _nRowPos, _nColPos )
- ,OAccessibleContextWrapperHelper( ::comphelper::getProcessServiceFactory(), rBHelper, _xControlChild, _rxOwningAccessible, _rxParent )
+ ,OAccessibleContextWrapperHelper( ::comphelper::getProcessComponentContext(), rBHelper, _xControlChild, _rxOwningAccessible, _rxParent )
{
aggregateProxy( m_refCount, *this );
}
diff --git a/accessibility/source/standard/vclxaccessibletoolbox.cxx b/accessibility/source/standard/vclxaccessibletoolbox.cxx
index 42e1a5409165..205c08b6696e 100644
--- a/accessibility/source/standard/vclxaccessibletoolbox.cxx
+++ b/accessibility/source/standard/vclxaccessibletoolbox.cxx
@@ -48,12 +48,12 @@ namespace
sal_Int32 m_nIndexInParent;
public:
OToolBoxWindowItemContext(sal_Int32 _nIndexInParent,
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext,
const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext >& _rxInnerAccessibleContext,
const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& _rxOwningAccessible,
const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& _rxParentAccessible
) : OAccessibleContextWrapper(
- _rxORB,
+ _rxContext,
_rxInnerAccessibleContext,
_rxOwningAccessible,
_rxParentAccessible )
@@ -93,11 +93,11 @@ namespace
public:
OToolBoxWindowItem(sal_Int32 _nIndexInParent,
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext,
const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& _rxInnerAccessible,
const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& _rxParentAccessible
) : OAccessibleWrapper(
- _rxORB,
+ _rxContext,
_rxInnerAccessible,
_rxParentAccessible)
,m_nIndexInParent(_nIndexInParent)
@@ -127,7 +127,7 @@ namespace
OAccessibleContextWrapper* OToolBoxWindowItem::createAccessibleContext(
const Reference< XAccessibleContext >& _rxInnerContext )
{
- return new OToolBoxWindowItemContext( m_nIndexInParent,getORB(), _rxInnerContext, this, getParent() );
+ return new OToolBoxWindowItemContext( m_nIndexInParent, getComponentContext(), _rxInnerContext, this, getParent() );
}
//--------------------------------------------------------------------
@@ -717,7 +717,7 @@ Reference< XAccessible > SAL_CALL VCLXAccessibleToolBox::getAccessibleChild( sal
Reference< XAccessible> xParent = pChild;
if ( pItemWindow )
{
- xChild = new OToolBoxWindowItem(0,::comphelper::getProcessServiceFactory(),pItemWindow->GetAccessible(),xParent);
+ xChild = new OToolBoxWindowItem(0,::comphelper::getProcessComponentContext(),pItemWindow->GetAccessible(),xParent);
pItemWindow->SetAccessible(xChild);
pChild->SetChild( xChild );
}
diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx
index e577882b1c8b..b192a4f12913 100644
--- a/basic/source/classes/sbxmod.cxx
+++ b/basic/source/classes/sbxmod.cxx
@@ -70,7 +70,7 @@ using namespace com::sun::star;
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <comphelper/processfactory.hxx>
#include <map>
-#include <com/sun/star/reflection/XProxyFactory.hpp>
+#include <com/sun/star/reflection/ProxyFactory.hpp>
#include <cppuhelper/implbase1.hxx>
#include <com/sun/star/uno/XAggregation.hpp>
#include <com/sun/star/script/XInvocation.hpp>
@@ -156,11 +156,7 @@ DocObjectWrapper::DocObjectWrapper( SbModule* pVar ) : m_pMod( pVar ), mName( pV
{
try
{
- Reference< XComponentContext > xCtx(
- comphelper::getProcessComponentContext() );
- Reference< XMultiComponentFactory > xMFac(
- xCtx->getServiceManager() );
- Reference< XProxyFactory > xProxyFac( xMFac->createInstanceWithContext( OUString( "com.sun.star.reflection.ProxyFactory" ), xCtx ), UNO_QUERY_THROW );
+ Reference< XProxyFactory > xProxyFac = ProxyFactory::create( comphelper::getProcessComponentContext() );
m_xAggProxy = xProxyFac->createProxy( xIf );
}
catch(const Exception& )
diff --git a/comphelper/inc/comphelper/accessiblewrapper.hxx b/comphelper/inc/comphelper/accessiblewrapper.hxx
index dfd144becd1b..1b4ab52cf69b 100644
--- a/comphelper/inc/comphelper/accessiblewrapper.hxx
+++ b/comphelper/inc/comphelper/accessiblewrapper.hxx
@@ -76,7 +76,7 @@ namespace comphelper
public:
/** ctor
- @param _rxORB
+ @param _rxContext
a service factory
@param _rxInnerAccessible
@@ -86,7 +86,7 @@ namespace comphelper
The XAccessible which is our parent
*/
OAccessibleWrapper(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext,
const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& _rxInnerAccessible,
const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& _rxParentAccessible
);
@@ -160,7 +160,7 @@ namespace comphelper
protected:
/** ctor
- @param _rxORB
+ @param _rxContext
a service factory
@param _rxInnerAccessibleContext
@@ -176,7 +176,7 @@ namespace comphelper
The XAccessible to return in the getAccessibleParent call
*/
OAccessibleContextWrapperHelper(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext,
::cppu::OBroadcastHelper& _rBHelper,
const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext >& _rxInnerAccessibleContext,
const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& _rxOwningAccessible,
@@ -247,7 +247,7 @@ namespace comphelper
public:
/** ctor
- @param _rxORB
+ @param _rxContext
a service factory
@param _rxInnerAccessibleContext
@@ -263,7 +263,7 @@ namespace comphelper
The XAccessible to return in the getAccessibleParent call
*/
OAccessibleContextWrapper(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext,
const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext >& _rxInnerAccessibleContext,
const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& _rxOwningAccessible,
const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& _rxParentAccessible
@@ -330,8 +330,8 @@ namespace comphelper
class COMPHELPER_DLLPUBLIC OWrappedAccessibleChildrenManager : public OWrappedAccessibleChildrenManager_Base
{
protected:
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >
- m_xORB;
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >
+ m_xContext;
::com::sun::star::uno::WeakReference< ::com::sun::star::accessibility::XAccessible >
m_aOwningAccessible; // the XAccessible which belongs to the XAccessibleContext which we work for
AccessibleMap m_aChildrenMap; // for caching children
@@ -340,7 +340,7 @@ namespace comphelper
public:
/// ctor
OWrappedAccessibleChildrenManager(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext
);
/** specifies if the children are to be consideren transient (i.e.: not cached)
diff --git a/comphelper/inc/comphelper/proxyaggregation.hxx b/comphelper/inc/comphelper/proxyaggregation.hxx
index de32f583c6ab..2d78b865b547 100644
--- a/comphelper/inc/comphelper/proxyaggregation.hxx
+++ b/comphelper/inc/comphelper/proxyaggregation.hxx
@@ -82,16 +82,16 @@ namespace comphelper
private:
::com::sun::star::uno::Reference< ::com::sun::star::uno::XAggregation > m_xProxyAggregate;
::com::sun::star::uno::Reference< ::com::sun::star::lang::XTypeProvider > m_xProxyTypeAccess;
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xORB;
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
protected:
- inline const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& getORB()
+ inline const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& getComponentContext()
{
- return m_xORB;
+ return m_xContext;
}
protected:
- OProxyAggregation( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB );
+ OProxyAggregation( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext );
~OProxyAggregation();
/// to be called from within your ctor
@@ -138,7 +138,7 @@ namespace comphelper
protected:
// OProxyAggregation
- using OProxyAggregation::getORB;
+ using OProxyAggregation::getComponentContext;
// XInterface
::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& _rType ) throw (::com::sun::star::uno::RuntimeException);
@@ -148,7 +148,7 @@ namespace comphelper
protected:
OComponentProxyAggregationHelper(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext,
::cppu::OBroadcastHelper& _rBHelper
);
virtual ~OComponentProxyAggregationHelper( );
@@ -183,7 +183,7 @@ namespace comphelper
{
protected:
OComponentProxyAggregation(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext,
const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& _rxComponent
);
diff --git a/comphelper/source/misc/accessiblewrapper.cxx b/comphelper/source/misc/accessiblewrapper.cxx
index 20276067a117..929eb5f76dde 100644
--- a/comphelper/source/misc/accessiblewrapper.cxx
+++ b/comphelper/source/misc/accessiblewrapper.cxx
@@ -73,8 +73,8 @@ namespace comphelper
};
//-------------------------------------------------------------------------
- OWrappedAccessibleChildrenManager::OWrappedAccessibleChildrenManager( const Reference< XMultiServiceFactory >& _rxORB )
- :m_xORB( _rxORB )
+ OWrappedAccessibleChildrenManager::OWrappedAccessibleChildrenManager( const Reference< XComponentContext >& _rxContext )
+ :m_xContext( _rxContext )
,m_bTransientChildren( sal_True )
{
}
@@ -142,7 +142,7 @@ namespace comphelper
else if ( _bCreate )
{ // not found in the cache, and allowed to create
// -> new wrapper
- xValue = new OAccessibleWrapper( m_xORB, _rxKey, (Reference< XAccessible >)m_aOwningAccessible );
+ xValue = new OAccessibleWrapper( m_xContext, _rxKey, (Reference< XAccessible >)m_aOwningAccessible );
// see if we do cache children
if ( !m_bTransientChildren )
@@ -298,10 +298,10 @@ namespace comphelper
//= OAccessibleWrapper (implementation)
//=========================================================================
//-------------------------------------------------------------------------
- OAccessibleWrapper::OAccessibleWrapper( const Reference< XMultiServiceFactory >& _rxORB,
+ OAccessibleWrapper::OAccessibleWrapper( const Reference< XComponentContext >& _rxContext,
const Reference< XAccessible >& _rxInnerAccessible, const Reference< XAccessible >& _rxParentAccessible )
:OAccessibleWrapper_Base( )
- ,OComponentProxyAggregation( _rxORB, Reference< XComponent >( _rxInnerAccessible, UNO_QUERY ) )
+ ,OComponentProxyAggregation( _rxContext, Reference< XComponent >( _rxInnerAccessible, UNO_QUERY ) )
,m_xParentAccessible( _rxParentAccessible )
,m_xInnerAccessible( _rxInnerAccessible )
{
@@ -341,7 +341,7 @@ namespace comphelper
//--------------------------------------------------------------------
OAccessibleContextWrapper* OAccessibleWrapper::createAccessibleContext( const Reference< XAccessibleContext >& _rxInnerContext )
{
- return new OAccessibleContextWrapper( getORB(), _rxInnerContext, this, m_xParentAccessible );
+ return new OAccessibleContextWrapper( getComponentContext(), _rxInnerContext, this, m_xParentAccessible );
}
//--------------------------------------------------------------------
@@ -369,19 +369,19 @@ namespace comphelper
//=========================================================================
//-------------------------------------------------------------------------
OAccessibleContextWrapperHelper::OAccessibleContextWrapperHelper(
- const Reference< XMultiServiceFactory >& _rxORB,
+ const Reference< XComponentContext >& _rxContext,
::cppu::OBroadcastHelper& _rBHelper,
const Reference< XAccessibleContext >& _rxInnerAccessibleContext,
const Reference< XAccessible >& _rxOwningAccessible,
const Reference< XAccessible >& _rxParentAccessible )
- :OComponentProxyAggregationHelper( _rxORB, _rBHelper )
+ :OComponentProxyAggregationHelper( _rxContext, _rBHelper )
,m_xInnerContext( _rxInnerAccessibleContext )
,m_xOwningAccessible( _rxOwningAccessible )
,m_xParentAccessible( _rxParentAccessible )
,m_pChildMapper( NULL )
{
// initialize the mapper for our children
- m_pChildMapper = new OWrappedAccessibleChildrenManager( getORB() );
+ m_pChildMapper = new OWrappedAccessibleChildrenManager( getComponentContext() );
m_pChildMapper->acquire();
// determine if we're allowed to cache children
@@ -526,11 +526,11 @@ namespace comphelper
IMPLEMENT_FORWARD_XTYPEPROVIDER2( OAccessibleContextWrapper, OAccessibleContextWrapper_CBase, OAccessibleContextWrapperHelper )
//--------------------------------------------------------------------
- OAccessibleContextWrapper::OAccessibleContextWrapper( const Reference< XMultiServiceFactory >& _rxORB,
+ OAccessibleContextWrapper::OAccessibleContextWrapper( const Reference< XComponentContext >& _rxContext,
const Reference< XAccessibleContext >& _rxInnerAccessibleContext, const Reference< XAccessible >& _rxOwningAccessible,
const Reference< XAccessible >& _rxParentAccessible )
:OAccessibleContextWrapper_CBase( m_aMutex )
- ,OAccessibleContextWrapperHelper( _rxORB, rBHelper, _rxInnerAccessibleContext, _rxOwningAccessible, _rxParentAccessible )
+ ,OAccessibleContextWrapperHelper( _rxContext, rBHelper, _rxInnerAccessibleContext, _rxOwningAccessible, _rxParentAccessible )
,m_nNotifierClient( 0 )
{
aggregateProxy( m_refCount, *this );
diff --git a/comphelper/source/misc/proxyaggregation.cxx b/comphelper/source/misc/proxyaggregation.cxx
index 6d190ff91b14..a8771d6a2249 100644
--- a/comphelper/source/misc/proxyaggregation.cxx
+++ b/comphelper/source/misc/proxyaggregation.cxx
@@ -18,7 +18,7 @@
*/
#include <comphelper/proxyaggregation.hxx>
-#include <com/sun/star/reflection/XProxyFactory.hpp>
+#include <com/sun/star/reflection/ProxyFactory.hpp>
//.............................................................................
namespace comphelper
@@ -33,8 +33,8 @@ namespace comphelper
//= OProxyAggregation
//=========================================================================
//-------------------------------------------------------------------------
- OProxyAggregation::OProxyAggregation( const Reference< XMultiServiceFactory >& _rxORB )
- :m_xORB( _rxORB )
+ OProxyAggregation::OProxyAggregation( const Reference< XComponentContext >& _rxContext )
+ :m_xContext( _rxContext )
{
}
@@ -43,32 +43,25 @@ namespace comphelper
::cppu::OWeakObject& _rDelegator )
{
// first a factory for the proxy
- Reference< XProxyFactory > xFactory(
- m_xORB->createInstance( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.reflection.ProxyFactory" ) ) ),
- UNO_QUERY
- );
- OSL_ENSURE( xFactory.is(), "OProxyAggregation::baseAggregateProxyFor: could not create a proxy factory!" );
+ Reference< XProxyFactory > xFactory = ProxyFactory::create( m_xContext );
// then the proxy itself
- if ( xFactory.is() )
+ { // i36686 OJ: achieve the desctruction of the tempoary -> otherwise it leads to _rRefCount -= 2
+ m_xProxyAggregate = xFactory->createProxy( _rxComponent );
+ }
+ if ( m_xProxyAggregate.is() )
+ m_xProxyAggregate->queryAggregation( ::getCppuType( &m_xProxyTypeAccess ) ) >>= m_xProxyTypeAccess;
+
+ // aggregate the proxy
+ osl_atomic_increment( &_rRefCount );
+ if ( m_xProxyAggregate.is() )
{
- { // i36686 OJ: achieve the desctruction of the tempoary -> otherwise it leads to _rRefCount -= 2
- m_xProxyAggregate = xFactory->createProxy( _rxComponent );
- }
- if ( m_xProxyAggregate.is() )
- m_xProxyAggregate->queryAggregation( ::getCppuType( &m_xProxyTypeAccess ) ) >>= m_xProxyTypeAccess;
-
- // aggregate the proxy
- osl_atomic_increment( &_rRefCount );
- if ( m_xProxyAggregate.is() )
- {
- // At this point in time, the proxy has a ref count of exactly two - in m_xControlContextProxy,
- // and in m_xProxyTypeAccess.
- // Remember to _not_ reset these members unless the delegator of the proxy has been reset, too!
- m_xProxyAggregate->setDelegator( _rDelegator );
- }
- osl_atomic_decrement( &_rRefCount );
+ // At this point in time, the proxy has a ref count of exactly two - in m_xControlContextProxy,
+ // and in m_xProxyTypeAccess.
+ // Remember to _not_ reset these members unless the delegator of the proxy has been reset, too!
+ m_xProxyAggregate->setDelegator( _rDelegator );
}
+ osl_atomic_decrement( &_rRefCount );
}
//-------------------------------------------------------------------------
@@ -104,12 +97,12 @@ namespace comphelper
//= OComponentProxyAggregationHelper
//=========================================================================
//-------------------------------------------------------------------------
- OComponentProxyAggregationHelper::OComponentProxyAggregationHelper( const Reference< XMultiServiceFactory >& _rxORB,
+ OComponentProxyAggregationHelper::OComponentProxyAggregationHelper( const Reference< XComponentContext >& _rxContext,
::cppu::OBroadcastHelper& _rBHelper )
- :OProxyAggregation( _rxORB )
+ :OProxyAggregation( _rxContext )
,m_rBHelper( _rBHelper )
{
- OSL_ENSURE( _rxORB.is(), "OComponentProxyAggregationHelper::OComponentProxyAggregationHelper: invalid arguments!" );
+ OSL_ENSURE( _rxContext.is(), "OComponentProxyAggregationHelper::OComponentProxyAggregationHelper: invalid arguments!" );
}
//-------------------------------------------------------------------------
@@ -192,10 +185,10 @@ namespace comphelper
//= OComponentProxyAggregation
//=========================================================================
//-------------------------------------------------------------------------
- OComponentProxyAggregation::OComponentProxyAggregation( const Reference< XMultiServiceFactory >& _rxORB,
+ OComponentProxyAggregation::OComponentProxyAggregation( const Reference< XComponentContext >& _rxContext,
const Reference< XComponent >& _rxComponent )
:OComponentProxyAggregation_CBase( m_aMutex )
- ,OComponentProxyAggregationHelper( _rxORB, rBHelper )
+ ,OComponentProxyAggregationHelper( _rxContext, rBHelper )
{
OSL_ENSURE( _rxComponent.is(), "OComponentProxyAggregation::OComponentProxyAggregation: accessible is no XComponent!" );
if ( _rxComponent.is() )
diff --git a/connectivity/inc/connectivity/ConnectionWrapper.hxx b/connectivity/inc/connectivity/ConnectionWrapper.hxx
index 4c3966b0b27a..df89160d5c0d 100644
--- a/connectivity/inc/connectivity/ConnectionWrapper.hxx
+++ b/connectivity/inc/connectivity/ConnectionWrapper.hxx
@@ -25,6 +25,7 @@
#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/lang/XUnoTunnel.hpp>
#include <com/sun/star/sdbc/XConnection.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
#include <comphelper/broadcasthelper.hxx>
#include "connectivity/CommonTools.hxx"
#include "connectivity/dbtoolsdllapi.hxx"
@@ -52,7 +53,7 @@ namespace connectivity
virtual ~OConnectionWrapper();
void setDelegation(::com::sun::star::uno::Reference< ::com::sun::star::uno::XAggregation >& _rxProxyConnection,oslInterlockedCount& _rRefCount);
void setDelegation(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _xConnection
- ,const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _xORB
+ ,const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext>& _rxContext
,oslInterlockedCount& _rRefCount);
// must be called from derived classes
void disposing();
diff --git a/connectivity/source/commontools/ConnectionWrapper.cxx b/connectivity/source/commontools/ConnectionWrapper.cxx
index 7b3f14f235f9..fbf4082f37d4 100644
--- a/connectivity/source/commontools/ConnectionWrapper.cxx
+++ b/connectivity/source/commontools/ConnectionWrapper.cxx
@@ -24,7 +24,7 @@
#include <comphelper/uno3.hxx>
#include <comphelper/sequence.hxx>
#include <cppuhelper/typeprovider.hxx>
-#include <com/sun/star/reflection/XProxyFactory.hpp>
+#include <com/sun/star/reflection/ProxyFactory.hpp>
#include <rtl/digest.h>
#include <algorithm>
#include <string.h>
@@ -65,7 +65,7 @@ void OConnectionWrapper::setDelegation(Reference< XAggregation >& _rxProxyConnec
}
// -----------------------------------------------------------------------------
void OConnectionWrapper::setDelegation(const Reference< XConnection >& _xConnection
- ,const Reference< XMultiServiceFactory>& _xORB
+ ,const Reference< XComponentContext>& _rxContext
,oslInterlockedCount& _rRefCount)
{
OSL_ENSURE(_xConnection.is(),"OConnectionWrapper: Connection must be valid!");
@@ -76,7 +76,7 @@ void OConnectionWrapper::setDelegation(const Reference< XConnection >& _xConnect
m_xUnoTunnel.set(m_xConnection,UNO_QUERY);
m_xServiceInfo.set(m_xConnection,UNO_QUERY);
- Reference< XProxyFactory > xProxyFactory(_xORB->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.reflection.ProxyFactory"))),UNO_QUERY);
+ Reference< XProxyFactory > xProxyFactory = ProxyFactory::create( _rxContext );
Reference< XAggregation > xConProxy = xProxyFactory->createProxy(_xConnection);
if (xConProxy.is())
{
diff --git a/connectivity/source/cpool/ZPoolCollection.cxx b/connectivity/source/cpool/ZPoolCollection.cxx
index 7740379990e6..68b5448b9506 100644
--- a/connectivity/source/cpool/ZPoolCollection.cxx
+++ b/connectivity/source/cpool/ZPoolCollection.cxx
@@ -24,6 +24,7 @@
#include <com/sun/star/container/XHierarchicalNameAccess.hpp>
#include <com/sun/star/beans/NamedValue.hpp>
#include <com/sun/star/beans/PropertyValue.hpp>
+#include <com/sun/star/reflection/ProxyFactory.hpp>
#include <comphelper/extract.hxx>
#include <comphelper/processfactory.hxx>
#include <com/sun/star/beans/XPropertySet.hpp>
@@ -78,11 +79,7 @@ OPoolCollection::OPoolCollection(const Reference< XMultiServiceFactory >& _rxF
m_xDriverAccess = Reference< XDriverAccess >(m_xManager, UNO_QUERY);
OSL_ENSURE(m_xDriverAccess.is(), "have no (or an invalid) driver manager!");
- m_xProxyFactory = Reference< XProxyFactory >(
- m_xServiceFactory->createInstance(
- ::rtl::OUString("com.sun.star.reflection.ProxyFactory")),
- UNO_QUERY);
- OSL_ENSURE(m_xProxyFactory.is(), "OConnectionPool::OConnectionPool: could not create a proxy factory!");
+ m_xProxyFactory = ProxyFactory::create( comphelper::getComponentContext(m_xServiceFactory) );
Reference<XPropertySet> xProp(getConfigPoolRoot(),UNO_QUERY);
if ( xProp.is() )
@@ -216,16 +213,11 @@ Reference< XDriver > SAL_CALL OPoolCollection::getDriverByURL( const ::rtl::OUSt
else
{ // create a new proxy for the driver
// this allows us to control the connections created by it
- if (m_xProxyFactory.is())
- {
- Reference< XAggregation > xDriverProxy = m_xProxyFactory->createProxy(xDriver.get());
- OSL_ENSURE(xDriverProxy.is(), "OConnectionPool::getDriverByURL: invalid proxy returned by the proxy factory!");
+ Reference< XAggregation > xDriverProxy = m_xProxyFactory->createProxy(xDriver.get());
+ OSL_ENSURE(xDriverProxy.is(), "OConnectionPool::getDriverByURL: invalid proxy returned by the proxy factory!");
- OConnectionPool* pConnectionPool = getConnectionPool(sImplName,xDriver,xDriverNode);
- xDriver = new ODriverWrapper(xDriverProxy, pConnectionPool);
- }
- else
- OSL_FAIL("OConnectionPool::getDriverByURL: could not instantiate a proxy factory!");
+ OConnectionPool* pConnectionPool = getConnectionPool(sImplName,xDriver,xDriverNode);
+ xDriver = new ODriverWrapper(xDriverProxy, pConnectionPool);
}
}
diff --git a/connectivity/source/drivers/hsqldb/HConnection.cxx b/connectivity/source/drivers/hsqldb/HConnection.cxx
index 2d447af76467..2b1f9c0464a0 100644
--- a/connectivity/source/drivers/hsqldb/HConnection.cxx
+++ b/connectivity/source/drivers/hsqldb/HConnection.cxx
@@ -53,6 +53,7 @@ using ::com::sun::star::uno::Exception;
using ::com::sun::star::uno::RuntimeException;
using ::com::sun::star::uno::UNO_QUERY;
using ::com::sun::star::uno::UNO_QUERY_THROW;
+using ::com::sun::star::uno::XComponentContext;
using ::com::sun::star::sdbc::XStatement;
using ::com::sun::star::sdbc::XConnection;
using ::com::sun::star::sdbcx::XDataDefinitionSupplier;
@@ -118,15 +119,15 @@ namespace connectivity { namespace hsqldb
}
// -----------------------------------------------------------------------------
OHsqlConnection::OHsqlConnection( const Reference< XDriver > _rxDriver,
- const Reference< XConnection >& _xConnection ,const Reference< XMultiServiceFactory>& _xORB )
+ const Reference< XConnection >& _xConnection ,const Reference< XComponentContext >& _rxContext )
:OHsqlConnection_BASE( m_aMutex )
,m_aFlushListeners( m_aMutex )
,m_xDriver( _rxDriver )
- ,m_xORB( _xORB )
+ ,m_xContext( _rxContext )
,m_bIni(true)
,m_bReadOnly(false)
{
- setDelegation(_xConnection,_xORB,m_refCount);
+ setDelegation(_xConnection,_rxContext,m_refCount);
}
// -----------------------------------------------------------------------------
OHsqlConnection::~OHsqlConnection()
@@ -343,8 +344,8 @@ namespace connectivity { namespace hsqldb
{
// create a graphic provider
Reference< XGraphicProvider > xProvider;
- if ( m_xORB.is() )
- xProvider.set( GraphicProvider::create(::comphelper::getComponentContext(m_xORB)) );
+ if ( m_xContext.is() )
+ xProvider.set( GraphicProvider::create(m_xContext) );
// assemble the image URL
::rtl::OUStringBuffer aImageURL;
diff --git a/connectivity/source/drivers/hsqldb/HDriver.cxx b/connectivity/source/drivers/hsqldb/HDriver.cxx
index 114c4402d9d5..471d67bd5fbf 100644
--- a/connectivity/source/drivers/hsqldb/HDriver.cxx
+++ b/connectivity/source/drivers/hsqldb/HDriver.cxx
@@ -381,7 +381,7 @@ namespace connectivity
xDesktop->addTerminateListener(s_xTerminateListener);
}
}
- Reference< XComponent> xIfc = new OHsqlConnection( this, xOrig, m_xFactory );
+ Reference< XComponent> xIfc = new OHsqlConnection( this, xOrig, comphelper::getComponentContext(m_xFactory) );
xConnection.set(xIfc,UNO_QUERY);
m_aConnections.push_back(TWeakPair(WeakReferenceHelper(xOrig),TWeakConnectionPair(sKey,TWeakRefPair(WeakReferenceHelper(xConnection),WeakReferenceHelper()))));
diff --git a/connectivity/source/inc/hsqldb/HConnection.hxx b/connectivity/source/inc/hsqldb/HConnection.hxx
index aad422e3817e..42748d9effc0 100644
--- a/connectivity/source/inc/hsqldb/HConnection.hxx
+++ b/connectivity/source/inc/hsqldb/HConnection.hxx
@@ -62,7 +62,7 @@ namespace connectivity
private:
::cppu::OInterfaceContainerHelper m_aFlushListeners;
::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDriver > m_xDriver;
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xORB;
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
bool m_bIni;
bool m_bReadOnly;
@@ -74,7 +74,7 @@ namespace connectivity
OHsqlConnection(
const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDriver > _rxDriver,
const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _xConnection,
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _xORB
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext>& _rxContext
);
// XServiceInfo
diff --git a/dbaccess/source/core/dataaccess/connection.cxx b/dbaccess/source/core/dataaccess/connection.cxx
index 8e5d5c48e2d2..cab3e3a7f3fa 100644
--- a/dbaccess/source/core/dataaccess/connection.cxx
+++ b/dbaccess/source/core/dataaccess/connection.cxx
@@ -34,7 +34,7 @@
#include <com/sun/star/sdb/CommandType.hpp>
#include <com/sun/star/sdbc/XDriverAccess.hpp>
#include <com/sun/star/sdbcx/XDataDefinitionSupplier.hpp>
-#include <com/sun/star/reflection/XProxyFactory.hpp>
+#include <com/sun/star/reflection/ProxyFactory.hpp>
#include <com/sun/star/beans/NamedValue.hpp>
#include <connectivity/dbtools.hxx>
#include <connectivity/dbmetadata.hxx>
@@ -305,8 +305,8 @@ OConnection::OConnection(ODatabaseSource& _rDB
try
{
- Reference< XProxyFactory > xProxyFactory(
- _rxORB->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.reflection.ProxyFactory"))),UNO_QUERY);
+ Reference< XProxyFactory > xProxyFactory =
+ ProxyFactory::create( m_aContext.getUNOContext() );
Reference<XAggregation> xAgg = xProxyFactory->createProxy(_rxMaster.get());
setDelegation(xAgg,m_refCount);
OSL_ENSURE(m_xConnection.is(), "OConnection::OConnection : invalid master connection !");
diff --git a/dbaccess/source/core/dataaccess/datasource.cxx b/dbaccess/source/core/dataaccess/datasource.cxx
index 54d7156520fb..89c14fbc8103 100644
--- a/dbaccess/source/core/dataaccess/datasource.cxx
+++ b/dbaccess/source/core/dataaccess/datasource.cxx
@@ -39,7 +39,7 @@
#include <com/sun/star/document/XEventBroadcaster.hpp>
#include <com/sun/star/embed/XTransactedObject.hpp>
#include <com/sun/star/lang/DisposedException.hpp>
-#include <com/sun/star/reflection/XProxyFactory.hpp>
+#include <com/sun/star/reflection/ProxyFactory.hpp>
#include <com/sun/star/sdb/DatabaseContext.hpp>
#include <com/sun/star/sdbc/XDriverAccess.hpp>
#include <com/sun/star/sdbc/XDriverManager.hpp>
@@ -313,7 +313,7 @@ protected:
~OSharedConnectionManager();
public:
- OSharedConnectionManager(const Reference< XMultiServiceFactory >& _rxServiceFactory);
+ OSharedConnectionManager(const Reference< XComponentContext >& _rxContext);
void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(RuntimeException);
Reference<XConnection> getConnection( const rtl::OUString& url,
@@ -325,10 +325,10 @@ public:
};
DBG_NAME(OSharedConnectionManager)
-OSharedConnectionManager::OSharedConnectionManager(const Reference< XMultiServiceFactory >& _rxServiceFactory)
+OSharedConnectionManager::OSharedConnectionManager(const Reference< XComponentContext >& _rxContext)
{
DBG_CTOR(OSharedConnectionManager,NULL);
- m_xProxyFactory.set(_rxServiceFactory->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.reflection.ProxyFactory"))),UNO_QUERY);
+ m_xProxyFactory.set( ProxyFactory::create( _rxContext ) );
}
OSharedConnectionManager::~OSharedConnectionManager()
@@ -1212,7 +1212,7 @@ Reference< XConnection > ODatabaseSource::getConnection(const rtl::OUString& use
{ // create a new proxy for the connection
if ( !m_pImpl->m_xSharedConnectionManager.is() )
{
- m_pImpl->m_pSharedConnectionManager = new OSharedConnectionManager( m_pImpl->m_aContext.getLegacyServiceFactory() );
+ m_pImpl->m_pSharedConnectionManager = new OSharedConnectionManager( m_pImpl->m_aContext.getUNOContext() );
m_pImpl->m_xSharedConnectionManager = m_pImpl->m_pSharedConnectionManager;
}
xConn = m_pImpl->m_pSharedConnectionManager->getConnection(
diff --git a/offapi/type_reference/types.rdb b/offapi/type_reference/types.rdb
index 7a35d476716c..dc8fc10a2299 100644
--- a/offapi/type_reference/types.rdb
+++ b/offapi/type_reference/types.rdb
Binary files differ
diff --git a/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx b/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx
index d73a9d931ab3..73349a4f64d9 100644
--- a/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx
+++ b/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx
@@ -21,7 +21,7 @@
#include <com/sun/star/sdb/CommandType.hpp>
#include <com/sun/star/chart2/data/XDatabaseDataProvider.hpp>
#include <com/sun/star/chart/XComplexDescriptionAccess.hpp>
-#include <com/sun/star/reflection/XProxyFactory.hpp>
+#include <com/sun/star/reflection/ProxyFactory.hpp>
#include <com/sun/star/sdb/CommandType.hpp>
#include <comphelper/sequence.hxx>
#include <comphelper/sequenceashashmap.hxx>
@@ -319,9 +319,7 @@ void SAL_CALL ExportDocumentHandler::initialize( const uno::Sequence< uno::Any >
if ( !m_xDatabaseDataProvider.is() || !m_xDatabaseDataProvider->getActiveConnection().is() )
throw uno::Exception();
- uno::Reference< reflection::XProxyFactory > xProxyFactory( m_xContext->getServiceManager()->createInstanceWithContext(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.reflection.ProxyFactory")),m_xContext),
- uno::UNO_QUERY);
+ uno::Reference< reflection::XProxyFactory > xProxyFactory = reflection::ProxyFactory::create( m_xContext );
m_xProxy = xProxyFactory->createProxy(m_xDelegatee.get());
::comphelper::query_aggregation(m_xProxy,m_xDelegatee);
m_xTypeProvider.set(m_xDelegatee,uno::UNO_QUERY);
diff --git a/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx b/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx
index 0e61365537fe..2bdc6814fb9b 100644
--- a/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx
+++ b/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx
@@ -23,7 +23,7 @@
#include <com/sun/star/chart2/data/XDataReceiver.hpp>
#include <com/sun/star/chart/XComplexDescriptionAccess.hpp>
#include <com/sun/star/chart/ChartDataRowSource.hpp>
-#include <com/sun/star/reflection/XProxyFactory.hpp>
+#include <com/sun/star/reflection/ProxyFactory.hpp>
#include <com/sun/star/sdb/CommandType.hpp>
#include <comphelper/sequence.hxx>
#include <comphelper/sequenceashashmap.hxx>
@@ -354,9 +354,7 @@ void SAL_CALL ImportDocumentHandler::initialize( const uno::Sequence< uno::Any >
m_aArguments = m_xDatabaseDataProvider->detectArguments(NULL);
- uno::Reference< reflection::XProxyFactory > xProxyFactory( m_xContext->getServiceManager()->createInstanceWithContext(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.reflection.ProxyFactory")),m_xContext),
- uno::UNO_QUERY);
+ uno::Reference< reflection::XProxyFactory > xProxyFactory = reflection::ProxyFactory::create( m_xContext );
m_xProxy = xProxyFactory->createProxy(m_xDelegatee.get());
::comphelper::query_aggregation(m_xProxy,m_xDelegatee);
m_xTypeProvider.set(m_xDelegatee,uno::UNO_QUERY);
diff --git a/scripting/source/provider/BrowseNodeFactoryImpl.cxx b/scripting/source/provider/BrowseNodeFactoryImpl.cxx
index 68c2f70c3a91..978a44c64138 100644
--- a/scripting/source/provider/BrowseNodeFactoryImpl.cxx
+++ b/scripting/source/provider/BrowseNodeFactoryImpl.cxx
@@ -27,7 +27,7 @@
#include <com/sun/star/lang/XMultiComponentFactory.hpp>
#include <com/sun/star/frame/XModel.hpp>
-#include <com/sun/star/reflection/XProxyFactory.hpp>
+#include <com/sun/star/reflection/ProxyFactory.hpp>
#include <com/sun/star/script/provider/XScriptProviderFactory.hpp>
#include <com/sun/star/script/browse/BrowseNodeFactoryViewTypes.hpp>
@@ -397,11 +397,8 @@ public:
// Use proxy factory service to create aggregatable proxy.
try
{
- Reference< lang::XMultiComponentFactory > xMFac( m_xCtx->getServiceManager(), UNO_QUERY_THROW );
- Reference< reflection::XProxyFactory > xProxyFac(
- xMFac->createInstanceWithContext(
- rtl::OUString( "com.sun.star.reflection.ProxyFactory" ),
- m_xCtx ), UNO_QUERY_THROW );
+ Reference< reflection::XProxyFactory > xProxyFac =
+ reflection::ProxyFactory::create( m_xCtx );
m_xAggProxy = xProxyFac->createProxy( m_xWrappedBrowseNode );
}
catch( uno::Exception& )
diff --git a/svx/source/accessibility/AccessibleControlShape.cxx b/svx/source/accessibility/AccessibleControlShape.cxx
index 279e9f25bff3..31b7471f1104 100644
--- a/svx/source/accessibility/AccessibleControlShape.cxx
+++ b/svx/source/accessibility/AccessibleControlShape.cxx
@@ -24,7 +24,7 @@
#include <com/sun/star/accessibility/AccessibleEventId.hpp>
#include <com/sun/star/accessibility/AccessibleStateType.hpp>
#include <com/sun/star/form/FormComponentType.hpp>
-#include <com/sun/star/reflection/XProxyFactory.hpp>
+#include <com/sun/star/reflection/ProxyFactory.hpp>
#include <com/sun/star/container/XContainer.hpp>
#include <comphelper/processfactory.hxx>
#include <unotools/accessiblestatesethelper.hxx>
@@ -123,7 +123,7 @@ AccessibleControlShape::AccessibleControlShape (
, m_bDisposeNativeContext( sal_False )
, m_bWaitingForControl( sal_False )
{
- m_pChildManager = new OWrappedAccessibleChildrenManager( getProcessServiceFactory() );
+ m_pChildManager = new OWrappedAccessibleChildrenManager( getProcessComponentContext() );
m_pChildManager->acquire();
osl_atomic_increment( &m_refCount );
@@ -260,11 +260,9 @@ void AccessibleControlShape::Init()
// .................................................................
// finally, aggregate a proxy for the control context
// first a factory for the proxy
- Reference< XProxyFactory > xFactory;
- xFactory = xFactory.query( getProcessServiceFactory()->createInstance( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.reflection.ProxyFactory" ) ) ) );
- OSL_ENSURE( xFactory.is(), "AccessibleControlShape::Init: could not create a proxy factory!" );
+ Reference< XProxyFactory > xFactory = ProxyFactory::create( comphelper::getComponentContext(getProcessServiceFactory()) );
// then the proxy itself
- if ( xFactory.is() && xNativeControlContext.is() )
+ if ( xNativeControlContext.is() )
{
m_xControlContextProxy = xFactory->createProxy( xNativeControlContext );
OSL_VERIFY( xNativeControlContext->queryInterface( ::getCppuType( &m_xControlContextTypeAccess ) ) >>= m_xControlContextTypeAccess );
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 ) );
}
//=========================================================================
diff --git a/udkapi/UnoApi_udkapi.mk b/udkapi/UnoApi_udkapi.mk
index a7a577853b4e..3826f3c3a3b1 100644
--- a/udkapi/UnoApi_udkapi.mk
+++ b/udkapi/UnoApi_udkapi.mk
@@ -96,7 +96,6 @@ $(eval $(call gb_UnoApi_add_idlfiles_noheader,udkapi,udkapi/com/sun/star/loader,
))
$(eval $(call gb_UnoApi_add_idlfiles_noheader,udkapi,udkapi/com/sun/star/reflection,\
CoreReflection \
- ProxyFactory \
TypeDescriptionManager \
TypeDescriptionProvider \
))
@@ -145,6 +144,7 @@ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,udkapi,udkapi/com/sun/star/io,\
))
$(eval $(call gb_UnoApi_add_idlfiles_nohdl,udkapi,udkapi/com/sun/star/reflection,\
theCoreReflection \
+ ProxyFactory \
))
$(eval $(call gb_UnoApi_add_idlfiles_nohdl,udkapi,udkapi/com/sun/star/registry,\
ImplementationRegistration \
diff --git a/udkapi/com/sun/star/reflection/ProxyFactory.idl b/udkapi/com/sun/star/reflection/ProxyFactory.idl
index bf19be86bcc0..f69028203a92 100644
--- a/udkapi/com/sun/star/reflection/ProxyFactory.idl
+++ b/udkapi/com/sun/star/reflection/ProxyFactory.idl
@@ -44,12 +44,7 @@
depends on your programming language.
Thus this service is deprecated, too.
*/
-published service ProxyFactory
-{
- /** Factory interface to produce proxies
- */
- interface com::sun::star::reflection::XProxyFactory;
-};
+published service ProxyFactory : XProxyFactory;
}; }; }; };