From 2b91dc3ae674648da6909b0ab96129a7d7d3ed39 Mon Sep 17 00:00:00 2001 From: Marcos Paulo de Souza Date: Wed, 9 Oct 2013 08:34:12 -0300 Subject: fdo#54938: Adapt connectivity module to use cppu::supportsService Change-Id: I885b4c7a60ff51d44138c4f8a56a584c38a9804a Reviewed-on: https://gerrit.libreoffice.org/6172 Reviewed-by: Stephan Bergmann Tested-by: Stephan Bergmann --- .../source/commontools/FDatabaseMetaDataResultSet.cxx | 10 ++-------- connectivity/source/commontools/ParamterSubstitution.cxx | 11 +++-------- connectivity/source/cpool/ZPoolCollection.cxx | 10 ++-------- connectivity/source/drivers/ado/ADriver.cxx | 11 ++--------- connectivity/source/drivers/ado/AResultSet.cxx | 11 +++-------- connectivity/source/drivers/calc/CResultSet.cxx | 11 +++-------- connectivity/source/drivers/dbase/DResultSet.cxx | 11 +++-------- connectivity/source/drivers/evoab2/NDriver.cxx | 11 +++-------- connectivity/source/drivers/evoab2/NResultSet.cxx | 11 +++-------- connectivity/source/drivers/file/FDriver.cxx | 10 ++-------- connectivity/source/drivers/firebird/Driver.cxx | 9 ++------- connectivity/source/drivers/firebird/ResultSet.cxx | 9 ++------- connectivity/source/drivers/flat/EResultSet.cxx | 11 +++-------- connectivity/source/drivers/hsqldb/HDriver.cxx | 10 ++-------- connectivity/source/drivers/jdbc/JDriver.cxx | 10 ++-------- connectivity/source/drivers/kab/KDriver.cxx | 11 +++-------- connectivity/source/drivers/macab/MacabDriver.cxx | 11 +++-------- connectivity/source/drivers/mork/MDriver.cxx | 9 ++------- connectivity/source/drivers/mork/MResultSet.cxx | 11 +++-------- connectivity/source/drivers/mozab/MDriver.cxx | 10 ++-------- connectivity/source/drivers/mozab/MResultSet.cxx | 11 +++-------- .../source/drivers/mozab/bootstrap/MMozillaBootstrap.cxx | 15 ++------------- connectivity/source/drivers/mysql/YDriver.cxx | 10 ++-------- connectivity/source/drivers/odbcbase/ODriver.cxx | 10 ++-------- connectivity/source/drivers/odbcbase/OResultSet.cxx | 11 +++-------- connectivity/source/drivers/postgresql/pq_driver.cxx | 7 ++----- connectivity/source/drivers/postgresql/pq_xbase.cxx | 6 ++---- connectivity/source/manager/mdrivermanager.cxx | 10 ++-------- connectivity/source/sdbcx/VColumn.cxx | 11 +++-------- connectivity/source/sdbcx/VIndex.cxx | 13 ++++--------- connectivity/source/sdbcx/VIndexColumn.cxx | 11 +++-------- connectivity/source/sdbcx/VKey.cxx | 13 ++++--------- connectivity/source/sdbcx/VKeyColumn.cxx | 11 +++-------- connectivity/source/sdbcx/VTable.cxx | 12 +++--------- 34 files changed, 88 insertions(+), 271 deletions(-) (limited to 'connectivity') diff --git a/connectivity/source/commontools/FDatabaseMetaDataResultSet.cxx b/connectivity/source/commontools/FDatabaseMetaDataResultSet.cxx index 9373481eabdf..102a4f670ee0 100644 --- a/connectivity/source/commontools/FDatabaseMetaDataResultSet.cxx +++ b/connectivity/source/commontools/FDatabaseMetaDataResultSet.cxx @@ -36,6 +36,7 @@ #include #include #include +#include #include "connectivity/dbexception.hxx" #include "resource/common_res.hrc" #include "TConnection.hxx" @@ -855,16 +856,9 @@ void SAL_CALL ODatabaseMetaDataResultSet::initialize( const Sequence< Any >& _aA return getImplementationName_Static(); } - //------------------------------------------------------------------ sal_Bool SAL_CALL ODatabaseMetaDataResultSet::supportsService( const OUString& _rServiceName ) throw(RuntimeException) { - Sequence< OUString > aSupported(getSupportedServiceNames()); - const OUString* pSupported = aSupported.getConstArray(); - const OUString* pEnd = pSupported + aSupported.getLength(); - for (;pSupported != pEnd && !pSupported->equals(_rServiceName); ++pSupported) - ; - - return pSupported != pEnd; + return cppu::supportsService(this, _rServiceName); } //------------------------------------------------------------------ Sequence< OUString > SAL_CALL ODatabaseMetaDataResultSet::getSupportedServiceNames( ) throw(RuntimeException) diff --git a/connectivity/source/commontools/ParamterSubstitution.cxx b/connectivity/source/commontools/ParamterSubstitution.cxx index e628a6349d93..57150ad7a49a 100644 --- a/connectivity/source/commontools/ParamterSubstitution.cxx +++ b/connectivity/source/commontools/ParamterSubstitution.cxx @@ -19,6 +19,7 @@ #include "ParameterSubstitution.hxx" #include "connectivity/sqlparse.hxx" #include +#include namespace connectivity { @@ -48,16 +49,10 @@ namespace connectivity { return getImplementationName_Static(); } - //------------------------------------------------------------------ + sal_Bool SAL_CALL ParameterSubstitution::supportsService( const OUString& _rServiceName ) throw(RuntimeException) { - Sequence< OUString > aSupported(getSupportedServiceNames()); - const OUString* pSupported = aSupported.getConstArray(); - const OUString* pEnd = pSupported + aSupported.getLength(); - for (;pSupported != pEnd && !pSupported->equals(_rServiceName); ++pSupported) - ; - - return pSupported != pEnd; + return cppu::supportsService(this, _rServiceName); } //------------------------------------------------------------------ Sequence< OUString > SAL_CALL ParameterSubstitution::getSupportedServiceNames( ) throw(RuntimeException) diff --git a/connectivity/source/cpool/ZPoolCollection.cxx b/connectivity/source/cpool/ZPoolCollection.cxx index 0a5aa4b8e849..1410984f4d92 100644 --- a/connectivity/source/cpool/ZPoolCollection.cxx +++ b/connectivity/source/cpool/ZPoolCollection.cxx @@ -29,6 +29,7 @@ #include #include #include +#include #include #include "diagnose_ex.h" @@ -143,16 +144,9 @@ OUString SAL_CALL OPoolCollection::getImplementationName( ) throw(RuntimeExcept return getImplementationName_Static(); } -//-------------------------------------------------------------------------- sal_Bool SAL_CALL OPoolCollection::supportsService( const OUString& _rServiceName ) throw(RuntimeException) { - Sequence< OUString > aSupported(getSupportedServiceNames()); - const OUString* pSupported = aSupported.getConstArray(); - const OUString* pEnd = pSupported + aSupported.getLength(); - for (;pSupported != pEnd && !pSupported->equals(_rServiceName); ++pSupported) - ; - - return pSupported != pEnd; + return cppu::supportsService(this, _rServiceName); } //-------------------------------------------------------------------------- diff --git a/connectivity/source/drivers/ado/ADriver.cxx b/connectivity/source/drivers/ado/ADriver.cxx index e96311f022ca..b1db42458a54 100644 --- a/connectivity/source/drivers/ado/ADriver.cxx +++ b/connectivity/source/drivers/ado/ADriver.cxx @@ -30,10 +30,10 @@ #include "ado/adoimp.hxx" #include #include "connectivity/dbexception.hxx" +#include #include "resource/ado_res.hrc" #include - #include "resource/sharedresources.hxx" using namespace connectivity; @@ -106,16 +106,9 @@ OUString SAL_CALL ODriver::getImplementationName( ) throw(RuntimeException) return getImplementationName_Static(); } -// -------------------------------------------------------------------------------- sal_Bool SAL_CALL ODriver::supportsService( const OUString& _rServiceName ) throw(RuntimeException) { - Sequence< OUString > aSupported(getSupportedServiceNames()); - const OUString* pSupported = aSupported.getConstArray(); - const OUString* pEnd = pSupported + aSupported.getLength(); - for (;pSupported != pEnd && !pSupported->equals(_rServiceName); ++pSupported) - ; - - return pSupported != pEnd; + return cppu::supportsService(this, _rServiceName); } // -------------------------------------------------------------------------------- diff --git a/connectivity/source/drivers/ado/AResultSet.cxx b/connectivity/source/drivers/ado/AResultSet.cxx index 3ae5f788a221..8994dc16cf85 100644 --- a/connectivity/source/drivers/ado/AResultSet.cxx +++ b/connectivity/source/drivers/ado/AResultSet.cxx @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -64,16 +65,10 @@ OUString SAL_CALL OResultSet::getImplementationName( ) throw (::com::sun::star: aSupported[1] = OUString("com.sun.star.sdbcx.ResultSet"); return aSupported; } -// ------------------------------------------------------------------------- + sal_Bool SAL_CALL OResultSet::supportsService( const OUString& _rServiceName ) throw(::com::sun::star::uno::RuntimeException) { - Sequence< OUString > aSupported(getSupportedServiceNames()); - const OUString* pSupported = aSupported.getConstArray(); - const OUString* pEnd = pSupported + aSupported.getLength(); - for (;pSupported != pEnd && !pSupported->equals(_rServiceName); ++pSupported) - ; - - return pSupported != pEnd; + return cppu::supportsService(this, _rServiceName); } // ------------------------------------------------------------------------- OResultSet::OResultSet(ADORecordset* _pRecordSet,OStatement_Base* pStmt) : OResultSet_BASE(m_aMutex) diff --git a/connectivity/source/drivers/calc/CResultSet.cxx b/connectivity/source/drivers/calc/CResultSet.cxx index d110297ff083..81edb1093888 100644 --- a/connectivity/source/drivers/calc/CResultSet.cxx +++ b/connectivity/source/drivers/calc/CResultSet.cxx @@ -22,6 +22,7 @@ #include #include #include +#include #include using namespace ::comphelper; @@ -54,16 +55,10 @@ Sequence< OUString > SAL_CALL OCalcResultSet::getSupportedServiceNames( ) throw aSupported[1] = OUString("com.sun.star.sdbcx.ResultSet"); return aSupported; } -// ------------------------------------------------------------------------- + sal_Bool SAL_CALL OCalcResultSet::supportsService( const OUString& _rServiceName ) throw( RuntimeException) { - Sequence< OUString > aSupported(getSupportedServiceNames()); - const OUString* pSupported = aSupported.getConstArray(); - const OUString* pEnd = pSupported + aSupported.getLength(); - for (;pSupported != pEnd && !pSupported->equals(_rServiceName); ++pSupported) - ; - - return pSupported != pEnd; + return cppu::supportsService(this, _rServiceName); } // ------------------------------------------------------------------------- Any SAL_CALL OCalcResultSet::queryInterface( const Type & rType ) throw(RuntimeException) diff --git a/connectivity/source/drivers/dbase/DResultSet.cxx b/connectivity/source/drivers/dbase/DResultSet.cxx index b5e0d13563f5..0ae11dd5d27e 100644 --- a/connectivity/source/drivers/dbase/DResultSet.cxx +++ b/connectivity/source/drivers/dbase/DResultSet.cxx @@ -21,6 +21,7 @@ #include "dbase/DResultSet.hxx" #include #include +#include #include "dbase/DIndex.hxx" #include "dbase/DIndexIter.hxx" #include "dbase/DCode.hxx" @@ -58,16 +59,10 @@ Sequence< OUString > SAL_CALL ODbaseResultSet::getSupportedServiceNames( ) thro aSupported[1] = OUString("com.sun.star.sdbcx.ResultSet"); return aSupported; } -// ------------------------------------------------------------------------- + sal_Bool SAL_CALL ODbaseResultSet::supportsService( const OUString& _rServiceName ) throw( RuntimeException) { - Sequence< OUString > aSupported(getSupportedServiceNames()); - const OUString* pSupported = aSupported.getConstArray(); - const OUString* pEnd = pSupported + aSupported.getLength(); - for (;pSupported != pEnd && !pSupported->equals(_rServiceName); ++pSupported) - ; - - return pSupported != pEnd; + return cppu::supportsService(this, _rServiceName); } // ------------------------------------------------------------------------- Any SAL_CALL ODbaseResultSet::queryInterface( const Type & rType ) throw(RuntimeException) diff --git a/connectivity/source/drivers/evoab2/NDriver.cxx b/connectivity/source/drivers/evoab2/NDriver.cxx index 601a111630c5..366ea73df94b 100644 --- a/connectivity/source/drivers/evoab2/NDriver.cxx +++ b/connectivity/source/drivers/evoab2/NDriver.cxx @@ -24,6 +24,7 @@ #include #include "osl/security.hxx" #include +#include #include #include #include @@ -99,16 +100,10 @@ OUString SAL_CALL OEvoabDriver::getImplementationName( ) throw(RuntimeException { return getImplementationName_Static(); } -//------------------------------------------------------------------ + sal_Bool SAL_CALL OEvoabDriver::supportsService( const OUString& _rServiceName ) throw(RuntimeException) { - Sequence< OUString > aSupported(getSupportedServiceNames()); - const OUString* pSupported = aSupported.getConstArray(); - const OUString* pEnd = pSupported + aSupported.getLength(); - for (;pSupported != pEnd && !pSupported->equals(_rServiceName); ++pSupported) - ; - - return pSupported != pEnd; + return cppu::supportsService(this, _rServiceName); } //------------------------------------------------------------------ Sequence< OUString > SAL_CALL OEvoabDriver::getSupportedServiceNames( ) throw(RuntimeException) diff --git a/connectivity/source/drivers/evoab2/NResultSet.cxx b/connectivity/source/drivers/evoab2/NResultSet.cxx index 414d90c7f96d..75743e68a123 100644 --- a/connectivity/source/drivers/evoab2/NResultSet.cxx +++ b/connectivity/source/drivers/evoab2/NResultSet.cxx @@ -38,6 +38,7 @@ #include #include #include +#include #include #include #include @@ -74,16 +75,10 @@ OUString SAL_CALL OEvoabResultSet::getImplementationName( ) throw ( RuntimeExce aSupported[0] = OUString("com.sun.star.sdbc.ResultSet"); return aSupported; } -// ------------------------------------------------------------------------- + sal_Bool SAL_CALL OEvoabResultSet::supportsService( const OUString& _rServiceName ) throw( RuntimeException) { - Sequence< OUString > aSupported(getSupportedServiceNames()); - const OUString* pSupported = aSupported.getConstArray(); - const OUString* pEnd = pSupported + aSupported.getLength(); - for (;pSupported != pEnd && !pSupported->equals(_rServiceName); ++pSupported) - ; - - return pSupported != pEnd; + return cppu::supportsService(this, _rServiceName); } struct ComparisonData diff --git a/connectivity/source/drivers/file/FDriver.cxx b/connectivity/source/drivers/file/FDriver.cxx index 31ed6819ac68..0cbeb2a66e5a 100644 --- a/connectivity/source/drivers/file/FDriver.cxx +++ b/connectivity/source/drivers/file/FDriver.cxx @@ -22,6 +22,7 @@ #include "file/fcode.hxx" #include #include +#include #include "connectivity/dbexception.hxx" #include "resource/common_res.hrc" #include "resource/sharedresources.hxx" @@ -80,16 +81,9 @@ OUString SAL_CALL OFileDriver::getImplementationName( ) throw(RuntimeException) return getImplementationName_Static(); } -//------------------------------------------------------------------ sal_Bool SAL_CALL OFileDriver::supportsService( const OUString& _rServiceName ) throw(RuntimeException) { - Sequence< OUString > aSupported(getSupportedServiceNames()); - const OUString* pSupported = aSupported.getConstArray(); - const OUString* pEnd = pSupported + aSupported.getLength(); - for (;pSupported != pEnd && !pSupported->equals(_rServiceName); ++pSupported) - ; - - return pSupported != pEnd; + return cppu::supportsService(this, _rServiceName); } //------------------------------------------------------------------ diff --git a/connectivity/source/drivers/firebird/Driver.cxx b/connectivity/source/drivers/firebird/Driver.cxx index 6b4913cbf42c..ecbb39509f5b 100644 --- a/connectivity/source/drivers/firebird/Driver.cxx +++ b/connectivity/source/drivers/firebird/Driver.cxx @@ -26,6 +26,7 @@ #include "resource/sharedresources.hxx" #include +#include #include using namespace com::sun::star; @@ -116,13 +117,7 @@ OUString SAL_CALL FirebirdDriver::getImplementationName() throw(RuntimeException sal_Bool SAL_CALL FirebirdDriver::supportsService(const OUString& _rServiceName) throw(RuntimeException) { - Sequence< OUString > aSupported(getSupportedServiceNames()); - const OUString* pSupported = aSupported.getConstArray(); - const OUString* pEnd = pSupported + aSupported.getLength(); - for (;pSupported != pEnd && !pSupported->equals(_rServiceName); ++pSupported) - ; - - return pSupported != pEnd; + return cppu::supportsService(this, _rServiceName); } Sequence< OUString > SAL_CALL FirebirdDriver::getSupportedServiceNames() diff --git a/connectivity/source/drivers/firebird/ResultSet.cxx b/connectivity/source/drivers/firebird/ResultSet.cxx index 0700e11b782e..1e96d661fc12 100644 --- a/connectivity/source/drivers/firebird/ResultSet.cxx +++ b/connectivity/source/drivers/firebird/ResultSet.cxx @@ -23,6 +23,7 @@ #include #include +#include #include #include #include @@ -815,13 +816,7 @@ Sequence< OUString > SAL_CALL OResultSet::getSupportedServiceNames() sal_Bool SAL_CALL OResultSet::supportsService(const OUString& _rServiceName) throw( RuntimeException) { - Sequence< OUString > aSupported(getSupportedServiceNames()); - const OUString* pSupported = aSupported.getConstArray(); - const OUString* pEnd = pSupported + aSupported.getLength(); - for (;pSupported != pEnd && !pSupported->equals(_rServiceName); ++pSupported) - ; - - return pSupported != pEnd; + return cppu::supportsService(this, _rServiceName); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/connectivity/source/drivers/flat/EResultSet.cxx b/connectivity/source/drivers/flat/EResultSet.cxx index 8e4f17c1b50f..b29aaf86a6bd 100644 --- a/connectivity/source/drivers/flat/EResultSet.cxx +++ b/connectivity/source/drivers/flat/EResultSet.cxx @@ -23,6 +23,7 @@ #include #include #include +#include using namespace ::comphelper; @@ -55,16 +56,10 @@ Sequence< OUString > SAL_CALL OFlatResultSet::getSupportedServiceNames( ) throw aSupported[1] = OUString("com.sun.star.sdbcx.ResultSet"); return aSupported; } -// ------------------------------------------------------------------------- + sal_Bool SAL_CALL OFlatResultSet::supportsService( const OUString& _rServiceName ) throw( RuntimeException) { - Sequence< OUString > aSupported(getSupportedServiceNames()); - const OUString* pSupported = aSupported.getConstArray(); - const OUString* pEnd = pSupported + aSupported.getLength(); - for (;pSupported != pEnd && !pSupported->equals(_rServiceName); ++pSupported) - ; - - return pSupported != pEnd; + return cppu::supportsService(this, _rServiceName); } // ------------------------------------------------------------------------- Any SAL_CALL OFlatResultSet::queryInterface( const Type & rType ) throw(RuntimeException) diff --git a/connectivity/source/drivers/hsqldb/HDriver.cxx b/connectivity/source/drivers/hsqldb/HDriver.cxx index f0ca4ef760be..e22bab21b33c 100644 --- a/connectivity/source/drivers/hsqldb/HDriver.cxx +++ b/connectivity/source/drivers/hsqldb/HDriver.cxx @@ -48,6 +48,7 @@ #include #include #include +#include #include #include #include "resource/hsqldb_res.hrc" @@ -519,16 +520,9 @@ namespace connectivity return getImplementationName_Static(); } - //------------------------------------------------------------------ sal_Bool SAL_CALL ODriverDelegator::supportsService( const OUString& _rServiceName ) throw(RuntimeException) { - Sequence< OUString > aSupported(getSupportedServiceNames()); - const OUString* pSupported = aSupported.getConstArray(); - const OUString* pEnd = pSupported + aSupported.getLength(); - for (;pSupported != pEnd && !pSupported->equals(_rServiceName); ++pSupported) - ; - - return pSupported != pEnd; + return cppu::supportsService(this, _rServiceName); } //------------------------------------------------------------------ Sequence< OUString > SAL_CALL ODriverDelegator::getSupportedServiceNames( ) throw(RuntimeException) diff --git a/connectivity/source/drivers/jdbc/JDriver.cxx b/connectivity/source/drivers/jdbc/JDriver.cxx index 05424aed51df..0de62212a542 100644 --- a/connectivity/source/drivers/jdbc/JDriver.cxx +++ b/connectivity/source/drivers/jdbc/JDriver.cxx @@ -31,6 +31,7 @@ #include "resource/common_res.hrc" #include "resource/sharedresources.hxx" #include +#include using namespace connectivity; using namespace ::com::sun::star::uno; @@ -76,16 +77,9 @@ OUString SAL_CALL java_sql_Driver::getImplementationName( ) throw(RuntimeExcept return getImplementationName_Static(); } -// -------------------------------------------------------------------------------- sal_Bool SAL_CALL java_sql_Driver::supportsService( const OUString& _rServiceName ) throw(RuntimeException) { - Sequence< OUString > aSupported(getSupportedServiceNames()); - const OUString* pSupported = aSupported.getConstArray(); - const OUString* pEnd = pSupported + aSupported.getLength(); - for (;pSupported != pEnd && !pSupported->equals(_rServiceName); ++pSupported) - ; - - return pSupported != pEnd; + return cppu::supportsService(this, _rServiceName); } // -------------------------------------------------------------------------------- diff --git a/connectivity/source/drivers/kab/KDriver.cxx b/connectivity/source/drivers/kab/KDriver.cxx index 0eedfeab45ea..9b1da8574b77 100644 --- a/connectivity/source/drivers/kab/KDriver.cxx +++ b/connectivity/source/drivers/kab/KDriver.cxx @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include "resource/kab_res.hrc" @@ -359,16 +360,10 @@ OUString SAL_CALL KabDriver::getImplementationName( ) throw(RuntimeException) { return getImplementationName_Static(); } -//------------------------------------------------------------------ + sal_Bool SAL_CALL KabDriver::supportsService( const OUString& _rServiceName ) throw(RuntimeException) { - Sequence< OUString > aSupported(getSupportedServiceNames()); - const OUString* pSupported = aSupported.getConstArray(); - const OUString* pEnd = pSupported + aSupported.getLength(); - - while (pSupported != pEnd && !pSupported->equals(_rServiceName)) - ++pSupported; - return pSupported != pEnd; + return cppu::supportsService(this, _rServiceName); } //------------------------------------------------------------------ Sequence< OUString > SAL_CALL KabDriver::getSupportedServiceNames( ) throw(RuntimeException) diff --git a/connectivity/source/drivers/macab/MacabDriver.cxx b/connectivity/source/drivers/macab/MacabDriver.cxx index 7b0ab7cace9c..b6d3066ce7cc 100644 --- a/connectivity/source/drivers/macab/MacabDriver.cxx +++ b/connectivity/source/drivers/macab/MacabDriver.cxx @@ -28,6 +28,7 @@ #include #include "resource/macab_res.hrc" #include +#include using namespace com::sun::star::uno; using namespace com::sun::star::lang; @@ -227,16 +228,10 @@ OUString SAL_CALL MacabDriver::getImplementationName( ) throw(RuntimeException) { return getImplementationName_Static(); } -//------------------------------------------------------------------ + sal_Bool SAL_CALL MacabDriver::supportsService( const OUString& _rServiceName ) throw(RuntimeException) { - Sequence< OUString > aSupported(getSupportedServiceNames()); - const OUString* pSupported = aSupported.getConstArray(); - const OUString* pEnd = pSupported + aSupported.getLength(); - - while (pSupported != pEnd && !pSupported->equals(_rServiceName)) - ++pSupported; - return pSupported != pEnd; + return cppu::supportsService(this, _rServiceName); } //------------------------------------------------------------------ Sequence< OUString > SAL_CALL MacabDriver::getSupportedServiceNames( ) throw(RuntimeException) diff --git a/connectivity/source/drivers/mork/MDriver.cxx b/connectivity/source/drivers/mork/MDriver.cxx index 2cd17fc2c5a1..c11ff08080e1 100644 --- a/connectivity/source/drivers/mork/MDriver.cxx +++ b/connectivity/source/drivers/mork/MDriver.cxx @@ -7,6 +7,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +#include #include "MDriver.hxx" #include "MConnection.hxx" #include "MNSProfileDiscover.hxx" @@ -60,13 +61,7 @@ OUString SAL_CALL MorkDriver::getImplementationName() sal_Bool SAL_CALL MorkDriver::supportsService(const OUString& serviceName) throw (css::uno::RuntimeException) { - css::uno::Sequence< OUString > aSupported(getSupportedServiceNames()); - const OUString* pSupported = aSupported.getConstArray(); - const OUString* pEnd = pSupported + aSupported.getLength(); - for (;pSupported != pEnd && !pSupported->equals(serviceName); ++pSupported) - ; - - return pSupported != pEnd; + return cppu::supportsService(this, serviceName); } css::uno::Sequence< OUString > MorkDriver::getSupportedServiceNames() diff --git a/connectivity/source/drivers/mork/MResultSet.cxx b/connectivity/source/drivers/mork/MResultSet.cxx index 395fba8f9d1c..524f9d02a2ac 100644 --- a/connectivity/source/drivers/mork/MResultSet.cxx +++ b/connectivity/source/drivers/mork/MResultSet.cxx @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -74,16 +75,10 @@ OUString SAL_CALL OResultSet::getImplementationName( ) throw ( RuntimeException aSupported[1] = OUString("com.sun.star.sdbcx.ResultSet"); return aSupported; } -// ------------------------------------------------------------------------- + sal_Bool SAL_CALL OResultSet::supportsService( const OUString& _rServiceName ) throw( RuntimeException) { - Sequence< OUString > aSupported(getSupportedServiceNames()); - const OUString* pSupported = aSupported.getConstArray(); - const OUString* pEnd = pSupported + aSupported.getLength(); - for (;pSupported != pEnd && !pSupported->equals(_rServiceName); ++pSupported) - ; - - return pSupported != pEnd; + return cppu::supportsService(this, _rServiceName); } // ------------------------------------------------------------------------- diff --git a/connectivity/source/drivers/mozab/MDriver.cxx b/connectivity/source/drivers/mozab/MDriver.cxx index f7384cc18807..d292687b767d 100644 --- a/connectivity/source/drivers/mozab/MDriver.cxx +++ b/connectivity/source/drivers/mozab/MDriver.cxx @@ -21,6 +21,7 @@ #include "MDriver.hxx" #include "MConnection.hxx" #include "connectivity/dbexception.hxx" +#include #include "resource/mozab_res.hrc" #include "resource/common_res.hrc" @@ -102,16 +103,9 @@ OUString SAL_CALL MozabDriver::getImplementationName( ) throw(RuntimeException) return getImplementationName_Static(); } -//------------------------------------------------------------------ sal_Bool SAL_CALL MozabDriver::supportsService( const OUString& _rServiceName ) throw(RuntimeException) { - Sequence< OUString > aSupported(getSupportedServiceNames()); - const OUString* pSupported = aSupported.getConstArray(); - const OUString* pEnd = pSupported + aSupported.getLength(); - for (;pSupported != pEnd && !pSupported->equals(_rServiceName); ++pSupported) - ; - - return pSupported != pEnd; + return cppu::supportsService(this, _rServiceName); } //------------------------------------------------------------------ diff --git a/connectivity/source/drivers/mozab/MResultSet.cxx b/connectivity/source/drivers/mozab/MResultSet.cxx index 8c947e25ad2e..6d94fa7c8dff 100644 --- a/connectivity/source/drivers/mozab/MResultSet.cxx +++ b/connectivity/source/drivers/mozab/MResultSet.cxx @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -73,16 +74,10 @@ OUString SAL_CALL OResultSet::getImplementationName( ) throw ( RuntimeException aSupported[1] = OUString("com.sun.star.sdbcx.ResultSet"); return aSupported; } -// ------------------------------------------------------------------------- + sal_Bool SAL_CALL OResultSet::supportsService( const OUString& _rServiceName ) throw( RuntimeException) { - Sequence< OUString > aSupported(getSupportedServiceNames()); - const OUString* pSupported = aSupported.getConstArray(); - const OUString* pEnd = pSupported + aSupported.getLength(); - for (;pSupported != pEnd && !pSupported->equals(_rServiceName); ++pSupported) - ; - - return pSupported != pEnd; + return cppu::supportsService(this, _rServiceName); } // ------------------------------------------------------------------------- diff --git a/connectivity/source/drivers/mozab/bootstrap/MMozillaBootstrap.cxx b/connectivity/source/drivers/mozab/bootstrap/MMozillaBootstrap.cxx index b91bb0e7e433..b68424f8d59d 100644 --- a/connectivity/source/drivers/mozab/bootstrap/MMozillaBootstrap.cxx +++ b/connectivity/source/drivers/mozab/bootstrap/MMozillaBootstrap.cxx @@ -17,7 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ - +#include #include "MMozillaBootstrap.hxx" using namespace com::sun::star::uno; @@ -45,10 +45,6 @@ extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL OMozillaBootstrap_CreateInstance return pMozillaBootstrap; } -// -------------------------------------------------------------------------------- - - -// -------------------------------------------------------------------------------- MozillaBootstrap::MozillaBootstrap( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory) : OMozillaBootstrap_BASE(m_aMutex), m_xMSFactory( _rxFactory ) @@ -104,16 +100,9 @@ OUString SAL_CALL MozillaBootstrap::getImplementationName( ) throw(RuntimeExcep return getImplementationName_Static(); } -//------------------------------------------------------------------ sal_Bool SAL_CALL MozillaBootstrap::supportsService( const OUString& _rServiceName ) throw(RuntimeException) { - Sequence< OUString > aSupported(getSupportedServiceNames()); - const OUString* pSupported = aSupported.getConstArray(); - const OUString* pEnd = pSupported + aSupported.getLength(); - for (;pSupported != pEnd && !pSupported->equals(_rServiceName); ++pSupported) - ; - - return pSupported != pEnd; + return cppu::supportsService(this, _rServiceName); } //------------------------------------------------------------------ diff --git a/connectivity/source/drivers/mysql/YDriver.cxx b/connectivity/source/drivers/mysql/YDriver.cxx index c02a54e1a50a..51e5a114fc9a 100644 --- a/connectivity/source/drivers/mysql/YDriver.cxx +++ b/connectivity/source/drivers/mysql/YDriver.cxx @@ -22,6 +22,7 @@ #include #include #include +#include #include "connectivity/dbexception.hxx" #include #include @@ -487,16 +488,9 @@ namespace connectivity return getImplementationName_Static(); } - //------------------------------------------------------------------ sal_Bool SAL_CALL ODriverDelegator::supportsService( const OUString& _rServiceName ) throw(RuntimeException) { - Sequence< OUString > aSupported(getSupportedServiceNames()); - const OUString* pSupported = aSupported.getConstArray(); - const OUString* pEnd = pSupported + aSupported.getLength(); - for (;pSupported != pEnd && !pSupported->equals(_rServiceName); ++pSupported) - ; - - return pSupported != pEnd; + return cppu::supportsService(this, _rServiceName); } //------------------------------------------------------------------ Sequence< OUString > SAL_CALL ODriverDelegator::getSupportedServiceNames( ) throw(RuntimeException) diff --git a/connectivity/source/drivers/odbcbase/ODriver.cxx b/connectivity/source/drivers/odbcbase/ODriver.cxx index 2c04fa253568..e5871f012918 100644 --- a/connectivity/source/drivers/odbcbase/ODriver.cxx +++ b/connectivity/source/drivers/odbcbase/ODriver.cxx @@ -22,6 +22,7 @@ #include "odbc/OFunctions.hxx" #include "odbc/OTools.hxx" #include "connectivity/dbexception.hxx" +#include #include "resource/common_res.hrc" #include "resource/sharedresources.hxx" @@ -77,16 +78,9 @@ OUString SAL_CALL ODBCDriver::getImplementationName( ) throw(RuntimeException) return getImplementationName_Static(); } -//------------------------------------------------------------------ sal_Bool SAL_CALL ODBCDriver::supportsService( const OUString& _rServiceName ) throw(RuntimeException) { - Sequence< OUString > aSupported(getSupportedServiceNames()); - const OUString* pSupported = aSupported.getConstArray(); - const OUString* pEnd = pSupported + aSupported.getLength(); - for (;pSupported != pEnd && !pSupported->equals(_rServiceName); ++pSupported) - ; - - return pSupported != pEnd; + return cppu::supportsService(this, _rServiceName); } //------------------------------------------------------------------ diff --git a/connectivity/source/drivers/odbcbase/OResultSet.cxx b/connectivity/source/drivers/odbcbase/OResultSet.cxx index 2b58a03e14f7..bf6e9e95e146 100644 --- a/connectivity/source/drivers/odbcbase/OResultSet.cxx +++ b/connectivity/source/drivers/odbcbase/OResultSet.cxx @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include @@ -78,16 +79,10 @@ OUString SAL_CALL OResultSet::getImplementationName( ) throw ( RuntimeException aSupported[1] = OUString("com.sun.star.sdbcx.ResultSet"); return aSupported; } -// ------------------------------------------------------------------------- + sal_Bool SAL_CALL OResultSet::supportsService( const OUString& _rServiceName ) throw( RuntimeException) { - Sequence< OUString > aSupported(getSupportedServiceNames()); - const OUString* pSupported = aSupported.getConstArray(); - const OUString* pEnd = pSupported + aSupported.getLength(); - for (;pSupported != pEnd && !pSupported->equals(_rServiceName); ++pSupported) - ; - - return pSupported != pEnd; + return cppu::supportsService(this, _rServiceName); } // ------------------------------------------------------------------------- diff --git a/connectivity/source/drivers/postgresql/pq_driver.cxx b/connectivity/source/drivers/postgresql/pq_driver.cxx index f701e3124e5a..98206bed7ae3 100644 --- a/connectivity/source/drivers/postgresql/pq_driver.cxx +++ b/connectivity/source/drivers/postgresql/pq_driver.cxx @@ -41,6 +41,7 @@ #include #include #include +#include #include "pq_driver.hxx" @@ -150,11 +151,7 @@ OUString SAL_CALL Driver::getImplementationName() sal_Bool Driver::supportsService(const OUString& ServiceName) throw(::com::sun::star::uno::RuntimeException) { - Sequence< OUString > serviceNames = DriverGetSupportedServiceNames(); - for( int i = 0 ; i < serviceNames.getLength() ; i ++ ) - if( serviceNames[i] == ServiceName ) - return sal_True; - return sal_False; + return cppu::supportsService(this, ServiceName); } Sequence< OUString > Driver::getSupportedServiceNames(void) diff --git a/connectivity/source/drivers/postgresql/pq_xbase.cxx b/connectivity/source/drivers/postgresql/pq_xbase.cxx index 8cf9b03a7cf2..a0b67a1b0f7d 100644 --- a/connectivity/source/drivers/postgresql/pq_xbase.cxx +++ b/connectivity/source/drivers/postgresql/pq_xbase.cxx @@ -35,6 +35,7 @@ ************************************************************************/ #include +#include #include #include "pq_tools.hxx" @@ -148,10 +149,7 @@ OUString ReflectionBase::getImplementationName() sal_Bool ReflectionBase::supportsService(const OUString& ServiceName) throw(::com::sun::star::uno::RuntimeException) { - for( int i = 0 ; i < m_supportedServices.getLength() ; i ++ ) - if( m_supportedServices[i] == ServiceName ) - return sal_True; - return sal_False; + return cppu::supportsService(this, ServiceName); } Sequence< OUString > ReflectionBase::getSupportedServiceNames(void) diff --git a/connectivity/source/manager/mdrivermanager.cxx b/connectivity/source/manager/mdrivermanager.cxx index 67ea3ec77ee0..f40e433e50f9 100644 --- a/connectivity/source/manager/mdrivermanager.cxx +++ b/connectivity/source/manager/mdrivermanager.cxx @@ -32,6 +32,7 @@ #include #include #include +#include #include #include @@ -521,16 +522,9 @@ OUString SAL_CALL OSDBCDriverManager::getImplementationName( ) throw(RuntimeExc return getImplementationName_static(); } -//-------------------------------------------------------------------------- sal_Bool SAL_CALL OSDBCDriverManager::supportsService( const OUString& _rServiceName ) throw(RuntimeException) { - Sequence< OUString > aSupported(getSupportedServiceNames()); - const OUString* pSupported = aSupported.getConstArray(); - const OUString* pEnd = pSupported + aSupported.getLength(); - for (;pSupported != pEnd && !pSupported->equals(_rServiceName); ++pSupported) - ; - - return pSupported != pEnd; + return cppu::supportsService(this, _rServiceName); } //-------------------------------------------------------------------------- diff --git a/connectivity/source/sdbcx/VColumn.cxx b/connectivity/source/sdbcx/VColumn.cxx index 8f1f858ad040..0cc2e2bc1ed5 100644 --- a/connectivity/source/sdbcx/VColumn.cxx +++ b/connectivity/source/sdbcx/VColumn.cxx @@ -20,6 +20,7 @@ #include "connectivity/sdbcx/VColumn.hxx" #include #include +#include #include "TConnection.hxx" #include // ------------------------------------------------------------------------- @@ -49,16 +50,10 @@ OUString SAL_CALL OColumn::getImplementationName( ) throw (::com::sun::star::un return aSupported; } -// ----------------------------------------------------------------------------- + sal_Bool SAL_CALL OColumn::supportsService( const OUString& _rServiceName ) throw(::com::sun::star::uno::RuntimeException) { - Sequence< OUString > aSupported(getSupportedServiceNames()); - const OUString* pSupported = aSupported.getConstArray(); - const OUString* pEnd = pSupported + aSupported.getLength(); - for (;pSupported != pEnd && !pSupported->equals(_rServiceName); ++pSupported) - ; - - return pSupported != pEnd; + return cppu::supportsService(this, _rServiceName); } // ------------------------------------------------------------------------- OColumn::OColumn(sal_Bool _bCase) diff --git a/connectivity/source/sdbcx/VIndex.cxx b/connectivity/source/sdbcx/VIndex.cxx index f60731646089..65a45208ebad 100644 --- a/connectivity/source/sdbcx/VIndex.cxx +++ b/connectivity/source/sdbcx/VIndex.cxx @@ -23,8 +23,9 @@ #include #include #include "connectivity/sdbcx/VCollection.hxx" +#include #include "TConnection.hxx" -// ------------------------------------------------------------------------- + using namespace ::connectivity; using namespace ::dbtools; using namespace ::connectivity::sdbcx; @@ -54,16 +55,10 @@ OUString SAL_CALL OIndex::getImplementationName( ) throw (::com::sun::star::uno return aSupported; } -// ----------------------------------------------------------------------------- + sal_Bool SAL_CALL OIndex::supportsService( const OUString& _rServiceName ) throw(::com::sun::star::uno::RuntimeException) { - Sequence< OUString > aSupported(getSupportedServiceNames()); - const OUString* pSupported = aSupported.getConstArray(); - const OUString* pEnd = pSupported + aSupported.getLength(); - for (;pSupported != pEnd && !pSupported->equals(_rServiceName); ++pSupported) - ; - - return pSupported != pEnd; + return cppu::supportsService(this, _rServiceName); } // ------------------------------------------------------------------------- OIndex::OIndex(sal_Bool _bCase) : ODescriptor_BASE(m_aMutex) diff --git a/connectivity/source/sdbcx/VIndexColumn.cxx b/connectivity/source/sdbcx/VIndexColumn.cxx index b4952784e872..cf184346b375 100644 --- a/connectivity/source/sdbcx/VIndexColumn.cxx +++ b/connectivity/source/sdbcx/VIndexColumn.cxx @@ -18,6 +18,7 @@ */ #include "connectivity/sdbcx/VIndexColumn.hxx" +#include #include "TConnection.hxx" using namespace connectivity; @@ -42,16 +43,10 @@ OUString SAL_CALL OIndexColumn::getImplementationName( ) throw (::com::sun::sta return aSupported; } -// ----------------------------------------------------------------------------- + sal_Bool SAL_CALL OIndexColumn::supportsService( const OUString& _rServiceName ) throw(::com::sun::star::uno::RuntimeException) { - Sequence< OUString > aSupported(getSupportedServiceNames()); - const OUString* pSupported = aSupported.getConstArray(); - const OUString* pEnd = pSupported + aSupported.getLength(); - for (;pSupported != pEnd && !pSupported->equals(_rServiceName); ++pSupported) - ; - - return pSupported != pEnd; + return cppu::supportsService(this, _rServiceName); } // ----------------------------------------------------------------------------- OIndexColumn::OIndexColumn(sal_Bool _bCase) : OColumn(_bCase), m_IsAscending(sal_True) diff --git a/connectivity/source/sdbcx/VKey.cxx b/connectivity/source/sdbcx/VKey.cxx index 0f1ed7294c53..bbe9f64ed2d6 100644 --- a/connectivity/source/sdbcx/VKey.cxx +++ b/connectivity/source/sdbcx/VKey.cxx @@ -21,10 +21,11 @@ #include #include #include +#include #include "connectivity/sdbcx/VColumn.hxx" #include "connectivity/sdbcx/VCollection.hxx" #include "TConnection.hxx" -// ------------------------------------------------------------------------- + using namespace connectivity; using namespace connectivity::sdbcx; using namespace ::com::sun::star::beans; @@ -52,16 +53,10 @@ OUString SAL_CALL OKey::getImplementationName( ) throw (::com::sun::star::uno:: return aSupported; } -// ----------------------------------------------------------------------------- + sal_Bool SAL_CALL OKey::supportsService( const OUString& _rServiceName ) throw(::com::sun::star::uno::RuntimeException) { - Sequence< OUString > aSupported(getSupportedServiceNames()); - const OUString* pSupported = aSupported.getConstArray(); - const OUString* pEnd = pSupported + aSupported.getLength(); - for (;pSupported != pEnd && !pSupported->equals(_rServiceName); ++pSupported) - ; - - return pSupported != pEnd; + return cppu::supportsService(this, _rServiceName); } // ------------------------------------------------------------------------- OKey::OKey(sal_Bool _bCase) : ODescriptor_BASE(m_aMutex) diff --git a/connectivity/source/sdbcx/VKeyColumn.cxx b/connectivity/source/sdbcx/VKeyColumn.cxx index f2475fa7bf02..dbd99779859b 100644 --- a/connectivity/source/sdbcx/VKeyColumn.cxx +++ b/connectivity/source/sdbcx/VKeyColumn.cxx @@ -18,6 +18,7 @@ */ #include "connectivity/sdbcx/VKeyColumn.hxx" +#include #include "TConnection.hxx" using namespace connectivity; @@ -43,16 +44,10 @@ OUString SAL_CALL OKeyColumn::getImplementationName( ) throw (::com::sun::star: return aSupported; } -// ----------------------------------------------------------------------------- + sal_Bool SAL_CALL OKeyColumn::supportsService( const OUString& _rServiceName ) throw(::com::sun::star::uno::RuntimeException) { - Sequence< OUString > aSupported(getSupportedServiceNames()); - const OUString* pSupported = aSupported.getConstArray(); - const OUString* pEnd = pSupported + aSupported.getLength(); - for (;pSupported != pEnd && !pSupported->equals(_rServiceName); ++pSupported) - ; - - return pSupported != pEnd; + return cppu::supportsService(this, _rServiceName); } // ------------------------------------------------------------------------- OKeyColumn::OKeyColumn(sal_Bool _bCase) : OColumn(_bCase) diff --git a/connectivity/source/sdbcx/VTable.cxx b/connectivity/source/sdbcx/VTable.cxx index 4bd63af39102..ae1735ff5521 100644 --- a/connectivity/source/sdbcx/VTable.cxx +++ b/connectivity/source/sdbcx/VTable.cxx @@ -27,8 +27,8 @@ #include "connectivity/sdbcx/VKey.hxx" #include "connectivity/dbtools.hxx" #include +#include -// ------------------------------------------------------------------------- using namespace ::connectivity; using namespace ::connectivity::sdbcx; using namespace ::dbtools; @@ -58,16 +58,10 @@ OUString SAL_CALL OTable::getImplementationName( ) throw (::com::sun::star::uno return aSupported; } -// ----------------------------------------------------------------------------- + sal_Bool SAL_CALL OTable::supportsService( const OUString& _rServiceName ) throw(::com::sun::star::uno::RuntimeException) { - Sequence< OUString > aSupported(getSupportedServiceNames()); - const OUString* pSupported = aSupported.getConstArray(); - const OUString* pEnd = pSupported + aSupported.getLength(); - for (;pSupported != pEnd && !pSupported->equals(_rServiceName); ++pSupported) - ; - - return pSupported != pEnd; + return cppu::supportsService(this, _rServiceName); } // ------------------------------------------------------------------------- OTable::OTable(OCollection* _pTables, -- cgit