diff options
author | Marcos Paulo de Souza <marcos.souza.org@gmail.com> | 2013-10-23 14:35:10 -0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2013-10-25 08:19:58 +0000 |
commit | 704f95e5255ff72bfb548d50d66d4da61dc483ef (patch) | |
tree | 3b0799aa8ce5185f4775966f733e1acb2df6285c /shell | |
parent | a95ecd8b65ea2275a66f6694f0c09e3faaef4407 (diff) |
fdo#54938: More uses of cppu::supportsService
Change-Id: I90a7a07a43559b8d7e1d4b886b2624255200d46b
Reviewed-on: https://gerrit.libreoffice.org/6406
Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'shell')
-rw-r--r-- | shell/source/backends/localebe/localebackend.cxx | 17 | ||||
-rw-r--r-- | shell/source/backends/macbe/macbackend.mm | 15 | ||||
-rw-r--r-- | shell/source/backends/wininetbe/wininetbackend.cxx | 16 | ||||
-rw-r--r-- | shell/source/cmdmail/cmdmailsuppl.cxx | 18 | ||||
-rw-r--r-- | shell/source/unix/exec/shellexec.cxx | 19 | ||||
-rw-r--r-- | shell/source/win32/SysShExec.cxx | 18 | ||||
-rw-r--r-- | shell/source/win32/simplemail/smplmailsuppl.cxx | 9 |
7 files changed, 14 insertions, 98 deletions
diff --git a/shell/source/backends/localebe/localebackend.cxx b/shell/source/backends/localebe/localebackend.cxx index 42405d76f0db..35f43d4e2c05 100644 --- a/shell/source/backends/localebe/localebackend.cxx +++ b/shell/source/backends/localebe/localebackend.cxx @@ -20,6 +20,7 @@ #include "localebackend.hxx" #include <com/sun/star/beans/Optional.hpp> +#include <cppuhelper/supportsservice.hxx> #include <osl/time.h> #include <stdio.h> @@ -311,16 +312,12 @@ OUString SAL_CALL LocaleBackend::getBackendName(void) { return OUString("com.sun.star.comp.configuration.backend.LocaleBackend") ; } -//------------------------------------------------------------------------------ - OUString SAL_CALL LocaleBackend::getImplementationName(void) throw (uno::RuntimeException) { return getBackendName() ; } -//------------------------------------------------------------------------------ - uno::Sequence<OUString> SAL_CALL LocaleBackend::getBackendServiceNames(void) { uno::Sequence<OUString> aServiceNameList(1); @@ -328,22 +325,12 @@ uno::Sequence<OUString> SAL_CALL LocaleBackend::getBackendServiceNames(void) return aServiceNameList ; } -//------------------------------------------------------------------------------ - sal_Bool SAL_CALL LocaleBackend::supportsService(const OUString& aServiceName) throw (uno::RuntimeException) { - uno::Sequence< OUString > const svc = getBackendServiceNames(); - - for(sal_Int32 i = 0; i < svc.getLength(); ++i ) - if(svc[i] == aServiceName) - return true; - - return false; + return cppu::supportsService(this, aServiceName); } -//------------------------------------------------------------------------------ - uno::Sequence<OUString> SAL_CALL LocaleBackend::getSupportedServiceNames(void) throw (uno::RuntimeException) { diff --git a/shell/source/backends/macbe/macbackend.mm b/shell/source/backends/macbe/macbackend.mm index e57013e5297c..4a095ff75996 100644 --- a/shell/source/backends/macbe/macbackend.mm +++ b/shell/source/backends/macbe/macbackend.mm @@ -29,6 +29,7 @@ #include "macbackend.hxx" #include "com/sun/star/beans/Optional.hpp" +#include <cppuhelper/supportsservice.hxx> #include "rtl/ustrbuf.hxx" #include "osl/file.h" @@ -447,8 +448,6 @@ rtl::OUString SAL_CALL MacOSXBackend::getImplementationName(void) return getBackendName(); } -//------------------------------------------------------------------------------ - uno::Sequence<rtl::OUString> SAL_CALL MacOSXBackend::getBackendServiceNames(void) { uno::Sequence<rtl::OUString> aServiceNameList(1); @@ -457,22 +456,12 @@ uno::Sequence<rtl::OUString> SAL_CALL MacOSXBackend::getBackendServiceNames(void return aServiceNameList; } -//------------------------------------------------------------------------------ - sal_Bool SAL_CALL MacOSXBackend::supportsService(const rtl::OUString& aServiceName) throw (uno::RuntimeException) { - uno::Sequence< rtl::OUString > const svc = getBackendServiceNames(); - - for(sal_Int32 i = 0; i < svc.getLength(); ++i ) - if(svc[i] == aServiceName) - return true; - - return false; + return cppu::supportsService(this, aServiceName); } -//------------------------------------------------------------------------------ - uno::Sequence<rtl::OUString> SAL_CALL MacOSXBackend::getSupportedServiceNames(void) throw (uno::RuntimeException) { diff --git a/shell/source/backends/wininetbe/wininetbackend.cxx b/shell/source/backends/wininetbe/wininetbackend.cxx index 559eb0e51d5b..69b8f28a8e24 100644 --- a/shell/source/backends/wininetbe/wininetbackend.cxx +++ b/shell/source/backends/wininetbe/wininetbackend.cxx @@ -17,7 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ - +#include <cppuhelper/supportsservice.hxx> #include "rtl/ustrbuf.hxx" #include "wininetbackend.hxx" @@ -374,8 +374,6 @@ OUString SAL_CALL WinInetBackend::getImplementationName(void) return getBackendName() ; } -//------------------------------------------------------------------------------ - uno::Sequence<OUString> SAL_CALL WinInetBackend::getBackendServiceNames(void) { uno::Sequence<OUString> aServiceNameList(1); @@ -384,22 +382,12 @@ uno::Sequence<OUString> SAL_CALL WinInetBackend::getBackendServiceNames(void) return aServiceNameList ; } -//------------------------------------------------------------------------------ - sal_Bool SAL_CALL WinInetBackend::supportsService(const OUString& aServiceName) throw (uno::RuntimeException) { - uno::Sequence< OUString > const svc = getBackendServiceNames(); - - for(sal_Int32 i = 0; i < svc.getLength(); ++i ) - if(svc[i] == aServiceName) - return true; - - return false; + return cppu::supportsService(this, aServiceName); } -//------------------------------------------------------------------------------ - uno::Sequence<OUString> SAL_CALL WinInetBackend::getSupportedServiceNames(void) throw (uno::RuntimeException) { diff --git a/shell/source/cmdmail/cmdmailsuppl.cxx b/shell/source/cmdmail/cmdmailsuppl.cxx index 90f5e8af051a..ab670afbde59 100644 --- a/shell/source/cmdmail/cmdmailsuppl.cxx +++ b/shell/source/cmdmail/cmdmailsuppl.cxx @@ -34,6 +34,7 @@ #include <com/sun/star/beans/PropertyValue.hpp> #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/uno/XComponentContext.hpp> +#include <cppuhelper/supportsservice.hxx> #include <string.h> #include <errno.h> @@ -267,36 +268,21 @@ void SAL_CALL CmdMailSuppl::sendSimpleMailMessage( const Reference< XSimpleMailM } } -// ------------------------------------------------- // XServiceInfo -// ------------------------------------------------- - OUString SAL_CALL CmdMailSuppl::getImplementationName( ) throw( RuntimeException ) { return OUString(COMP_IMPL_NAME); } -// ------------------------------------------------- // XServiceInfo -// ------------------------------------------------- - sal_Bool SAL_CALL CmdMailSuppl::supportsService( const OUString& ServiceName ) throw( RuntimeException ) { - Sequence < OUString > SupportedServicesNames = Component_getSupportedServiceNames(); - - for ( sal_Int32 n = SupportedServicesNames.getLength(); n--; ) - if ( SupportedServicesNames[n] == ServiceName ) - return sal_True; - - return sal_False; + return cppu::supportsService(this, ServiceName); } -// ------------------------------------------------- // XServiceInfo -// ------------------------------------------------- - Sequence< OUString > SAL_CALL CmdMailSuppl::getSupportedServiceNames( ) throw( RuntimeException ) { diff --git a/shell/source/unix/exec/shellexec.cxx b/shell/source/unix/exec/shellexec.cxx index 3f97806d33c5..b3138677e09e 100644 --- a/shell/source/unix/exec/shellexec.cxx +++ b/shell/source/unix/exec/shellexec.cxx @@ -33,6 +33,7 @@ #include <com/sun/star/uri/XExternalUriReferenceTranslator.hpp> #include <com/sun/star/uri/ExternalUriReferenceTranslator.hpp> #include <com/sun/star/uri/UriReferenceFactory.hpp> +#include <cppuhelper/supportsservice.hxx> #include "uno/current_context.hxx" @@ -265,37 +266,21 @@ void SAL_CALL ShellExec::execute( const OUString& aCommand, const OUString& aPar } } - -// ------------------------------------------------- // XServiceInfo -// ------------------------------------------------- - OUString SAL_CALL ShellExec::getImplementationName( ) throw( RuntimeException ) { return OUString(SHELLEXEC_IMPL_NAME ); } -// ------------------------------------------------- // XServiceInfo -// ------------------------------------------------- - sal_Bool SAL_CALL ShellExec::supportsService( const OUString& ServiceName ) throw( RuntimeException ) { - Sequence < OUString > SupportedServicesNames = ShellExec_getSupportedServiceNames(); - - for ( sal_Int32 n = SupportedServicesNames.getLength(); n--; ) - if ( SupportedServicesNames[n] == ServiceName ) - return sal_True; - - return sal_False; + return cppu::supportsService(this, ServiceName); } -// ------------------------------------------------- // XServiceInfo -// ------------------------------------------------- - Sequence< OUString > SAL_CALL ShellExec::getSupportedServiceNames( ) throw( RuntimeException ) { diff --git a/shell/source/win32/SysShExec.cxx b/shell/source/win32/SysShExec.cxx index b08160764b95..1a39e9ab472b 100644 --- a/shell/source/win32/SysShExec.cxx +++ b/shell/source/win32/SysShExec.cxx @@ -24,6 +24,7 @@ #include <com/sun/star/system/SystemShellExecuteFlags.hpp> #include <com/sun/star/uri/UriReferenceFactory.hpp> +#include <cppuhelper/supportsservice.hxx> #define WIN32_LEAN_AND_MEAN #if defined _MSC_VER @@ -341,36 +342,21 @@ void SAL_CALL CSysShExec::execute( const OUString& aCommand, const OUString& aPa } } -// ------------------------------------------------- // XServiceInfo -// ------------------------------------------------- - OUString SAL_CALL CSysShExec::getImplementationName( ) throw( RuntimeException ) { return OUString(SYSSHEXEC_IMPL_NAME ); } -// ------------------------------------------------- // XServiceInfo -// ------------------------------------------------- - sal_Bool SAL_CALL CSysShExec::supportsService( const OUString& ServiceName ) throw( RuntimeException ) { - Sequence < OUString > SupportedServicesNames = SysShExec_getSupportedServiceNames(); - - for ( sal_Int32 n = SupportedServicesNames.getLength(); n--; ) - if ( SupportedServicesNames[n] == ServiceName ) - return sal_True; - - return sal_False; + return cppu::supportsService(this, ServiceName); } -// ------------------------------------------------- // XServiceInfo -// ------------------------------------------------- - Sequence< OUString > SAL_CALL CSysShExec::getSupportedServiceNames( ) throw( RuntimeException ) { diff --git a/shell/source/win32/simplemail/smplmailsuppl.cxx b/shell/source/win32/simplemail/smplmailsuppl.cxx index 610699459822..6f530db8d989 100644 --- a/shell/source/win32/simplemail/smplmailsuppl.cxx +++ b/shell/source/win32/simplemail/smplmailsuppl.cxx @@ -17,6 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <cppuhelper/supportsservice.hxx> #include <osl/diagnose.h> #include "smplmailsuppl.hxx" #include "smplmailclient.hxx" @@ -79,13 +80,7 @@ OUString SAL_CALL CSmplMailSuppl::getImplementationName() sal_Bool SAL_CALL CSmplMailSuppl::supportsService(const OUString& ServiceName) throw(RuntimeException) { - Sequence <OUString> SupportedServicesNames = Component_getSupportedServiceNames(); - - for (sal_Int32 n = SupportedServicesNames.getLength(); n--;) - if ( SupportedServicesNames[n] == ServiceName ) - return sal_True; - - return sal_False; + return cppu::supportsService(this, ServiceName); } Sequence<OUString> SAL_CALL CSmplMailSuppl::getSupportedServiceNames() |