diff options
author | Marcos Paulo de Souza <marcos.souza.org@gmail.com> | 2013-10-16 19:25:05 -0300 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2013-10-17 14:43:28 +0200 |
commit | 3d3293144b0e0d2d28136b1b2c7154d6352463b8 (patch) | |
tree | 1ef57838dc7fa88515a69dce12612e6071bc08b9 /dbaccess | |
parent | 6fe26facd06d4d1e5e37384d25d83209209229fa (diff) |
fdo#54938: Adapt svtools and comphelper module ...
to use cppu::supportsService and other pieces.
Change-Id: I16893b3d31a8055acd214ff23d01e63d38fe0826
Signed-off-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'dbaccess')
-rw-r--r-- | dbaccess/source/core/misc/DatabaseDataProvider.cxx | 4 | ||||
-rw-r--r-- | dbaccess/source/filter/xml/dbloader2.cxx | 9 | ||||
-rw-r--r-- | dbaccess/source/sdbtools/connection/connectiontools.cxx | 6 | ||||
-rw-r--r-- | dbaccess/source/ui/browser/dbloader.cxx | 9 | ||||
-rw-r--r-- | dbaccess/source/ui/browser/genericcontroller.cxx | 10 |
5 files changed, 11 insertions, 27 deletions
diff --git a/dbaccess/source/core/misc/DatabaseDataProvider.cxx b/dbaccess/source/core/misc/DatabaseDataProvider.cxx index ec944266bbd6..0666f609a8cf 100644 --- a/dbaccess/source/core/misc/DatabaseDataProvider.cxx +++ b/dbaccess/source/core/misc/DatabaseDataProvider.cxx @@ -20,8 +20,10 @@ #include "DatabaseDataProvider.hxx" #include "dbastrings.hrc" #include "cppuhelper/implbase1.hxx" +#include <cppuhelper/supportsservice.hxx> #include <comphelper/types.hxx> #include <comphelper/namedvaluecollection.hxx> +#include <comphelper/namedvaluecollection.hxx> #include <connectivity/FValue.hxx> #include <connectivity/dbtools.hxx> #include <rtl/ustrbuf.hxx> @@ -119,7 +121,7 @@ OUString SAL_CALL DatabaseDataProvider::getImplementationName( ) throw(uno::Run sal_Bool SAL_CALL DatabaseDataProvider::supportsService( const OUString& _rServiceName ) throw(uno::RuntimeException) { - return ::comphelper::findValue(getSupportedServiceNames(), _rServiceName, sal_True).getLength() != 0; + return cppu::supportsService(this, _rServiceName); } uno::Sequence< OUString > DatabaseDataProvider::getSupportedServiceNames_Static( ) throw (uno::RuntimeException) diff --git a/dbaccess/source/filter/xml/dbloader2.cxx b/dbaccess/source/filter/xml/dbloader2.cxx index 9f4bc18c0e2d..3b38fffa2f14 100644 --- a/dbaccess/source/filter/xml/dbloader2.cxx +++ b/dbaccess/source/filter/xml/dbloader2.cxx @@ -59,6 +59,7 @@ #include <comphelper/storagehelper.hxx> #include <comphelper/types.hxx> #include <cppuhelper/implbase2.hxx> +#include <cppuhelper/supportsservice.hxx> #include <osl/file.hxx> #include <sfx2/docfile.hxx> #include <unotools/moduleoptions.hxx> @@ -195,13 +196,7 @@ OUString SAL_CALL DBTypeDetection::getImplementationName() throw( ) // XServiceInfo sal_Bool SAL_CALL DBTypeDetection::supportsService(const OUString& ServiceName) throw( ) { - Sequence< OUString > aSNL = getSupportedServiceNames(); - const OUString * pBegin = aSNL.getConstArray(); - const OUString * pEnd = pBegin + aSNL.getLength(); - for( ; pBegin != pEnd; ++pBegin) - if( *pBegin == ServiceName ) - return sal_True; - return sal_False; + return cppu::supportsService(this, ServiceName); } // XServiceInfo diff --git a/dbaccess/source/sdbtools/connection/connectiontools.cxx b/dbaccess/source/sdbtools/connection/connectiontools.cxx index cc89afb70436..cd212eab1780 100644 --- a/dbaccess/source/sdbtools/connection/connectiontools.cxx +++ b/dbaccess/source/sdbtools/connection/connectiontools.cxx @@ -23,6 +23,7 @@ #include "datasourcemetadata.hxx" #include <comphelper/namedvaluecollection.hxx> +#include <cppuhelper/supportsservice.hxx> #include <connectivity/dbtools.hxx> #include <connectivity/statementcomposer.hxx> @@ -102,10 +103,7 @@ namespace sdbtools ::sal_Bool SAL_CALL ConnectionTools::supportsService(const OUString & _ServiceName) throw (RuntimeException) { - Sequence< OUString > aSupported( getSupportedServiceNames() ); - const OUString* begin = aSupported.getConstArray(); - const OUString* end = aSupported.getConstArray() + aSupported.getLength(); - return ::std::find( begin, end, _ServiceName ) != end; + return cppu::supportsService(this, _ServiceName); } Sequence< OUString > SAL_CALL ConnectionTools::getSupportedServiceNames() throw (RuntimeException) diff --git a/dbaccess/source/ui/browser/dbloader.cxx b/dbaccess/source/ui/browser/dbloader.cxx index 7f90c9260900..3b0b795a71e6 100644 --- a/dbaccess/source/ui/browser/dbloader.cxx +++ b/dbaccess/source/ui/browser/dbloader.cxx @@ -42,6 +42,7 @@ #include <comphelper/namedvaluecollection.hxx> #include <comphelper/processfactory.hxx> #include <cppuhelper/implbase2.hxx> +#include <cppuhelper/supportsservice.hxx> #include <toolkit/awt/vclxwindow.hxx> #include <toolkit/helper/vclunohelper.hxx> #include <tools/diagnose_ex.h> @@ -126,13 +127,7 @@ OUString SAL_CALL DBContentLoader::getImplementationName() throw( ) // XServiceInfo sal_Bool SAL_CALL DBContentLoader::supportsService(const OUString& ServiceName) throw( ) { - Sequence< OUString > aSNL = getSupportedServiceNames(); - const OUString * pBegin = aSNL.getConstArray(); - const OUString * pEnd = pBegin + aSNL.getLength(); - for( ; pBegin != pEnd; ++pBegin) - if( *pBegin == ServiceName ) - return sal_True; - return sal_False; + return cppu::supportsService(this, ServiceName); } // XServiceInfo diff --git a/dbaccess/source/ui/browser/genericcontroller.cxx b/dbaccess/source/ui/browser/genericcontroller.cxx index 8a604022f7aa..5ea4421708f2 100644 --- a/dbaccess/source/ui/browser/genericcontroller.cxx +++ b/dbaccess/source/ui/browser/genericcontroller.cxx @@ -33,6 +33,7 @@ #include <framework/titlehelper.hxx> #include <comphelper/sequence.hxx> #include <comphelper/extract.hxx> +#include <cppuhelper/supportsservice.hxx> #include <com/sun/star/sdbc/XDataSource.hpp> #include <com/sun/star/sdb/DatabaseContext.hpp> #include <com/sun/star/sdb/SQLContext.hpp> @@ -960,14 +961,7 @@ bool OGenericUnoController::isUserDefinedFeature( const OUString& _rFeatureURL ) sal_Bool SAL_CALL OGenericUnoController::supportsService(const OUString& ServiceName) throw(RuntimeException) { - Sequence< OUString > aSupported(getSupportedServiceNames()); - - const OUString* pArray = aSupported.getConstArray(); - const OUString* pArrayEnd = aSupported.getConstArray() + aSupported.getLength(); - - for ( ;( pArray != pArrayEnd ) && !pArray->equals( ServiceName ); ++pArray ) - ; - return pArray != pArrayEnd; + return cppu::supportsService(this, ServiceName); } void OGenericUnoController::startConnectionListening(const Reference< XConnection >& _rxConnection) |