diff options
author | Noel Grandin <noel@peralex.com> | 2012-12-03 13:55:06 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2012-12-10 08:05:49 +0200 |
commit | b9a4a0b9658015a0d55c42de1f5e56941e20d268 (patch) | |
tree | d5d377f24ee3377fdf6f912415b382b2d3e85070 /connectivity | |
parent | 9fc4553b6433fbb6565a5b946c4256c0bfe345f1 (diff) |
fdo#46808, Convert connectivity::SQLError to use XComponentContext...
...instead of comphelper::ComponentContext.
Change-Id: I40384c2d7cfcabd06506321d686dd8e7c7c5f266
Diffstat (limited to 'connectivity')
-rw-r--r-- | connectivity/inc/connectivity/sqlerror.hxx | 5 | ||||
-rw-r--r-- | connectivity/inc/connectivity/sqlparse.hxx | 4 | ||||
-rw-r--r-- | connectivity/source/commontools/sqlerror.cxx | 15 | ||||
-rw-r--r-- | connectivity/source/drivers/evoab2/NResultSet.cxx | 2 | ||||
-rw-r--r-- | connectivity/source/drivers/mork/MConnection.cxx | 3 | ||||
-rw-r--r-- | connectivity/source/drivers/mozab/MConnection.cxx | 3 | ||||
-rw-r--r-- | connectivity/source/parse/sqlnode.cxx | 4 |
7 files changed, 19 insertions, 17 deletions
diff --git a/connectivity/inc/connectivity/sqlerror.hxx b/connectivity/inc/connectivity/sqlerror.hxx index 9cfaffc62e1e..fae9b2a05870 100644 --- a/connectivity/inc/connectivity/sqlerror.hxx +++ b/connectivity/inc/connectivity/sqlerror.hxx @@ -21,8 +21,7 @@ #define CONNECTIVITY_SQLERROR_HXX #include <com/sun/star/sdbc/SQLException.hpp> - -#include <comphelper/componentcontext.hxx> +#include <com/sun/star/uno/XComponentContext.hpp> #include <boost/shared_ptr.hpp> #include <boost/optional.hpp> @@ -82,7 +81,7 @@ namespace connectivity public: - explicit SQLError( const ::comphelper::ComponentContext& _rContext ); + explicit SQLError( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > & _rxContext ); ~SQLError(); /** returns the message associated with a given error condition, after (optionally) replacing diff --git a/connectivity/inc/connectivity/sqlparse.hxx b/connectivity/inc/connectivity/sqlparse.hxx index e67aa7d034ce..45357d280fbf 100644 --- a/connectivity/inc/connectivity/sqlparse.hxx +++ b/connectivity/inc/connectivity/sqlparse.hxx @@ -124,8 +124,8 @@ namespace connectivity ::com::sun::star::lang::Locale aLocale; ::connectivity::SQLError aErrors; - OSQLParser_Data( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _xServiceFactory ) - :aErrors( _xServiceFactory ) + OSQLParser_Data( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext ) + :aErrors( _rxContext ) { } }; diff --git a/connectivity/source/commontools/sqlerror.cxx b/connectivity/source/commontools/sqlerror.cxx index 90cbd97c9bf2..7a10ad2318d7 100644 --- a/connectivity/source/commontools/sqlerror.cxx +++ b/connectivity/source/commontools/sqlerror.cxx @@ -42,6 +42,7 @@ namespace connectivity using ::com::sun::star::uno::Any; using ::com::sun::star::uno::makeAny; using ::com::sun::star::uno::XInterface; + using ::com::sun::star::uno::XComponentContext; using ::com::sun::star::sdbc::SQLException; using ::com::sun::star::uno::Type; /** === end UNO using === **/ @@ -58,7 +59,7 @@ namespace connectivity class SQLError_Impl { public: - SQLError_Impl( const ::comphelper::ComponentContext& _rContext ); + SQLError_Impl( const Reference<XComponentContext> & _rxContext ); ~SQLError_Impl(); // versions of the public SQLError methods which are just delegated to this impl-class @@ -90,7 +91,7 @@ namespace connectivity private: ::osl::Mutex m_aMutex; - ::comphelper::ComponentContext m_aContext; + Reference<XComponentContext> m_aContext; ::std::auto_ptr< ::comphelper::OfficeResourceBundle > m_pResources; bool m_bAttemptedInit; }; @@ -99,8 +100,8 @@ namespace connectivity //= SQLError_Impl - implementation //==================================================================== //-------------------------------------------------------------------- - SQLError_Impl::SQLError_Impl( const ::comphelper::ComponentContext& _rContext ) - :m_aContext( _rContext ) + SQLError_Impl::SQLError_Impl( const Reference<XComponentContext> & _rxContext ) + :m_aContext( _rxContext ) ,m_pResources( ) ,m_bAttemptedInit( false ) { @@ -278,7 +279,7 @@ namespace connectivity ::osl::MutexGuard aGuard( m_aMutex ); m_bAttemptedInit = true; - m_pResources.reset( new ::comphelper::OfficeResourceBundle( m_aContext.getUNOContext(), "sdberr" ) ); + m_pResources.reset( new ::comphelper::OfficeResourceBundle( m_aContext, "sdberr" ) ); return m_pResources.get() != NULL; } @@ -286,8 +287,8 @@ namespace connectivity //= SQLError //==================================================================== //-------------------------------------------------------------------- - SQLError::SQLError( const ::comphelper::ComponentContext& _rContext ) - :m_pImpl( new SQLError_Impl( _rContext ) ) + SQLError::SQLError( const Reference<XComponentContext> & _rxContext ) + :m_pImpl( new SQLError_Impl( _rxContext ) ) { } diff --git a/connectivity/source/drivers/evoab2/NResultSet.cxx b/connectivity/source/drivers/evoab2/NResultSet.cxx index b5f46408afa9..9b220dcd7090 100644 --- a/connectivity/source/drivers/evoab2/NResultSet.cxx +++ b/connectivity/source/drivers/evoab2/NResultSet.cxx @@ -519,7 +519,7 @@ void OEvoabResultSet::construct( const QueryData& _rData ) case eFilterNone: if ( !isLocal( pBook ) ) { - SQLError aErrorFactory( m_pConnection->getDriver().getMSFactory() ); + SQLError aErrorFactory( comphelper::getComponentContext(m_pConnection->getDriver().getMSFactory()) ); SQLException aAsException = aErrorFactory.getSQLException( ErrorCondition::DATA_CANNOT_SELECT_UNFILTERED, *this ); m_aWarnings.appendWarning( SQLWarning( aAsException.Message, diff --git a/connectivity/source/drivers/mork/MConnection.cxx b/connectivity/source/drivers/mork/MConnection.cxx index 47525d2f946b..9c9c8edfbfd3 100644 --- a/connectivity/source/drivers/mork/MConnection.cxx +++ b/connectivity/source/drivers/mork/MConnection.cxx @@ -28,6 +28,7 @@ #include <com/sun/star/sdbc/TransactionIsolation.hpp> #include <comphelper/officeresourcebundle.hxx> +#include <comphelper/processfactory.hxx> using namespace dbtools; @@ -382,7 +383,7 @@ void OConnection::throwSQLException( const ErrorDescriptor& _rError, const Refer if ( _rError.getErrorCondition() != 0 ) { - SQLError aErrorHelper( getDriver()->getFactory() ); + SQLError aErrorHelper( comphelper::getComponentContext(getDriver()->getFactory()) ); ::rtl::OUString sParameter( _rError.getParameter() ); if ( !sParameter.isEmpty() ) aErrorHelper.raiseException( _rError.getErrorCondition(), _rxContext, sParameter ); diff --git a/connectivity/source/drivers/mozab/MConnection.cxx b/connectivity/source/drivers/mozab/MConnection.cxx index 5ccf57b9ecf8..af6d57b8eb7b 100644 --- a/connectivity/source/drivers/mozab/MConnection.cxx +++ b/connectivity/source/drivers/mozab/MConnection.cxx @@ -38,6 +38,7 @@ #include <com/sun/star/sdbc/TransactionIsolation.hpp> #include <comphelper/officeresourcebundle.hxx> +#include <comphelper/processfactory.hxx> #if OSL_DEBUG_LEVEL > 0 # define OUtoCStr( x ) ( ::rtl::OUStringToOString ( (x), RTL_TEXTENCODING_ASCII_US).getStr()) @@ -571,7 +572,7 @@ void OConnection::throwSQLException( const ErrorDescriptor& _rError, const Refer if ( _rError.getErrorCondition() != 0 ) { - SQLError aErrorHelper( getDriver()->getMSFactory() ); + SQLError aErrorHelper( comphelper::getComponentContext(getDriver()->getMSFactory()) ); ::rtl::OUString sParameter( _rError.getParameter() ); if ( !sParameter.isEmpty() ) aErrorHelper.raiseException( _rError.getErrorCondition(), _rxContext, sParameter ); diff --git a/connectivity/source/parse/sqlnode.cxx b/connectivity/source/parse/sqlnode.cxx index 73fd5101c7cb..ae9f3f1fe72a 100644 --- a/connectivity/source/parse/sqlnode.cxx +++ b/connectivity/source/parse/sqlnode.cxx @@ -571,7 +571,7 @@ bool OSQLParseNode::impl_parseTableNameNodeToString_throw( ::rtl::OUStringBuffer } else { - SQLError aErrors( ::comphelper::getProcessServiceFactory() ); + SQLError aErrors( ::comphelper::getProcessComponentContext() ); aErrors.raiseException( sdb::ErrorCondition::PARSER_CYCLIC_SUB_QUERIES ); } } @@ -1263,7 +1263,7 @@ OSQLParseNode* OSQLParser::predicateTree(::rtl::OUString& rErrorMessage, const : OSQLParser::OSQLParser(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext, const IParseContext* _pContext) :m_pContext(_pContext) ,m_pParseTree(NULL) - ,m_pData( new OSQLParser_Data( uno::Reference<lang::XMultiServiceFactory>(rxContext->getServiceManager(), uno::UNO_QUERY_THROW) ) ) + ,m_pData( new OSQLParser_Data( rxContext ) ) ,m_nFormatKey(0) ,m_nDateFormatKey(0) ,m_xContext(rxContext) |