diff options
author | Noel Grandin <noel@peralex.com> | 2013-03-19 13:08:47 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2013-03-20 07:32:53 +0200 |
commit | a066525b42a1ab8dc60e10a5d62819c259904f32 (patch) | |
tree | 0c21130ff82a482ab80de0fcc3c73be0125d06f5 /connectivity | |
parent | 6999a50efaaf802ccd4c7eb7957af17cc32602be (diff) |
fdo#46808, Convert a bunch of comphelper::ComponentContext stuff
.. to Reference<XComponentContext>
mostly in the dbaccess module, but it also affected some other
modules.
Change-Id: I09b3f6fe7a9b33498b11d98b5521b5aeeb8882be
Diffstat (limited to 'connectivity')
-rw-r--r-- | connectivity/source/drivers/jdbc/JConnection.cxx | 8 | ||||
-rw-r--r-- | connectivity/source/drivers/jdbc/JDriver.cxx | 10 | ||||
-rw-r--r-- | connectivity/source/inc/java/sql/Driver.hxx | 8 | ||||
-rw-r--r-- | connectivity/source/manager/mdrivermanager.cxx | 4 |
4 files changed, 14 insertions, 16 deletions
diff --git a/connectivity/source/drivers/jdbc/JConnection.cxx b/connectivity/source/drivers/jdbc/JConnection.cxx index 9207cdb4b5f8..ec2e62bbce4d 100644 --- a/connectivity/source/drivers/jdbc/JConnection.cxx +++ b/connectivity/source/drivers/jdbc/JConnection.cxx @@ -259,7 +259,7 @@ jclass java_sql_Connection::theClass = 0; java_sql_Connection::java_sql_Connection( const java_sql_Driver& _rDriver ) :java_lang_Object() ,OSubComponent<java_sql_Connection, java_sql_Connection_BASE>((::cppu::OWeakObject*)(&_rDriver), this) - ,m_xContext( _rDriver.getContext().getUNOContext() ) + ,m_xContext( _rDriver.getContext() ) ,m_pDriver( &_rDriver ) ,m_pDriverobject(NULL) ,m_pDriverClassLoader() @@ -470,7 +470,7 @@ Reference< XStatement > SAL_CALL java_sql_Connection::createStatement( ) throw( { try { - OSQLParser aParser( m_pDriver->getContext().getUNOContext() ); + OSQLParser aParser( m_pDriver->getContext() ); ::rtl::OUString sErrorMessage; ::rtl::OUString sNewSql; OSQLParseNode* pNode = aParser.parseTree(sErrorMessage,_sSQL); @@ -702,7 +702,7 @@ void java_sql_Connection::loadDriverFromProperties( const ::rtl::OUString& _sDri LocalRef< jobject > driverClassLoader(t.env()); loadClass( - m_pDriver->getContext().getUNOContext(), + m_pDriver->getContext(), t.env(), _sDriverClassPath, _sDriverClass, &driverClassLoader, &driverClass ); m_pDriverClassLoader.set( driverClassLoader ); @@ -759,7 +759,7 @@ void java_sql_Connection::loadDriverFromProperties( const ::rtl::OUString& _sDri { static const ::rtl::OUString s_sNodeName("org.openoffice.Office.DataAccess/JDBC/DriverClassPaths"); ::utl::OConfigurationTreeRoot aNamesRoot = ::utl::OConfigurationTreeRoot::createWithComponentContext( - m_pDriver->getContext().getUNOContext(), s_sNodeName, -1, ::utl::OConfigurationTreeRoot::CM_READONLY); + m_pDriver->getContext(), s_sNodeName, -1, ::utl::OConfigurationTreeRoot::CM_READONLY); ::rtl::OUString sURL; if ( aNamesRoot.isValid() && aNamesRoot.hasByName( _sDriverClass ) ) { diff --git a/connectivity/source/drivers/jdbc/JDriver.cxx b/connectivity/source/drivers/jdbc/JDriver.cxx index 2e03671dcdf6..d99dfee7d22c 100644 --- a/connectivity/source/drivers/jdbc/JDriver.cxx +++ b/connectivity/source/drivers/jdbc/JDriver.cxx @@ -30,7 +30,7 @@ #include "resource/jdbc_log.hrc" #include "resource/common_res.hrc" #include "resource/sharedresources.hxx" -#include <comphelper/componentcontext.hxx> +#include <comphelper/processfactory.hxx> using namespace connectivity; using namespace ::com::sun::star::uno; @@ -40,9 +40,9 @@ using namespace ::com::sun::star::container; using namespace ::com::sun::star::lang; // ------------------------------------------------------------------------- -java_sql_Driver::java_sql_Driver(const Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory) - :m_aContext( _rxFactory ) - ,m_aLogger( m_aContext.getUNOContext(), "sdbcl", "org.openoffice.sdbc.jdbcBridge" ) +java_sql_Driver::java_sql_Driver(const Reference< ::com::sun::star::uno::XComponentContext >& _rxContext) + :m_aContext( _rxContext ) + ,m_aLogger( _rxContext, "sdbcl", "org.openoffice.sdbc.jdbcBridge" ) { } // -------------------------------------------------------------------------------- @@ -68,7 +68,7 @@ Sequence< ::rtl::OUString > java_sql_Driver::getSupportedServiceNames_Static( ) //------------------------------------------------------------------ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL connectivity::java_sql_Driver_CreateInstance(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory) throw( ::com::sun::star::uno::Exception ) { - return *(new java_sql_Driver(_rxFactory)); + return *(new java_sql_Driver( comphelper::getComponentContext(_rxFactory))); } // -------------------------------------------------------------------------------- ::rtl::OUString SAL_CALL java_sql_Driver::getImplementationName( ) throw(RuntimeException) diff --git a/connectivity/source/inc/java/sql/Driver.hxx b/connectivity/source/inc/java/sql/Driver.hxx index 6c272e2dc39d..838ce18ef542 100644 --- a/connectivity/source/inc/java/sql/Driver.hxx +++ b/connectivity/source/inc/java/sql/Driver.hxx @@ -24,10 +24,8 @@ #include "java/lang/Object.hxx" #include <cppuhelper/implbase2.hxx> #include <com/sun/star/lang/XServiceInfo.hpp> -#include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <comphelper/logging.hxx> -#include <comphelper/componentcontext.hxx> namespace connectivity { @@ -35,14 +33,14 @@ namespace connectivity class java_sql_Driver : public ::cppu::WeakImplHelper2< ::com::sun::star::sdbc::XDriver,::com::sun::star::lang::XServiceInfo> { - ::comphelper::ComponentContext m_aContext; + css::uno::Reference<css::uno::XComponentContext> m_aContext; ::comphelper::ResourceBasedEventLogger m_aLogger; protected: virtual ~java_sql_Driver(); public: - java_sql_Driver(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory); + java_sql_Driver(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext); static rtl::OUString getImplementationName_Static( ) throw(::com::sun::star::uno::RuntimeException); static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static( ) throw (::com::sun::star::uno::RuntimeException); @@ -59,7 +57,7 @@ namespace connectivity virtual sal_Int32 SAL_CALL getMajorVersion( ) throw(::com::sun::star::uno::RuntimeException) ; virtual sal_Int32 SAL_CALL getMinorVersion( ) throw(::com::sun::star::uno::RuntimeException); - const ::comphelper::ComponentContext& getContext() const { return m_aContext; } + const css::uno::Reference<css::uno::XComponentContext>& getContext() const { return m_aContext; } const ::comphelper::ResourceBasedEventLogger& getLogger() const { return m_aLogger; } }; diff --git a/connectivity/source/manager/mdrivermanager.cxx b/connectivity/source/manager/mdrivermanager.cxx index 68411e75c778..a763d9ff90d5 100644 --- a/connectivity/source/manager/mdrivermanager.cxx +++ b/connectivity/source/manager/mdrivermanager.cxx @@ -30,6 +30,7 @@ #include <tools/diagnose_ex.h> #include <comphelper/extract.hxx> #include <comphelper/stl_types.hxx> +#include <comphelper/processfactory.hxx> #include <cppuhelper/implbase1.hxx> #include <cppuhelper/weakref.hxx> #include <osl/diagnose.h> @@ -534,8 +535,7 @@ Sequence< ::rtl::OUString > SAL_CALL OSDBCDriverManager::getSupportedServiceName //-------------------------------------------------------------------------- Reference< XInterface > SAL_CALL OSDBCDriverManager::Create( const Reference< XMultiServiceFactory >& _rxFactory ) { - ::comphelper::ComponentContext aContext( _rxFactory ); - return *( new OSDBCDriverManager( aContext.getUNOContext() ) ); + return *( new OSDBCDriverManager( comphelper::getComponentContext(_rxFactory) ) ); } //-------------------------------------------------------------------------- |