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 --- connectivity/source/drivers/mozab/MDriver.cxx | 10 ++-------- connectivity/source/drivers/mozab/MResultSet.cxx | 11 +++-------- .../source/drivers/mozab/bootstrap/MMozillaBootstrap.cxx | 15 ++------------- 3 files changed, 7 insertions(+), 29 deletions(-) (limited to 'connectivity/source/drivers/mozab') 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); } //------------------------------------------------------------------ -- cgit