diff options
author | Marcos Paulo de Souza <marcos.souza.org@gmail.com> | 2013-10-21 19:04:05 -0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2013-10-22 10:28:10 +0000 |
commit | ee5661ecd3bbeae38b04cd3f582a320a231d11bd (patch) | |
tree | 381d9afa0c831145551ade40b6d68f22919baaf6 /testtools | |
parent | c82a36f9c7d89fa434d3dff896c290964326f5bf (diff) |
fdo#54938: Adapt supportsService implementations..
to cppu::supportsService
Change-Id: I0b03d3910f094f2183bf9859db9d5bcaf35d1f14
Reviewed-on: https://gerrit.libreoffice.org/6370
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'testtools')
-rw-r--r-- | testtools/source/bridgetest/bridgetest.cxx | 10 | ||||
-rw-r--r-- | testtools/source/bridgetest/cppobj.cxx | 10 | ||||
-rw-r--r-- | testtools/source/performance/ubobject.cxx | 10 | ||||
-rw-r--r-- | testtools/source/performance/ubtest.cxx | 9 |
4 files changed, 7 insertions, 32 deletions
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 <cppuhelper/factory.hxx> #include <cppuhelper/implbase2.hxx> #include <cppuhelper/implbase1.hxx> +#include <cppuhelper/supportsservice.hxx> #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/lang/XComponent.hpp> @@ -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 <cppuhelper/factory.hxx> #include "cppuhelper/exc_hlp.hxx" #include "cppuhelper/compbase_ex.hxx" +#include <cppuhelper/supportsservice.hxx> #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/lang/XComponent.hpp> #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 <osl/interlck.h> #include <cppuhelper/factory.hxx> +#include <cppuhelper/supportsservice.hxx> #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/lang/XComponent.hpp> @@ -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() |