diff options
Diffstat (limited to 'connectivity/source')
-rw-r--r-- | connectivity/source/commontools/ParamterSubstitution.cxx | 3 | ||||
-rw-r--r-- | connectivity/source/commontools/predicateinput.cxx | 19 | ||||
-rw-r--r-- | connectivity/source/drivers/file/FStatement.cxx | 3 | ||||
-rw-r--r-- | connectivity/source/drivers/flat/ETable.cxx | 2 | ||||
-rw-r--r-- | connectivity/source/drivers/jdbc/JConnection.cxx | 2 | ||||
-rw-r--r-- | connectivity/source/drivers/kab/KDriver.hxx | 5 | ||||
-rw-r--r-- | connectivity/source/drivers/kab/KStatement.cxx | 2 | ||||
-rw-r--r-- | connectivity/source/drivers/mork/MStatement.cxx | 3 | ||||
-rw-r--r-- | connectivity/source/drivers/odbcbase/OPreparedStatement.cxx | 3 | ||||
-rw-r--r-- | connectivity/source/parse/sqlnode.cxx | 13 | ||||
-rw-r--r-- | connectivity/source/simpledbt/dbtfactory.cxx | 4 | ||||
-rw-r--r-- | connectivity/source/simpledbt/dbtfactory.hxx | 2 | ||||
-rw-r--r-- | connectivity/source/simpledbt/parser_s.cxx | 4 | ||||
-rw-r--r-- | connectivity/source/simpledbt/parser_s.hxx | 2 |
14 files changed, 35 insertions, 32 deletions
diff --git a/connectivity/source/commontools/ParamterSubstitution.cxx b/connectivity/source/commontools/ParamterSubstitution.cxx index 5a31a9308cab..68f1e163c7be 100644 --- a/connectivity/source/commontools/ParamterSubstitution.cxx +++ b/connectivity/source/commontools/ParamterSubstitution.cxx @@ -86,8 +86,7 @@ namespace connectivity { try { - uno::Reference< XMultiServiceFactory> xFac(m_xContext->getServiceManager(),uno::UNO_QUERY_THROW); - OSQLParser aParser( xFac ); + OSQLParser aParser( m_xContext ); ::rtl::OUString sErrorMessage; ::rtl::OUString sNewSql; OSQLParseNode* pNode = aParser.parseTree(sErrorMessage,_sText); diff --git a/connectivity/source/commontools/predicateinput.cxx b/connectivity/source/commontools/predicateinput.cxx index f8f89601f21c..8b6220ba6107 100644 --- a/connectivity/source/commontools/predicateinput.cxx +++ b/connectivity/source/commontools/predicateinput.cxx @@ -39,12 +39,12 @@ namespace dbtools //......................................................................... using ::com::sun::star::sdbc::XConnection; - using ::com::sun::star::lang::XMultiServiceFactory; using ::com::sun::star::util::XNumberFormatsSupplier; using ::com::sun::star::util::NumberFormatter; using ::com::sun::star::util::XNumberFormatter; 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::beans::XPropertySet; using ::com::sun::star::beans::XPropertySetInfo; using ::com::sun::star::lang::Locale; @@ -100,19 +100,18 @@ namespace dbtools //--------------------------------------------------------------------- OPredicateInputController::OPredicateInputController( - const Reference< XMultiServiceFactory >& _rxORB, const Reference< XConnection >& _rxConnection, const IParseContext* _pParseContext ) - :m_xORB( _rxORB ) - ,m_xConnection( _rxConnection ) - ,m_aParser( m_xORB, _pParseContext ) + const Reference< XComponentContext >& rxContext, const Reference< XConnection >& _rxConnection, const IParseContext* _pParseContext ) + : m_xConnection( _rxConnection ) + ,m_aParser( rxContext, _pParseContext ) { try { // create a number formatter / number formats supplier pair - OSL_ENSURE( m_xORB.is(), "OPredicateInputController::OPredicateInputController: need a service factory!" ); - if ( m_xORB.is() ) + OSL_ENSURE( rxContext.is(), "OPredicateInputController::OPredicateInputController: need a service factory!" ); + if ( rxContext.is() ) { m_xFormatter = Reference< XNumberFormatter >( - NumberFormatter::create(comphelper::getComponentContext(m_xORB)), + NumberFormatter::create(rxContext), UNO_QUERY_THROW ); } @@ -124,9 +123,9 @@ namespace dbtools m_xFormatter->attachNumberFormatsSupplier( xNumberFormats ); // create the locale data - if ( m_xORB.is() ) + if ( rxContext.is() ) { - m_xLocaleData = LocaleData::create( comphelper::getComponentContext(m_xORB) ); + m_xLocaleData = LocaleData::create( rxContext ); } } catch( const Exception& ) diff --git a/connectivity/source/drivers/file/FStatement.cxx b/connectivity/source/drivers/file/FStatement.cxx index c606bbfe9dfc..49c604664d9b 100644 --- a/connectivity/source/drivers/file/FStatement.cxx +++ b/connectivity/source/drivers/file/FStatement.cxx @@ -29,6 +29,7 @@ #include <com/sun/star/sdbc/ResultSetType.hpp> #include <com/sun/star/sdbc/FetchDirection.hpp> #include <com/sun/star/lang/DisposedException.hpp> +#include <comphelper/processfactory.hxx> #include <comphelper/sequence.hxx> #include <cppuhelper/typeprovider.hxx> #include "connectivity/dbexception.hxx" @@ -57,7 +58,7 @@ OStatement_Base::OStatement_Base(OConnection* _pConnection ) :OStatement_BASE(m_aMutex) ,::comphelper::OPropertyContainer(OStatement_BASE::rBHelper) ,m_xDBMetaData(_pConnection->getMetaData()) - ,m_aParser(_pConnection->getDriver()->getFactory()) + ,m_aParser( comphelper::getComponentContext(_pConnection->getDriver()->getFactory()) ) ,m_aSQLIterator( _pConnection, _pConnection->createCatalog()->getTables(), m_aParser, NULL ) ,m_pConnection(_pConnection) ,m_pParseTree(NULL) diff --git a/connectivity/source/drivers/flat/ETable.cxx b/connectivity/source/drivers/flat/ETable.cxx index 110f40195be4..0d57cb18b971 100644 --- a/connectivity/source/drivers/flat/ETable.cxx +++ b/connectivity/source/drivers/flat/ETable.cxx @@ -109,7 +109,7 @@ void OFlatTable::fillColumns(const ::com::sun::star::lang::Locale& _aLocale) m_aScales.assign(nFieldCount+1,-1); const sal_Bool bCase = m_pConnection->getMetaData()->supportsMixedCaseQuotedIdentifiers(); - CharClass aCharClass(pConnection->getDriver()->getFactory(),_aLocale); + CharClass aCharClass( comphelper::getComponentContext(pConnection->getDriver()->getFactory()), _aLocale); // read description const sal_Unicode cDecimalDelimiter = pConnection->getDecimalDelimiter(); const sal_Unicode cThousandDelimiter = pConnection->getThousandDelimiter(); diff --git a/connectivity/source/drivers/jdbc/JConnection.cxx b/connectivity/source/drivers/jdbc/JConnection.cxx index 6921c0d96050..a814c1b6665d 100644 --- a/connectivity/source/drivers/jdbc/JConnection.cxx +++ b/connectivity/source/drivers/jdbc/JConnection.cxx @@ -469,7 +469,7 @@ Reference< XStatement > SAL_CALL java_sql_Connection::createStatement( ) throw( { try { - OSQLParser aParser( m_pDriver->getContext().getLegacyServiceFactory() ); + OSQLParser aParser( m_pDriver->getContext().getUNOContext() ); ::rtl::OUString sErrorMessage; ::rtl::OUString sNewSql; OSQLParseNode* pNode = aParser.parseTree(sErrorMessage,_sSQL); diff --git a/connectivity/source/drivers/kab/KDriver.hxx b/connectivity/source/drivers/kab/KDriver.hxx index b51058151279..1243f7425185 100644 --- a/connectivity/source/drivers/kab/KDriver.hxx +++ b/connectivity/source/drivers/kab/KDriver.hxx @@ -23,6 +23,7 @@ #include <com/sun/star/sdbc/XDriver.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/frame/XTerminateListener.hpp> +#include <comphelper/processfactory.hxx> #include <cppuhelper/compbase3.hxx> #include <osl/module.h> @@ -161,8 +162,8 @@ namespace connectivity 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); - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& - getMSFactory() const { return m_xMSFactory; } + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > + getComponentContext() const { return comphelper::getComponentContext(m_xMSFactory); } /** returns the driver's implementation name (being pure ASCII) for reference in various places */ diff --git a/connectivity/source/drivers/kab/KStatement.cxx b/connectivity/source/drivers/kab/KStatement.cxx index e898ee48f62f..a5babf0c2de3 100644 --- a/connectivity/source/drivers/kab/KStatement.cxx +++ b/connectivity/source/drivers/kab/KStatement.cxx @@ -62,7 +62,7 @@ IMPLEMENT_SERVICE_INFO(KabStatement, "com.sun.star.sdbc.drivers.KabStatement", " KabCommonStatement::KabCommonStatement(KabConnection* _pConnection ) : KabCommonStatement_BASE(m_aMutex), OPropertySetHelper(KabCommonStatement_BASE::rBHelper), - m_aParser(_pConnection->getDriver()->getMSFactory()), + m_aParser(_pConnection->getDriver()->getComponentContext()), m_aSQLIterator(_pConnection, _pConnection->createCatalog()->getTables(), m_aParser, NULL ), m_pParseTree(NULL), m_pConnection(_pConnection), diff --git a/connectivity/source/drivers/mork/MStatement.cxx b/connectivity/source/drivers/mork/MStatement.cxx index 342ac2add17b..2beacfecd95a 100644 --- a/connectivity/source/drivers/mork/MStatement.cxx +++ b/connectivity/source/drivers/mork/MStatement.cxx @@ -30,6 +30,7 @@ #include <com/sun/star/lang/DisposedException.hpp> #include <comphelper/sequence.hxx> #include <cppuhelper/typeprovider.hxx> +#include <comphelper/processfactory.hxx> #include <comphelper/extract.hxx> #include <comphelper/types.hxx> #include <connectivity/dbexception.hxx> @@ -79,7 +80,7 @@ OCommonStatement::OCommonStatement(OConnection* _pConnection ) ,OCommonStatement_SBASE((::cppu::OWeakObject*)_pConnection, this) ,m_pTable(NULL) ,m_pConnection(_pConnection) - ,m_aParser(_pConnection->getDriver()->getFactory()) + ,m_aParser( comphelper::getComponentContext(_pConnection->getDriver()->getFactory()) ) ,m_pSQLIterator( new OSQLParseTreeIterator( _pConnection, _pConnection->createCatalog()->getTables(), m_aParser, NULL ) ) ,rBHelper(OCommonStatement_IBASE::rBHelper) { diff --git a/connectivity/source/drivers/odbcbase/OPreparedStatement.cxx b/connectivity/source/drivers/odbcbase/OPreparedStatement.cxx index 206369840936..f5c05b80f76f 100644 --- a/connectivity/source/drivers/odbcbase/OPreparedStatement.cxx +++ b/connectivity/source/drivers/odbcbase/OPreparedStatement.cxx @@ -30,6 +30,7 @@ #include "odbc/OResultSet.hxx" #include "odbc/OResultSetMetaData.hxx" #include <cppuhelper/typeprovider.hxx> +#include <comphelper/processfactory.hxx> #include <comphelper/sequence.hxx> #include <com/sun/star/lang/DisposedException.hpp> #include "connectivity/dbtools.hxx" @@ -73,7 +74,7 @@ OPreparedStatement::OPreparedStatement( OConnection* _pConnection,const ::rtl::O { if(_pConnection->isParameterSubstitutionEnabled()) { - OSQLParser aParser(_pConnection->getDriver()->getORB()); + OSQLParser aParser( comphelper::getComponentContext(_pConnection->getDriver()->getORB()) ); ::rtl::OUString sErrorMessage; ::rtl::OUString sNewSql; ::std::auto_ptr<OSQLParseNode> pNode( aParser.parseTree(sErrorMessage,sql) ); diff --git a/connectivity/source/parse/sqlnode.cxx b/connectivity/source/parse/sqlnode.cxx index daf8ff5e768a..73fd5101c7cb 100644 --- a/connectivity/source/parse/sqlnode.cxx +++ b/connectivity/source/parse/sqlnode.cxx @@ -44,6 +44,7 @@ #include <com/sun/star/util/NumberFormat.hpp> #include <com/sun/star/i18n/KParseType.hpp> #include <com/sun/star/i18n/KParseTokens.hpp> +#include <com/sun/star/i18n/CharacterClassification.hpp> #include "connectivity/dbconversion.hxx" #include <com/sun/star/util/DateTime.hpp> #include <com/sun/star/util/Time.hpp> @@ -1068,8 +1069,8 @@ OSQLParseNode* OSQLParser::buildNode_STR_NUM(OSQLParseNode*& _pLiteral) { ::rtl::OUString aValue; if(!m_xCharClass.is()) - m_xCharClass = Reference<XCharacterClassification>(m_xServiceFactory->createInstance(::rtl::OUString("com.sun.star.i18n.CharacterClassification")),UNO_QUERY); - if(m_xCharClass.is() && s_xLocaleData.is()) + m_xCharClass = CharacterClassification::create( m_xContext ); + if( s_xLocaleData.is() ) { try { @@ -1259,13 +1260,13 @@ OSQLParseNode* OSQLParser::predicateTree(::rtl::OUString& rErrorMessage, const : //============================================================================= //----------------------------------------------------------------------------- -OSQLParser::OSQLParser(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _xServiceFactory,const IParseContext* _pContext) +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( _xServiceFactory ) ) + ,m_pData( new OSQLParser_Data( uno::Reference<lang::XMultiServiceFactory>(rxContext->getServiceManager(), uno::UNO_QUERY_THROW) ) ) ,m_nFormatKey(0) ,m_nDateFormatKey(0) - ,m_xServiceFactory(_xServiceFactory) + ,m_xContext(rxContext) { @@ -1286,7 +1287,7 @@ OSQLParser::OSQLParser(const ::com::sun::star::uno::Reference< ::com::sun::star: s_pGarbageCollector = new OSQLParseNodesGarbageCollector(); if(!s_xLocaleData.is()) - s_xLocaleData = LocaleData::create(comphelper::getComponentContext(m_xServiceFactory)); + s_xLocaleData = LocaleData::create(m_xContext); // reset to 0 memset(OSQLParser::s_nRuleIDs,0,sizeof(OSQLParser::s_nRuleIDs[0]) * (OSQLParseNode::rule_count+1)); diff --git a/connectivity/source/simpledbt/dbtfactory.cxx b/connectivity/source/simpledbt/dbtfactory.cxx index 616a7fa6dded..29d000423ed0 100644 --- a/connectivity/source/simpledbt/dbtfactory.cxx +++ b/connectivity/source/simpledbt/dbtfactory.cxx @@ -94,9 +94,9 @@ namespace connectivity SAL_WNODEPRECATED_DECLARATIONS_POP //---------------------------------------------------------------- - ::rtl::Reference< simple::ISQLParser > ODataAccessToolsFactory::createSQLParser(const Reference< XMultiServiceFactory >& _rxServiceFactory,const IParseContext* _pContext) const + ::rtl::Reference< simple::ISQLParser > ODataAccessToolsFactory::createSQLParser(const Reference< XComponentContext >& rxContext, const IParseContext* _pContext) const { - return new OSimpleSQLParser(_rxServiceFactory,_pContext); + return new OSimpleSQLParser(rxContext, _pContext); } //........................................................................ diff --git a/connectivity/source/simpledbt/dbtfactory.hxx b/connectivity/source/simpledbt/dbtfactory.hxx index ba9d9c7e532f..40005ecbdd9f 100644 --- a/connectivity/source/simpledbt/dbtfactory.hxx +++ b/connectivity/source/simpledbt/dbtfactory.hxx @@ -44,7 +44,7 @@ namespace connectivity // IDataAccessToolsFactory virtual ::rtl::Reference< simple::ISQLParser > createSQLParser( - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxServiceFactory, + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext, const IParseContext* _pContext ) const; diff --git a/connectivity/source/simpledbt/parser_s.cxx b/connectivity/source/simpledbt/parser_s.cxx index 302099d53622..b49c4bfe9a49 100644 --- a/connectivity/source/simpledbt/parser_s.cxx +++ b/connectivity/source/simpledbt/parser_s.cxx @@ -35,8 +35,8 @@ namespace connectivity //= OSimpleSQLParser //================================================================ //---------------------------------------------------------------- - OSimpleSQLParser::OSimpleSQLParser(const Reference< XMultiServiceFactory >& _rxServiceFactory,const IParseContext* _pContext) - :m_aFullParser(_rxServiceFactory,_pContext) + OSimpleSQLParser::OSimpleSQLParser(const Reference< XComponentContext >& rxContext, const IParseContext* _pContext) + :m_aFullParser(rxContext, _pContext) { } diff --git a/connectivity/source/simpledbt/parser_s.hxx b/connectivity/source/simpledbt/parser_s.hxx index 6d2555e7b099..155ef739b233 100644 --- a/connectivity/source/simpledbt/parser_s.hxx +++ b/connectivity/source/simpledbt/parser_s.hxx @@ -40,7 +40,7 @@ namespace connectivity OSQLParser m_aFullParser; public: - OSimpleSQLParser(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxServiceFactory,const IParseContext* _pContext); + OSimpleSQLParser(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext, const IParseContext* _pContext); // ISQLParser virtual ::rtl::Reference< simple::ISQLParseNode > predicateTree( |