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 /fpicker | |
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 'fpicker')
-rw-r--r-- | fpicker/source/office/OfficeFilePicker.cxx | 12 | ||||
-rw-r--r-- | fpicker/source/office/OfficeFolderPicker.cxx | 12 | ||||
-rw-r--r-- | fpicker/source/win32/filepicker/FilePicker.cxx | 12 | ||||
-rw-r--r-- | fpicker/source/win32/filepicker/VistaFilePicker.cxx | 12 | ||||
-rw-r--r-- | fpicker/source/win32/folderpicker/FolderPicker.cxx | 12 |
5 files changed, 10 insertions, 50 deletions
diff --git a/fpicker/source/office/OfficeFilePicker.cxx b/fpicker/source/office/OfficeFilePicker.cxx index 13c7dbb7b234..3ec8b9fc655f 100644 --- a/fpicker/source/office/OfficeFilePicker.cxx +++ b/fpicker/source/office/OfficeFilePicker.cxx @@ -38,6 +38,7 @@ #include <unotools/ucbhelper.hxx> #include <unotools/pathoptions.hxx> #include <comphelper/sequence.hxx> +#include <cppuhelper/supportsservice.hxx> #include <cppuhelper/typeprovider.hxx> #include "osl/mutex.hxx" #include "vcl/svapp.hxx" @@ -1117,16 +1118,7 @@ OUString SAL_CALL SvtFilePicker::getImplementationName() throw( RuntimeException /* XServiceInfo */ sal_Bool SAL_CALL SvtFilePicker::supportsService( const OUString& sServiceName ) throw( RuntimeException ) { - Sequence< OUString > seqServiceNames = getSupportedServiceNames(); - const OUString* pArray = seqServiceNames.getConstArray(); - for ( sal_Int32 i = 0; i < seqServiceNames.getLength(); i++ ) - { - if ( sServiceName == pArray[i] ) - { - return sal_True ; - } - } - return sal_False ; + return cppu::supportsService(this, sServiceName); } /* XServiceInfo */ diff --git a/fpicker/source/office/OfficeFolderPicker.cxx b/fpicker/source/office/OfficeFolderPicker.cxx index 1cf1d052f938..8a00b202fb65 100644 --- a/fpicker/source/office/OfficeFolderPicker.cxx +++ b/fpicker/source/office/OfficeFolderPicker.cxx @@ -27,6 +27,7 @@ #include <com/sun/star/container/XSet.hpp> #include <com/sun/star/uno/Any.hxx> #include <cppuhelper/factory.hxx> +#include <cppuhelper/supportsservice.hxx> #include <com/sun/star/beans/XPropertySet.hpp> #include <unotools/pathoptions.hxx> @@ -161,16 +162,7 @@ OUString SAL_CALL SvtFolderPicker::getImplementationName() throw( RuntimeExcepti /* XServiceInfo */ sal_Bool SAL_CALL SvtFolderPicker::supportsService( const OUString& sServiceName ) throw( RuntimeException ) { - Sequence< OUString > seqServiceNames = getSupportedServiceNames(); - const OUString* pArray = seqServiceNames.getConstArray(); - for ( sal_Int32 i = 0; i < seqServiceNames.getLength(); i++ ) - { - if ( sServiceName == pArray[i] ) - { - return sal_True ; - } - } - return sal_False ; + return cppu::supportsService(this, sServiceName); } /* XServiceInfo */ diff --git a/fpicker/source/win32/filepicker/FilePicker.cxx b/fpicker/source/win32/filepicker/FilePicker.cxx index 5831103a9a2e..18a185844dc5 100644 --- a/fpicker/source/win32/filepicker/FilePicker.cxx +++ b/fpicker/source/win32/filepicker/FilePicker.cxx @@ -20,6 +20,7 @@ #include <tchar.h> #include <com/sun/star/lang/DisposedException.hpp> #include <cppuhelper/interfacecontainer.h> +#include <cppuhelper/supportsservice.hxx> #include <osl/diagnose.h> #include "FilePicker.hxx" @@ -713,20 +714,11 @@ OUString SAL_CALL CFilePicker::getImplementationName() return OUString(RTL_CONSTASCII_USTRINGPARAM(FILE_PICKER_IMPL_NAME)); } -// ------------------------------------------------- // XServiceInfo -// ------------------------------------------------- - sal_Bool SAL_CALL CFilePicker::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); } // ------------------------------------------------- diff --git a/fpicker/source/win32/filepicker/VistaFilePicker.cxx b/fpicker/source/win32/filepicker/VistaFilePicker.cxx index f5f343f3845f..76f0658c345c 100644 --- a/fpicker/source/win32/filepicker/VistaFilePicker.cxx +++ b/fpicker/source/win32/filepicker/VistaFilePicker.cxx @@ -37,6 +37,7 @@ #include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp> #include <cppuhelper/interfacecontainer.h> +#include <cppuhelper/supportsservice.hxx> #include <comphelper/processfactory.hxx> #include <osl/diagnose.h> #include <osl/mutex.hxx> @@ -610,20 +611,11 @@ OUString SAL_CALL VistaFilePicker::getImplementationName() return OUString("com.sun.star.comp.fpicker.VistaFileDialog"); } -// ------------------------------------------------- // XServiceInfo -// ------------------------------------------------- - sal_Bool SAL_CALL VistaFilePicker::supportsService(const OUString& sServiceName) throw(css::uno::RuntimeException ) { - css::uno::Sequence< OUString > lSupportedServicesNames = VistaFilePicker_getSupportedServiceNames(); - - for (sal_Int32 n = lSupportedServicesNames.getLength(); n--;) - if (lSupportedServicesNames[n] == sServiceName) - return sal_True; - - return sal_False; + return cppu::supportsService(this, sServiceName); } // ------------------------------------------------- diff --git a/fpicker/source/win32/folderpicker/FolderPicker.cxx b/fpicker/source/win32/folderpicker/FolderPicker.cxx index 2ea545867b24..bdf4d2294acb 100644 --- a/fpicker/source/win32/folderpicker/FolderPicker.cxx +++ b/fpicker/source/win32/folderpicker/FolderPicker.cxx @@ -21,6 +21,7 @@ #include "FolderPicker.hxx" #include <com/sun/star/lang/DisposedException.hpp> +#include <cppuhelper/supportsservice.hxx> #include "WinFOPImpl.hxx" //------------------------------------------------------------------------ @@ -149,20 +150,11 @@ OUString SAL_CALL CFolderPicker::getImplementationName( ) return OUString(RTL_CONSTASCII_USTRINGPARAM( FOLDERPICKER_IMPL_NAME )); } -// ------------------------------------------------- // XServiceInfo -// ------------------------------------------------- - sal_Bool SAL_CALL CFolderPicker::supportsService( const OUString& ServiceName ) throw( RuntimeException ) { - Sequence < OUString > SupportedServicesNames = FolderPicker_getSupportedServiceNames(); - - for ( sal_Int32 n = SupportedServicesNames.getLength(); n--; ) - if ( SupportedServicesNames[n] == ServiceName ) - return sal_True; - - return sal_False; + return cppu::supportsService(this, ServiceName); } // ------------------------------------------------- |