diff options
Diffstat (limited to 'connectivity/source/drivers')
24 files changed, 59 insertions, 188 deletions
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 <com/sun/star/lang/DisposedException.hpp> #include "connectivity/dbexception.hxx" +#include <cppuhelper/supportsservice.hxx> #include "resource/ado_res.hrc" #include <objbase.h> - #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 <com/sun/star/sdbc/ResultSetType.hpp> #include <com/sun/star/sdbc/FetchDirection.hpp> #include <cppuhelper/typeprovider.hxx> +#include <cppuhelper/supportsservice.hxx> #include <comphelper/sequence.hxx> #include <com/sun/star/beans/PropertyAttribute.hpp> #include <comphelper/seqstream.hxx> @@ -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 <com/sun/star/lang/DisposedException.hpp> #include <comphelper/sequence.hxx> #include <comphelper/types.hxx> +#include <cppuhelper/supportsservice.hxx> #include <connectivity/dbexception.hxx> 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 <com/sun/star/lang/DisposedException.hpp> #include <comphelper/sequence.hxx> +#include <cppuhelper/supportsservice.hxx> #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 <osl/file.hxx> #include "osl/security.hxx" #include <comphelper/processfactory.hxx> +#include <cppuhelper/supportsservice.hxx> #include <com/sun/star/ucb/XContentAccess.hpp> #include <com/sun/star/ucb/XCommandEnvironment.hpp> #include <ucbhelper/content.hxx> @@ -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 <comphelper/property.hxx> #include <comphelper/sequence.hxx> #include <comphelper/types.hxx> +#include <cppuhelper/supportsservice.hxx> #include <connectivity/dbexception.hxx> #include <connectivity/sqlerror.hxx> #include <cppuhelper/typeprovider.hxx> @@ -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 <com/sun/star/lang/DisposedException.hpp> #include <comphelper/types.hxx> +#include <cppuhelper/supportsservice.hxx> #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 <comphelper/processfactory.hxx> +#include <cppuhelper/supportsservice.hxx> #include <osl/process.h> 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 <comphelper/sequence.hxx> #include <cppuhelper/typeprovider.hxx> +#include <cppuhelper/supportsservice.hxx> #include <connectivity/dbexception.hxx> #include <propertyids.hxx> #include <rtl/string.hxx> @@ -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 <com/sun/star/lang/DisposedException.hpp> #include <comphelper/sequence.hxx> #include <comphelper/types.hxx> +#include <cppuhelper/supportsservice.hxx> 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 <comphelper/namedvaluecollection.hxx> #include <comphelper/processfactory.hxx> #include <comphelper/string.hxx> +#include <cppuhelper/supportsservice.hxx> #include <unotools/confignode.hxx> #include <unotools/ucbstreamhelper.hxx> #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 <comphelper/processfactory.hxx> +#include <cppuhelper/supportsservice.hxx> 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 <com/sun/star/lang/NullPointerException.hpp> #include <com/sun/star/frame/Desktop.hpp> #include <comphelper/processfactory.hxx> +#include <cppuhelper/supportsservice.hxx> #include <rtl/ustrbuf.hxx> #include <tools/diagnose_ex.h> #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 <tools/diagnose_ex.h> #include "resource/macab_res.hrc" #include <comphelper/processfactory.hxx> +#include <cppuhelper/supportsservice.hxx> 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 <cppuhelper/supportsservice.hxx> #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 <comphelper/property.hxx> #include <comphelper/sequence.hxx> #include <cppuhelper/typeprovider.hxx> +#include <cppuhelper/supportsservice.hxx> #include <comphelper/extract.hxx> #include <com/sun/star/lang/DisposedException.hpp> #include <com/sun/star/sdbc/ResultSetType.hpp> @@ -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 <cppuhelper/supportsservice.hxx> #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 <comphelper/property.hxx> #include <comphelper/sequence.hxx> #include <cppuhelper/typeprovider.hxx> +#include <cppuhelper/supportsservice.hxx> #include <comphelper/extract.hxx> #include <com/sun/star/lang/DisposedException.hpp> #include <com/sun/star/sdbc/ResultSetType.hpp> @@ -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 <cppuhelper/supportsservice.hxx> #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 <osl/diagnose.h> #include <comphelper/namedvaluecollection.hxx> #include <comphelper/processfactory.hxx> +#include <cppuhelper/supportsservice.hxx> #include "connectivity/dbexception.hxx" #include <connectivity/dbcharset.hxx> #include <com/sun/star/sdbc/DriverManager.hpp> @@ -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 <cppuhelper/supportsservice.hxx> #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 <comphelper/property.hxx> #include <comphelper/sequence.hxx> #include <cppuhelper/typeprovider.hxx> +#include <cppuhelper/supportsservice.hxx> #include <comphelper/extract.hxx> #include <com/sun/star/lang/DisposedException.hpp> #include <comphelper/types.hxx> @@ -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 <cppuhelper/compbase1.hxx> #include <cppuhelper/compbase2.hxx> #include <cppuhelper/implementationentry.hxx> +#include <cppuhelper/supportsservice.hxx> #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 <rtl/ustrbuf.hxx> +#include <cppuhelper/supportsservice.hxx> #include <cppuhelper/typeprovider.hxx> #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) |