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 /vcl/unx/generic/dtrans | |
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 'vcl/unx/generic/dtrans')
-rw-r--r-- | vcl/unx/generic/dtrans/X11_clipboard.cxx | 13 | ||||
-rw-r--r-- | vcl/unx/generic/dtrans/X11_droptarget.cxx | 24 | ||||
-rw-r--r-- | vcl/unx/generic/dtrans/X11_selection.cxx | 17 |
3 files changed, 8 insertions, 46 deletions
diff --git a/vcl/unx/generic/dtrans/X11_clipboard.cxx b/vcl/unx/generic/dtrans/X11_clipboard.cxx index 0af14a460ff1..e7f3ece6a147 100644 --- a/vcl/unx/generic/dtrans/X11_clipboard.cxx +++ b/vcl/unx/generic/dtrans/X11_clipboard.cxx @@ -29,6 +29,7 @@ #include <uno/dispatcher.h> // declaration of generic uno interface #include <uno/mapping.hxx> // mapping stuff #include <cppuhelper/factory.hxx> +#include <cppuhelper/supportsservice.hxx> #include <rtl/tencinfo.h> #if OSL_DEBUG_LEVEL > 1 @@ -251,22 +252,12 @@ OUString SAL_CALL X11Clipboard::getImplementationName( ) return OUString(X11_CLIPBOARD_IMPLEMENTATION_NAME); } -// ------------------------------------------------------------------------ - sal_Bool SAL_CALL X11Clipboard::supportsService( const OUString& ServiceName ) throw(RuntimeException) { - Sequence < OUString > SupportedServicesNames = X11Clipboard_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 X11Clipboard::getSupportedServiceNames( ) throw(RuntimeException) { diff --git a/vcl/unx/generic/dtrans/X11_droptarget.cxx b/vcl/unx/generic/dtrans/X11_droptarget.cxx index b2e76aa63285..f8463ab7dedd 100644 --- a/vcl/unx/generic/dtrans/X11_droptarget.cxx +++ b/vcl/unx/generic/dtrans/X11_droptarget.cxx @@ -17,7 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ - +#include <cppuhelper/supportsservice.hxx> #include <X11_selection.hxx> using namespace x11; @@ -182,38 +182,20 @@ void DropTarget::dragOver( const DropTargetDragEvent& dtde ) throw() } } -// -------------------------------------------------------------------------- - -/* - * XServiceInfo - */ - -// ------------------------------------------------------------------------ - +// XServiceInfo OUString DropTarget::getImplementationName() throw() { return OUString(XDND_DROPTARGET_IMPLEMENTATION_NAME); } -// ------------------------------------------------------------------------ - sal_Bool DropTarget::supportsService( const OUString& ServiceName ) throw() { - Sequence < OUString > SupportedServicesNames = Xdnd_dropTarget_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 > DropTarget::getSupportedServiceNames() throw() { return Xdnd_dropTarget_getSupportedServiceNames(); } - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/generic/dtrans/X11_selection.cxx b/vcl/unx/generic/dtrans/X11_selection.cxx index e14baa47c79a..8a90cd9d1300 100644 --- a/vcl/unx/generic/dtrans/X11_selection.cxx +++ b/vcl/unx/generic/dtrans/X11_selection.cxx @@ -66,6 +66,8 @@ #include <comphelper/processfactory.hxx> #include <comphelper/solarmutex.hxx> +#include <cppuhelper/supportsservice.hxx> + #define DRAG_EVENT_MASK ButtonPressMask |\ ButtonReleaseMask |\ PointerMotionMask |\ @@ -4153,27 +4155,14 @@ OUString SelectionManagerHolder::getImplementationName() throw() return OUString(XDND_IMPLEMENTATION_NAME); } -// ------------------------------------------------------------------------ - sal_Bool SelectionManagerHolder::supportsService( const OUString& ServiceName ) throw() { - Sequence < OUString > SupportedServicesNames = Xdnd_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 > SelectionManagerHolder::getSupportedServiceNames() throw() { return Xdnd_getSupportedServiceNames(); } - -// ------------------------------------------------------------------------ - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |