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 /connectivity/source/cpool | |
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 'connectivity/source/cpool')
-rw-r--r-- | connectivity/source/cpool/ZPoolCollection.cxx | 20 |
1 files changed, 6 insertions, 14 deletions
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); } } |