From ee5661ecd3bbeae38b04cd3f582a320a231d11bd Mon Sep 17 00:00:00 2001 From: Marcos Paulo de Souza Date: Mon, 21 Oct 2013 19:04:05 -0200 Subject: fdo#54938: Adapt supportsService implementations.. to cppu::supportsService Change-Id: I0b03d3910f094f2183bf9859db9d5bcaf35d1f14 Reviewed-on: https://gerrit.libreoffice.org/6370 Reviewed-by: Stephan Bergmann Tested-by: Stephan Bergmann --- testtools/source/bridgetest/bridgetest.cxx | 10 ++-------- testtools/source/bridgetest/cppobj.cxx | 10 ++-------- testtools/source/performance/ubobject.cxx | 10 ++-------- testtools/source/performance/ubtest.cxx | 9 +-------- 4 files changed, 7 insertions(+), 32 deletions(-) (limited to 'testtools') diff --git a/testtools/source/bridgetest/bridgetest.cxx b/testtools/source/bridgetest/bridgetest.cxx index 3c2bcda4995c..ef5ee55b05cc 100644 --- a/testtools/source/bridgetest/bridgetest.cxx +++ b/testtools/source/bridgetest/bridgetest.cxx @@ -33,6 +33,7 @@ #include #include #include +#include #include #include @@ -1244,14 +1245,7 @@ OUString TestBridgeImpl::getImplementationName() sal_Bool TestBridgeImpl::supportsService( const OUString & rServiceName ) throw (RuntimeException) { - const Sequence< OUString > & rSNL = getSupportedServiceNames(); - const OUString * pArray = rSNL.getConstArray(); - for ( sal_Int32 nPos = rSNL.getLength(); nPos--; ) - { - if (pArray[nPos] == rServiceName) - return sal_True; - } - return sal_False; + return cppu::supportsService(this, rServiceName); } //__________________________________________________________________________________________________ Sequence< OUString > TestBridgeImpl::getSupportedServiceNames() diff --git a/testtools/source/bridgetest/cppobj.cxx b/testtools/source/bridgetest/cppobj.cxx index e9133b2faf46..370c2b74adad 100644 --- a/testtools/source/bridgetest/cppobj.cxx +++ b/testtools/source/bridgetest/cppobj.cxx @@ -30,6 +30,7 @@ #include #include "cppuhelper/exc_hlp.hxx" #include "cppuhelper/compbase_ex.hxx" +#include #include #include #include "com/sun/star/uno/Any.hxx" @@ -1154,14 +1155,7 @@ OUString Test_Impl::getImplementationName() sal_Bool Test_Impl::supportsService( const OUString & rServiceName ) throw (RuntimeException) { - const Sequence< OUString > & rSNL = getSupportedServiceNames(); - const OUString * pArray = rSNL.getConstArray(); - for ( sal_Int32 nPos = rSNL.getLength(); nPos--; ) - { - if (pArray[nPos] == rServiceName) - return sal_True; - } - return sal_False; + return cppu::supportsService(this, rServiceName); } //__________________________________________________________________________________________________ Sequence< OUString > Test_Impl::getSupportedServiceNames() diff --git a/testtools/source/performance/ubobject.cxx b/testtools/source/performance/ubobject.cxx index 6e904ccf2939..9098eb726a0b 100644 --- a/testtools/source/performance/ubobject.cxx +++ b/testtools/source/performance/ubobject.cxx @@ -22,6 +22,7 @@ #include #include +#include #include #include @@ -210,14 +211,7 @@ OUString ServiceImpl::getImplementationName() sal_Bool ServiceImpl::supportsService( const OUString & rServiceName ) throw (RuntimeException) { - const Sequence< OUString > & rSNL = getSupportedServiceNames(); - const OUString * pArray = rSNL.getConstArray(); - for ( sal_Int32 nPos = rSNL.getLength(); nPos--; ) - { - if (pArray[nPos] == rServiceName) - return sal_True; - } - return sal_False; + return cppu::supportsService(this, rServiceName); } //__________________________________________________________________________________________________ Sequence< OUString > ServiceImpl::getSupportedServiceNames() diff --git a/testtools/source/performance/ubtest.cxx b/testtools/source/performance/ubtest.cxx index 1b48a730bab9..4c0ea18c2444 100644 --- a/testtools/source/performance/ubtest.cxx +++ b/testtools/source/performance/ubtest.cxx @@ -449,14 +449,7 @@ OUString TestImpl::getImplementationName() sal_Bool TestImpl::supportsService( const OUString & rServiceName ) throw (RuntimeException) { - const Sequence< OUString > & rSNL = getSupportedServiceNames(); - const OUString * pArray = rSNL.getConstArray(); - for ( sal_Int32 nPos = rSNL.getLength(); nPos--; ) - { - if (pArray[nPos] == rServiceName) - return sal_True; - } - return sal_False; + return cppu::supportsService(this, rServiceName); } //__________________________________________________________________________________________________ Sequence< OUString > TestImpl::getSupportedServiceNames() -- cgit