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 | |
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')
-rw-r--r-- | vcl/source/components/dtranscomp.cxx | 12 | ||||
-rw-r--r-- | vcl/source/components/fontident.cxx | 10 | ||||
-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 | ||||
-rw-r--r-- | vcl/unx/kde/UnxFilePicker.cxx | 11 | ||||
-rw-r--r-- | vcl/unx/kde4/KDE4FilePicker.cxx | 11 |
7 files changed, 16 insertions, 82 deletions
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 <cppuhelper/supportsservice.hxx> 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 <com/sun/star/lang/DisposedException.hpp> #include <cppuhelper/implbase3.hxx> +#include <cppuhelper/supportsservice.hxx> 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) 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: */ diff --git a/vcl/unx/kde/UnxFilePicker.cxx b/vcl/unx/kde/UnxFilePicker.cxx index b5f34a151324..08d8fdb61ea5 100644 --- a/vcl/unx/kde/UnxFilePicker.cxx +++ b/vcl/unx/kde/UnxFilePicker.cxx @@ -27,6 +27,7 @@ #include <FPServiceInfo.hxx> #include <cppuhelper/interfacecontainer.h> +#include <cppuhelper/supportsservice.hxx> #include <osl/diagnose.h> #include <osl/file.hxx> #include <rtl/ustring.hxx> @@ -652,15 +653,7 @@ OUString SAL_CALL UnxFilePicker::getImplementationName() sal_Bool SAL_CALL UnxFilePicker::supportsService( const OUString& ServiceName ) throw( uno::RuntimeException ) { - uno::Sequence< OUString > SupportedServicesNames = FilePicker_getSupportedServiceNames(); - - for ( sal_Int32 n = SupportedServicesNames.getLength(); n--; ) - { - if ( SupportedServicesNames[n] == ServiceName ) - return sal_True; - } - - return sal_False; + return cppu::supportsService(this, ServiceName); } uno::Sequence< OUString > SAL_CALL UnxFilePicker::getSupportedServiceNames() diff --git a/vcl/unx/kde4/KDE4FilePicker.cxx b/vcl/unx/kde4/KDE4FilePicker.cxx index aa5d4d08e925..6d4475474a15 100644 --- a/vcl/unx/kde4/KDE4FilePicker.cxx +++ b/vcl/unx/kde4/KDE4FilePicker.cxx @@ -20,6 +20,7 @@ #include <com/sun/star/lang/DisposedException.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <cppuhelper/interfacecontainer.h> +#include <cppuhelper/supportsservice.hxx> #include <com/sun/star/ui/dialogs/TemplateDescription.hpp> #include <com/sun/star/ui/dialogs/CommonFilePickerElementIds.hpp> #include <com/sun/star/ui/dialogs/ExtendedFilePickerElementIds.hpp> @@ -703,15 +704,7 @@ OUString SAL_CALL KDE4FilePicker::getImplementationName() sal_Bool SAL_CALL KDE4FilePicker::supportsService( const OUString& ServiceName ) throw( uno::RuntimeException ) { - uno::Sequence< OUString > SupportedServicesNames = FilePicker_getSupportedServiceNames(); - - for ( sal_Int32 n = SupportedServicesNames.getLength(); n--; ) - { - if ( SupportedServicesNames[n] == ServiceName ) - return sal_True; - } - - return sal_False; + return cppu::supportsService(this, ServiceName); } uno::Sequence< OUString > SAL_CALL KDE4FilePicker::getSupportedServiceNames() |