diff options
author | Noel Grandin <noel@peralex.com> | 2012-11-27 11:00:51 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2012-11-28 13:06:18 +0100 |
commit | 7470cc532fe408dc9d8735cde0e2eb5bb62fd69c (patch) | |
tree | 3815c10cbd2473a19915d8057ca1eb19046592bc /dbaccess | |
parent | 56ea15091c69d280310aa8b28bb1e9488eaad756 (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 'dbaccess')
-rw-r--r-- | dbaccess/source/core/dataaccess/connection.cxx | 6 | ||||
-rw-r--r-- | dbaccess/source/core/dataaccess/datasource.cxx | 10 |
2 files changed, 8 insertions, 8 deletions
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( |