From 704f95e5255ff72bfb548d50d66d4da61dc483ef Mon Sep 17 00:00:00 2001 From: Marcos Paulo de Souza Date: Wed, 23 Oct 2013 14:35:10 -0200 Subject: fdo#54938: More uses of cppu::supportsService Change-Id: I90a7a07a43559b8d7e1d4b886b2624255200d46b Reviewed-on: https://gerrit.libreoffice.org/6406 Tested-by: LibreOffice gerrit bot Reviewed-by: Stephan Bergmann Tested-by: Stephan Bergmann --- bridges/test/java_uno/acquire/testacquire.cxx | 10 ++-------- bridges/test/java_uno/equals/testequals.cxx | 8 ++------ 2 files changed, 4 insertions(+), 14 deletions(-) (limited to 'bridges') diff --git a/bridges/test/java_uno/acquire/testacquire.cxx b/bridges/test/java_uno/acquire/testacquire.cxx index e88be55b3e01..7a8de19cb44d 100644 --- a/bridges/test/java_uno/acquire/testacquire.cxx +++ b/bridges/test/java_uno/acquire/testacquire.cxx @@ -35,6 +35,7 @@ #include "com/sun/star/uno/XInterface.hpp" #include "cppuhelper/factory.hxx" #include "cppuhelper/implbase3.hxx" +#include #include "cppuhelper/weak.hxx" #include "osl/conditn.hxx" #include "osl/interlck.h" @@ -319,14 +320,7 @@ private: sal_Bool Service::supportsService(OUString const & serviceName) throw (css::uno::RuntimeException) { - css::uno::Sequence< OUString > names( - getSupportedServiceNames_static()); - for (sal_Int32 i = 0; i< names.getLength(); ++i) { - if (names[i] == serviceName) { - return true; - } - } - return false; + return cppu::supportsService(this, serviceName); } namespace { diff --git a/bridges/test/java_uno/equals/testequals.cxx b/bridges/test/java_uno/equals/testequals.cxx index a56e5b928a39..9124b757a57b 100644 --- a/bridges/test/java_uno/equals/testequals.cxx +++ b/bridges/test/java_uno/equals/testequals.cxx @@ -36,6 +36,7 @@ #include "com/sun/star/uno/XInterface.hpp" #include "cppuhelper/factory.hxx" #include "cppuhelper/implbase2.hxx" +#include #include "cppuhelper/weak.hxx" #include "rtl/string.h" #include "rtl/ustring.hxx" @@ -94,12 +95,7 @@ private: sal_Bool Service::supportsService(OUString const & rServiceName) throw (css::uno::RuntimeException) { - css::uno::Sequence< OUString > aNames( - getSupportedServiceNames_static()); - for (sal_Int32 i = 0; i< aNames.getLength(); ++i) - if (aNames[i] == rServiceName) - return true; - return false; + return cppu::supportsService(this, rServiceName); } void Service::connect(OUString const & rConnection, -- cgit v1.2.3