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 --- vcl/source/components/dtranscomp.cxx | 12 ++---------- vcl/source/components/fontident.cxx | 10 ++-------- 2 files changed, 4 insertions(+), 18 deletions(-) (limited to 'vcl/source/components') diff --git a/vcl/source/components/dtranscomp.cxx b/vcl/source/components/dtranscomp.cxx index 650fce07f7fc..cb4b6b2c7e3f 100644 --- a/vcl/source/components/dtranscomp.cxx +++ b/vcl/source/components/dtranscomp.cxx @@ -42,13 +42,12 @@ #include "cppuhelper/compbase1.hxx" #include "cppuhelper/compbase2.hxx" #include "cppuhelper/implbase1.hxx" +#include using namespace com::sun::star; using namespace com::sun::star::uno; using namespace com::sun::star::lang; -// ----------------------------------------------------------------------- - namespace vcl { // generic implementation to satisfy SalInstance @@ -148,14 +147,7 @@ Sequence< OUString > GenericClipboard::getSupportedServiceNames() throw( Runtime sal_Bool GenericClipboard::supportsService( const OUString& ServiceName ) throw( RuntimeException ) { - Sequence< OUString > aServices( getSupportedServiceNames() ); - sal_Int32 nServices = aServices.getLength(); - for( sal_Int32 i = 0; i < nServices; i++ ) - { - if( aServices[i] == ServiceName ) - return sal_True; - } - return sal_False; + return cppu::supportsService(this, ServiceName); } Reference< ::com::sun::star::datatransfer::XTransferable > GenericClipboard::getContents() throw( RuntimeException ) diff --git a/vcl/source/components/fontident.cxx b/vcl/source/components/fontident.cxx index 87be8e0995df..9e5a138856ec 100644 --- a/vcl/source/components/fontident.cxx +++ b/vcl/source/components/fontident.cxx @@ -34,6 +34,7 @@ #include #include +#include using namespace ::com::sun::star::uno; using namespace ::com::sun::star::lang; @@ -172,7 +173,6 @@ Reference< XInterface > SAL_CALL FontIdentificator_createInstance( const Referen return static_cast< ::cppu::OWeakObject * >( new FontIdentificator ); } - // XServiceInfo OUString SAL_CALL FontIdentificator::getImplementationName() throw (RuntimeException) { @@ -181,13 +181,7 @@ OUString SAL_CALL FontIdentificator::getImplementationName() throw (RuntimeExcep sal_Bool SAL_CALL FontIdentificator::supportsService( const OUString& i_rServiceName ) throw (RuntimeException) { - Sequence< OUString > aSN( FontIdentificator_getSupportedServiceNames() ); - for( sal_Int32 nService = 0; nService < aSN.getLength(); nService++ ) - { - if( aSN[nService] == i_rServiceName ) - return sal_True; - } - return sal_False; + return cppu::supportsService(this, i_rServiceName); } Sequence< OUString > SAL_CALL FontIdentificator::getSupportedServiceNames() throw (RuntimeException) -- cgit v1.2.3