diff options
author | Marcos Paulo de Souza <marcos.souza.org@gmail.com> | 2013-09-25 15:41:29 -0300 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2013-10-07 17:01:33 +0000 |
commit | 7235d23267e4591e5cf47762abd3f63421b06904 (patch) | |
tree | 6353239b1c586642e22c5df892a7c0560e632fa5 /dtrans | |
parent | 8e37c7ae282f10724d6322aa028a7dd6b698f071 (diff) |
fdo#54938: Adapt supportsService implementations to cppu::supportsService
Change-Id: I683c0d30c3286ed5d725d4eefe8b3977b82ee316
Reviewed-on: https://gerrit.libreoffice.org/6035
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'dtrans')
-rw-r--r-- | dtrans/source/cnttype/mcnttfactory.cxx | 12 | ||||
-rw-r--r-- | dtrans/source/generic/clipboardmanager.cxx | 11 | ||||
-rw-r--r-- | dtrans/source/generic/generic_clipboard.cxx | 11 | ||||
-rw-r--r-- | dtrans/source/win32/clipb/WinClipboard.cxx | 12 | ||||
-rw-r--r-- | dtrans/source/win32/ftransl/ftransl.cxx | 12 |
5 files changed, 10 insertions, 48 deletions
diff --git a/dtrans/source/cnttype/mcnttfactory.cxx b/dtrans/source/cnttype/mcnttfactory.cxx index ec43fcdbc5d6..8aa26febb320 100644 --- a/dtrans/source/cnttype/mcnttfactory.cxx +++ b/dtrans/source/cnttype/mcnttfactory.cxx @@ -18,6 +18,7 @@ */ #include <osl/diagnose.h> +#include <cppuhelper/supportsservice.hxx> #include "mcnttfactory.hxx" #include "mcnttype.hxx" @@ -77,20 +78,11 @@ OUString SAL_CALL CMimeContentTypeFactory::getImplementationName( ) return OUString( MIMECONTENTTYPEFACTORY_IMPL_NAME ); } -// ------------------------------------------------- // XServiceInfo -// ------------------------------------------------- - sal_Bool SAL_CALL CMimeContentTypeFactory::supportsService( const OUString& ServiceName ) throw( RuntimeException ) { - Sequence < OUString > SupportedServicesNames = MimeContentTypeFactory_getSupportedServiceNames(); - - for ( sal_Int32 n = SupportedServicesNames.getLength(); n--; ) - if ( SupportedServicesNames[n] == ServiceName ) - return sal_True; - - return sal_False; + return cppu::supportsService(this, ServiceName); } // ------------------------------------------------- diff --git a/dtrans/source/generic/clipboardmanager.cxx b/dtrans/source/generic/clipboardmanager.cxx index d4f6f9dbdb7d..6d130615d61a 100644 --- a/dtrans/source/generic/clipboardmanager.cxx +++ b/dtrans/source/generic/clipboardmanager.cxx @@ -19,6 +19,7 @@ #include <clipboardmanager.hxx> #include <com/sun/star/lang/DisposedException.hpp> +#include <cppuhelper/supportsservice.hxx> using namespace com::sun::star::container; using namespace com::sun::star::datatransfer; @@ -53,18 +54,10 @@ OUString SAL_CALL ClipboardManager::getImplementationName( ) return OUString(CLIPBOARDMANAGER_IMPLEMENTATION_NAME); } -// ------------------------------------------------------------------------ - sal_Bool SAL_CALL ClipboardManager::supportsService( const OUString& ServiceName ) throw(RuntimeException) { - Sequence < OUString > SupportedServicesNames = ClipboardManager_getSupportedServiceNames(); - - for ( sal_Int32 n = 0, nmax = SupportedServicesNames.getLength(); n < nmax; n++ ) - if ( SupportedServicesNames[n] == ServiceName ) - return sal_True; - - return sal_False; + return cppu::supportsService(this, ServiceName); } // ------------------------------------------------------------------------ diff --git a/dtrans/source/generic/generic_clipboard.cxx b/dtrans/source/generic/generic_clipboard.cxx index 04e813542087..d582ccad159c 100644 --- a/dtrans/source/generic/generic_clipboard.cxx +++ b/dtrans/source/generic/generic_clipboard.cxx @@ -20,6 +20,7 @@ #include <generic_clipboard.hxx> #include <com/sun/star/lang/DisposedException.hpp> #include <com/sun/star/datatransfer/clipboard/RenderingCapabilities.hpp> +#include <cppuhelper/supportsservice.hxx> using namespace com::sun::star::datatransfer; using namespace com::sun::star::datatransfer::clipboard; @@ -66,18 +67,10 @@ OUString SAL_CALL GenericClipboard::getImplementationName( ) return OUString(GENERIC_CLIPBOARD_IMPLEMENTATION_NAME); } -// ------------------------------------------------------------------------ - sal_Bool SAL_CALL GenericClipboard::supportsService( const OUString& ServiceName ) throw(RuntimeException) { - Sequence < OUString > SupportedServicesNames = GenericClipboard_getSupportedServiceNames(); - - for ( sal_Int32 n = SupportedServicesNames.getLength(); n--; ) - if ( SupportedServicesNames[n] == ServiceName ) - return sal_True; - - return sal_False; + return cppu::supportsService(this, ServiceName); } // ------------------------------------------------------------------------ diff --git a/dtrans/source/win32/clipb/WinClipboard.cxx b/dtrans/source/win32/clipb/WinClipboard.cxx index ef7d410aa039..66f54441055b 100644 --- a/dtrans/source/win32/clipb/WinClipboard.cxx +++ b/dtrans/source/win32/clipb/WinClipboard.cxx @@ -22,6 +22,7 @@ #include <com/sun/star/datatransfer/clipboard/ClipboardEvent.hpp> #include <com/sun/star/lang/DisposedException.hpp> #include <com/sun/star/lang/IllegalArgumentException.hpp> +#include <cppuhelper/supportsservice.hxx> #include "WinClipbImpl.hxx" //------------------------------------------------------------------------ @@ -277,20 +278,11 @@ OUString SAL_CALL CWinClipboard::getImplementationName( ) return OUString( WINCLIPBOARD_IMPL_NAME ); } -// ------------------------------------------------- // XServiceInfo -// ------------------------------------------------- - sal_Bool SAL_CALL CWinClipboard::supportsService( const OUString& ServiceName ) throw(RuntimeException) { - Sequence < OUString > SupportedServicesNames = WinClipboard_getSupportedServiceNames(); - - for ( sal_Int32 n = SupportedServicesNames.getLength(); n--; ) - if ( SupportedServicesNames[n] == ServiceName ) - return sal_True; - - return sal_False; + return cppu::supportsService(this, ServiceName); } // ------------------------------------------------- diff --git a/dtrans/source/win32/ftransl/ftransl.cxx b/dtrans/source/win32/ftransl/ftransl.cxx index b808fe89c9b0..41b903ab9742 100644 --- a/dtrans/source/win32/ftransl/ftransl.cxx +++ b/dtrans/source/win32/ftransl/ftransl.cxx @@ -23,6 +23,7 @@ #include <com/sun/star/datatransfer/XMimeContentType.hpp> #include <com/sun/star/datatransfer/MimeContentTypeFactory.hpp> #include <com/sun/star/uno/XComponentContext.hpp> +#include <cppuhelper/supportsservice.hxx> #include "../misc/ImplHelper.hxx" #if defined _MSC_VER @@ -214,20 +215,11 @@ OUString SAL_CALL CDataFormatTranslator::getImplementationName( ) return OUString( IMPL_NAME ); } -// ------------------------------------------------- // XServiceInfo -// ------------------------------------------------- - sal_Bool SAL_CALL CDataFormatTranslator::supportsService( const OUString& ServiceName ) throw( RuntimeException ) { - Sequence < OUString > SupportedServicesNames = DataFormatTranslator_getSupportedServiceNames(); - - for ( sal_Int32 n = SupportedServicesNames.getLength(); n--; ) - if ( SupportedServicesNames[n] == ServiceName ) - return sal_True; - - return sal_False; + return cppu::supportsService(this, ServiceName); } // ------------------------------------------------- |