From ee5661ecd3bbeae38b04cd3f582a320a231d11bd Mon Sep 17 00:00:00 2001 From: Marcos Paulo de Souza Date: Mon, 21 Oct 2013 19:04:05 -0200 Subject: fdo#54938: Adapt supportsService implementations.. to cppu::supportsService Change-Id: I0b03d3910f094f2183bf9859db9d5bcaf35d1f14 Reviewed-on: https://gerrit.libreoffice.org/6370 Reviewed-by: Stephan Bergmann Tested-by: Stephan Bergmann --- eventattacher/source/eventattacher.cxx | 10 +---- filter/source/config/cache/basecontainer.cxx | 17 +-------- filter/source/msfilter/msvbahelper.cxx | 6 +-- fpicker/source/aqua/SalAquaFilePicker.mm | 18 +-------- fpicker/source/aqua/SalAquaFolderPicker.mm | 16 +------- io/source/TextInputStream/TextInputStream.cxx | 10 +---- io/source/TextOutputStream/TextOutputStream.cxx | 10 +---- io/source/acceptor/acceptor.cxx | 10 +---- io/source/connector/connector.cxx | 10 +---- io/source/stm/odata.cxx | 43 +++------------------- lotuswordpro/source/filter/lwpfilter.cxx | 12 ++---- scripting/source/basprov/basprov.cxx | 16 +------- scripting/source/dlgprov/DialogModelProvider.cxx | 8 +--- scripting/source/dlgprov/dlgprov.cxx | 13 +------ scripting/source/protocolhandler/scripthandler.cxx | 16 ++------ .../source/provider/BrowseNodeFactoryImpl.cxx | 18 ++------- scripting/source/provider/MasterScriptProvider.cxx | 13 +------ scripting/source/stringresource/stringresource.cxx | 33 ++--------------- sfx2/source/appl/appinit.cxx | 13 +------ sfx2/source/appl/appuno.cxx | 13 ++----- sfx2/source/appl/xpackcreator.cxx | 13 +------ sfx2/source/doc/SfxDocumentMetaData.cxx | 16 +------- sfx2/source/doc/ownsubfilterservice.cxx | 14 +------ sfx2/source/doc/sfxmodelfactory.cxx | 14 +------ sfx2/source/view/frmload.cxx | 12 +----- stoc/source/corereflection/crefl.cxx | 10 +---- stoc/source/defaultregistry/defaultregistry.cxx | 11 +----- stoc/source/implementationregistration/implreg.cxx | 8 +--- stoc/source/inspect/introspection.cxx | 8 +--- stoc/source/invocation/invocation.cxx | 8 +--- .../source/invocation_adapterfactory/iafactory.cxx | 10 +---- stoc/source/javaloader/javaloader.cxx | 10 +---- stoc/source/javavm/javavm.cxx | 7 +--- stoc/source/loader/dllcomponentloader.cxx | 10 +---- stoc/source/namingservice/namingservice.cxx | 10 +---- stoc/source/proxy_factory/proxyfac.cxx | 12 +----- stoc/source/security/access_controller.cxx | 12 +----- stoc/source/security/file_policy.cxx | 12 +----- stoc/source/servicemanager/servicemanager.cxx | 10 +---- stoc/source/typeconv/convert.cxx | 8 +--- stoc/test/testsmgr_cpnt.cxx | 10 +---- testtools/source/bridgetest/bridgetest.cxx | 10 +---- testtools/source/bridgetest/cppobj.cxx | 10 +---- testtools/source/performance/ubobject.cxx | 10 +---- testtools/source/performance/ubtest.cxx | 9 +---- toolkit/source/awt/asynccallback.cxx | 8 +--- toolkit/source/awt/vclxaccessiblecomponent.cxx | 9 +---- toolkit/source/awt/vclxmenu.cxx | 13 ++----- toolkit/source/awt/vclxtoolkit.cxx | 12 +----- .../controls/grid/defaultgridcolumnmodel.cxx | 9 +---- .../source/controls/grid/defaultgriddatamodel.cxx | 5 +-- toolkit/source/controls/grid/gridcolumn.cxx | 9 +---- .../source/controls/grid/sortablegriddatamodel.cxx | 9 +---- toolkit/source/controls/unocontrol.cxx | 12 +----- toolkit/source/controls/unocontrolmodel.cxx | 10 +---- ucb/source/core/cmdenv.cxx | 10 +---- ucb/source/ucp/expand/ucpexpand.cxx | 16 ++------ .../ucp/tdoc/tdoc_documentcontentfactory.cxx | 12 +----- vcl/source/components/dtranscomp.cxx | 12 +----- vcl/source/components/fontident.cxx | 10 +---- vcl/unx/generic/dtrans/X11_clipboard.cxx | 13 +------ vcl/unx/generic/dtrans/X11_droptarget.cxx | 24 ++---------- vcl/unx/generic/dtrans/X11_selection.cxx | 17 ++------- vcl/unx/kde/UnxFilePicker.cxx | 11 +----- vcl/unx/kde4/KDE4FilePicker.cxx | 11 +----- xmlhelp/source/cxxhelp/provider/provider.cxx | 11 +----- xmlscript/source/xmlflat_imexp/xmlbas_export.cxx | 10 +---- xmlscript/source/xmlflat_imexp/xmlbas_import.cxx | 11 +----- 68 files changed, 148 insertions(+), 685 deletions(-) diff --git a/eventattacher/source/eventattacher.cxx b/eventattacher/source/eventattacher.cxx index 09275b0dae4d..4830336fa3ea 100644 --- a/eventattacher/source/eventattacher.cxx +++ b/eventattacher/source/eventattacher.cxx @@ -38,6 +38,7 @@ #include #include #include +#include using namespace com::sun::star::uno; using namespace com::sun::star::registry; @@ -314,19 +315,12 @@ OUString SAL_CALL EventAttacherImpl::getImplementationName( ) return OUString( IMPLNAME ); } -//************************************************************************* sal_Bool SAL_CALL EventAttacherImpl::supportsService( const OUString& ServiceName ) throw(RuntimeException) { - Sequence< OUString > aSNL = getSupportedServiceNames(); - const OUString * pArray = aSNL.getArray(); - for( sal_Int32 i = 0; i < aSNL.getLength(); i++ ) - if( pArray[i] == ServiceName ) - return sal_True; - return sal_False; + return cppu::supportsService(this, ServiceName); } -//************************************************************************* Sequence SAL_CALL EventAttacherImpl::getSupportedServiceNames( ) throw(RuntimeException) { diff --git a/filter/source/config/cache/basecontainer.cxx b/filter/source/config/cache/basecontainer.cxx index fc93f4f39b2a..de888aaf0aab 100644 --- a/filter/source/config/cache/basecontainer.cxx +++ b/filter/source/config/cache/basecontainer.cxx @@ -25,10 +25,10 @@ #include #include #include +#include #include #include - #define LOAD_IMPLICIT namespace filter{ @@ -166,22 +166,9 @@ OUString SAL_CALL BaseContainer::getImplementationName() sal_Bool SAL_CALL BaseContainer::supportsService(const OUString& sServiceName) throw (css::uno::RuntimeException) { - // SAFE -> - ::osl::ResettableMutexGuard aLock(m_aLock); - - sal_Int32 c = m_lServiceNames.getLength(); - const OUString* pNames = m_lServiceNames.getConstArray(); - for (sal_Int32 i=0; i SAL_CALL BaseContainer::getSupportedServiceNames() throw (css::uno::RuntimeException) { diff --git a/filter/source/msfilter/msvbahelper.cxx b/filter/source/msfilter/msvbahelper.cxx index 4a5576f0bed7..e5c72e59e000 100644 --- a/filter/source/msfilter/msvbahelper.cxx +++ b/filter/source/msfilter/msvbahelper.cxx @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -543,10 +544,7 @@ OUString SAL_CALL VBAMacroResolver::getImplementationName() throw (uno::RuntimeE sal_Bool SAL_CALL VBAMacroResolver::supportsService( const OUString& rService ) throw (uno::RuntimeException) { - uno::Sequence< OUString > aServices = VBAMacroResolver_getSupportedServiceNames(); - const OUString* pArray = aServices.getConstArray(); - const OUString* pArrayEnd = pArray + aServices.getLength(); - return ::std::find( pArray, pArrayEnd, rService ) != pArrayEnd; + return cppu::supportsService(this, rService); } uno::Sequence< OUString > SAL_CALL VBAMacroResolver::getSupportedServiceNames() throw (uno::RuntimeException) diff --git a/fpicker/source/aqua/SalAquaFilePicker.mm b/fpicker/source/aqua/SalAquaFilePicker.mm index fbae6e4d98f1..50d251ca704f 100644 --- a/fpicker/source/aqua/SalAquaFilePicker.mm +++ b/fpicker/source/aqua/SalAquaFilePicker.mm @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -658,22 +659,7 @@ throw( uno::RuntimeException ) sal_Bool SAL_CALL SalAquaFilePicker::supportsService( const rtl::OUString& sServiceName ) throw( uno::RuntimeException ) { - DBG_PRINT_ENTRY(CLASS_NAME, __func__, "service name", sServiceName); - - sal_Bool retVal = sal_False; - - uno::Sequence supportedServicesNames = FilePicker_getSupportedServiceNames(); - - for( sal_Int32 n = supportedServicesNames.getLength(); n--; ) { - if( supportedServicesNames[n] == sServiceName ) { - retVal = sal_True; - break; - } - } - - DBG_PRINT_EXIT(CLASS_NAME, __func__); - - return retVal; + return cppu:supportsService(this, sServiceName); } uno::Sequence SAL_CALL SalAquaFilePicker::getSupportedServiceNames() diff --git a/fpicker/source/aqua/SalAquaFolderPicker.mm b/fpicker/source/aqua/SalAquaFolderPicker.mm index e7de5b709b8c..3eb590b5cfc6 100644 --- a/fpicker/source/aqua/SalAquaFolderPicker.mm +++ b/fpicker/source/aqua/SalAquaFolderPicker.mm @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -220,20 +221,7 @@ rtl::OUString SAL_CALL SalAquaFolderPicker::getImplementationName() sal_Bool SAL_CALL SalAquaFolderPicker::supportsService( const rtl::OUString& sServiceName ) throw( uno::RuntimeException ) { - DBG_PRINT_ENTRY(CLASS_NAME, __func__, "serviceName", sServiceName); - - sal_Bool retVal = sal_False; - uno::Sequence supportedServicesNames = FolderPicker_getSupportedServiceNames(); - - for( sal_Int32 n = supportedServicesNames.getLength(); n--; ) { - if( supportedServicesNames[n] == sServiceName ) { - retVal = sal_True; - break; - } - } - - DBG_PRINT_EXIT(CLASS_NAME, __func__, retVal); - return retVal; + return cppu::supportsService(this, sServiceName); } uno::Sequence SAL_CALL SalAquaFolderPicker::getSupportedServiceNames() diff --git a/io/source/TextInputStream/TextInputStream.cxx b/io/source/TextInputStream/TextInputStream.cxx index a5b6de3bff41..bf712317aa67 100644 --- a/io/source/TextInputStream/TextInputStream.cxx +++ b/io/source/TextInputStream/TextInputStream.cxx @@ -25,6 +25,7 @@ #include #include #include +#include #include #include @@ -452,14 +453,7 @@ OUString OTextInputStream::getImplementationName() throw() sal_Bool OTextInputStream::supportsService(const OUString& ServiceName) throw() { - Sequence< OUString > aSNL = getSupportedServiceNames(); - const OUString * pArray = aSNL.getConstArray(); - - for( sal_Int32 i = 0; i < aSNL.getLength(); i++ ) - if( pArray[i] == ServiceName ) - return sal_True; - - return sal_False; + return cppu::supportsService(this, ServiceName); } Sequence< OUString > OTextInputStream::getSupportedServiceNames(void) throw() diff --git a/io/source/TextOutputStream/TextOutputStream.cxx b/io/source/TextOutputStream/TextOutputStream.cxx index 53487ddb278c..f7d309c1d162 100644 --- a/io/source/TextOutputStream/TextOutputStream.cxx +++ b/io/source/TextOutputStream/TextOutputStream.cxx @@ -25,6 +25,7 @@ #include #include #include +#include #include #include @@ -251,14 +252,7 @@ OUString OTextOutputStream::getImplementationName() throw() sal_Bool OTextOutputStream::supportsService(const OUString& ServiceName) throw() { - Sequence< OUString > aSNL = getSupportedServiceNames(); - const OUString * pArray = aSNL.getConstArray(); - - for( sal_Int32 i = 0; i < aSNL.getLength(); i++ ) - if( pArray[i] == ServiceName ) - return sal_True; - - return sal_False; + return cppu::supportsService(this, ServiceName); } Sequence< OUString > OTextOutputStream::getSupportedServiceNames(void) throw() diff --git a/io/source/acceptor/acceptor.cxx b/io/source/acceptor/acceptor.cxx index 8f94584f921b..61059e6894f0 100644 --- a/io/source/acceptor/acceptor.cxx +++ b/io/source/acceptor/acceptor.cxx @@ -24,6 +24,7 @@ #include #include #include +#include #include "cppuhelper/unourl.hxx" #include "rtl/malformeduriexception.hxx" @@ -291,14 +292,7 @@ namespace io_acceptor sal_Bool OAcceptor::supportsService(const OUString& ServiceName) throw() { - Sequence< OUString > aSNL = getSupportedServiceNames(); - const OUString * pArray = aSNL.getConstArray(); - - for( sal_Int32 i = 0; i < aSNL.getLength(); i++ ) - if( pArray[i] == ServiceName ) - return sal_True; - - return sal_False; + return cppu::supportsService(this, ServiceName); } Sequence< OUString > OAcceptor::getSupportedServiceNames(void) throw() diff --git a/io/source/connector/connector.cxx b/io/source/connector/connector.cxx index 22bee639e9fd..966a2b6f5f60 100644 --- a/io/source/connector/connector.cxx +++ b/io/source/connector/connector.cxx @@ -24,6 +24,7 @@ #include #include #include +#include #include "cppuhelper/unourl.hxx" #include "rtl/malformeduriexception.hxx" @@ -192,14 +193,7 @@ namespace stoc_connector sal_Bool OConnector::supportsService(const OUString& ServiceName) throw() { - Sequence< OUString > aSNL = getSupportedServiceNames(); - const OUString * pArray = aSNL.getConstArray(); - - for( sal_Int32 i = 0; i < aSNL.getLength(); i++ ) - if( pArray[i] == ServiceName ) - return sal_True; - - return sal_False; + return cppu::supportsService(this, ServiceName); } Sequence< OUString > OConnector::getSupportedServiceNames(void) throw() diff --git a/io/source/stm/odata.cxx b/io/source/stm/odata.cxx index 18f07cbe1e9f..dcc471673d99 100644 --- a/io/source/stm/odata.cxx +++ b/io/source/stm/odata.cxx @@ -25,6 +25,7 @@ #include #include #include +#include #include #include @@ -461,14 +462,7 @@ OUString ODataInputStream::getImplementationName() throw () // XServiceInfo sal_Bool ODataInputStream::supportsService(const OUString& ServiceName) throw () { - Sequence< OUString > aSNL = getSupportedServiceNames(); - const OUString * pArray = aSNL.getConstArray(); - - for( sal_Int32 i = 0; i < aSNL.getLength(); i++ ) - if( pArray[i] == ServiceName ) - return sal_True; - - return sal_False; + return cppu::supportsService(this, ServiceName); } // XServiceInfo @@ -869,14 +863,7 @@ OUString ODataOutputStream::getImplementationName() throw () // XServiceInfo sal_Bool ODataOutputStream::supportsService(const OUString& ServiceName) throw () { - Sequence< OUString > aSNL = getSupportedServiceNames(); - const OUString * pArray = aSNL.getConstArray(); - - for( sal_Int32 i = 0; i < aSNL.getLength(); i++ ) - if( pArray[i] == ServiceName ) - return sal_True; - - return sal_False; + return cppu::supportsService(this, ServiceName); } // XServiceInfo @@ -885,9 +872,6 @@ Sequence< OUString > ODataOutputStream::getSupportedServiceNames(void) throw () return ODataOutputStream_getSupportedServiceNames(); } - - - Reference< XInterface > SAL_CALL ODataOutputStream_CreateInstance( SAL_UNUSED_PARAMETER const Reference < XComponentContext > & ) throw(Exception) @@ -1195,14 +1179,7 @@ OUString OObjectOutputStream::getImplementationName() throw () // XServiceInfo sal_Bool OObjectOutputStream::supportsService(const OUString& ServiceName) throw () { - Sequence< OUString > aSNL = getSupportedServiceNames(); - const OUString * pArray = aSNL.getConstArray(); - - for( sal_Int32 i = 0; i < aSNL.getLength(); i++ ) - if( pArray[i] == ServiceName ) - return sal_True; - - return sal_False; + return cppu::supportsService(this, ServiceName); } // XServiceInfo @@ -1470,14 +1447,7 @@ OUString OObjectInputStream::getImplementationName() throw () // XServiceInfo sal_Bool OObjectInputStream::supportsService(const OUString& ServiceName) throw () { - Sequence< OUString > aSNL = getSupportedServiceNames(); - const OUString * pArray = aSNL.getConstArray(); - - for( sal_Int32 i = 0; i < aSNL.getLength(); i++ ) - if( pArray[i] == ServiceName ) - return sal_True; - - return sal_False; + return cppu::supportsService(this, ServiceName); } // XServiceInfo @@ -1486,9 +1456,6 @@ Sequence< OUString > OObjectInputStream::getSupportedServiceNames(void) throw () return OObjectInputStream_getSupportedServiceNames(); } - - - Reference< XInterface > SAL_CALL OObjectInputStream_CreateInstance( const Reference < XComponentContext > & rCtx ) throw(Exception) { OObjectInputStream *p = new OObjectInputStream( rCtx ); diff --git a/lotuswordpro/source/filter/lwpfilter.cxx b/lotuswordpro/source/filter/lwpfilter.cxx index f1b082a7f2c2..a627faaa78b3 100644 --- a/lotuswordpro/source/filter/lwpfilter.cxx +++ b/lotuswordpro/source/filter/lwpfilter.cxx @@ -78,6 +78,8 @@ #include #include +#include + #include #include @@ -186,15 +188,7 @@ OUString LWPFilterImportFilter::getImplementationName() throw() sal_Bool LWPFilterImportFilter::supportsService( const OUString& ServiceName ) throw() { - Sequence< OUString > aSNL = getSupportedServiceNames(); - const OUString *pArray = aSNL.getConstArray(); - - for ( sal_Int32 i = 0; i < aSNL.getLength(); i++ ) - { - if ( pArray[i] == ServiceName ) return sal_True; - } - - return sal_False; + return cppu::supportsService(this, ServiceName); } Sequence< OUString> LWPFilterImportFilter::getSupportedServiceNames( void ) throw() diff --git a/scripting/source/basprov/basprov.cxx b/scripting/source/basprov/basprov.cxx index 04e279faa2a4..cc0f4f9ce230 100644 --- a/scripting/source/basprov/basprov.cxx +++ b/scripting/source/basprov/basprov.cxx @@ -27,6 +27,7 @@ #include #include +#include #include #include #include @@ -180,30 +181,17 @@ namespace basprov return bIsShared; } - // ----------------------------------------------------------------------------- // XServiceInfo - // ----------------------------------------------------------------------------- - OUString BasicProviderImpl::getImplementationName( ) throw (RuntimeException) { return getImplementationName_BasicProviderImpl(); } - // ----------------------------------------------------------------------------- - sal_Bool BasicProviderImpl::supportsService( const OUString& rServiceName ) throw (RuntimeException) { - Sequence< OUString > aNames( getSupportedServiceNames() ); - const OUString* pNames = aNames.getConstArray(); - const OUString* pEnd = pNames + aNames.getLength(); - for ( ; pNames != pEnd && !pNames->equals( rServiceName ); ++pNames ) - ; - - return pNames != pEnd; + return cppu::supportsService(this, rServiceName); } - // ----------------------------------------------------------------------------- - Sequence< OUString > BasicProviderImpl::getSupportedServiceNames( ) throw (RuntimeException) { return getSupportedServiceNames_BasicProviderImpl(); diff --git a/scripting/source/dlgprov/DialogModelProvider.cxx b/scripting/source/dlgprov/DialogModelProvider.cxx index aee0a9a16ec5..2c1268bdf910 100644 --- a/scripting/source/dlgprov/DialogModelProvider.cxx +++ b/scripting/source/dlgprov/DialogModelProvider.cxx @@ -22,6 +22,7 @@ #include #include +#include // component helper namespace namespace comp_DialogModelProvider { @@ -165,12 +166,7 @@ OUString SAL_CALL DialogModelProvider::getImplementationName() throw (css::uno:: ::sal_Bool SAL_CALL DialogModelProvider::supportsService(OUString const & serviceName) throw (css::uno::RuntimeException) { - css::uno::Sequence< OUString > serviceNames = comp_DialogModelProvider::_getSupportedServiceNames(); - for (::sal_Int32 i = 0; i < serviceNames.getLength(); ++i) { - if (serviceNames[i] == serviceName) - return sal_True; - } - return sal_False; + return cppu::supportsService(this, serviceName); } css::uno::Sequence< OUString > SAL_CALL DialogModelProvider::getSupportedServiceNames() throw (css::uno::RuntimeException) diff --git a/scripting/source/dlgprov/dlgprov.cxx b/scripting/source/dlgprov/dlgprov.cxx index e7954d8c2b41..281eb24d8523 100644 --- a/scripting/source/dlgprov/dlgprov.cxx +++ b/scripting/source/dlgprov/dlgprov.cxx @@ -44,6 +44,7 @@ #include #include +#include #include #include #include @@ -592,21 +593,11 @@ static OUString aResourceResolverPropName("ResourceResolver"); return getImplementationName_DialogProviderImpl(); } - // ----------------------------------------------------------------------------- - sal_Bool DialogProviderImpl::supportsService( const OUString& rServiceName ) throw (RuntimeException) { - Sequence< OUString > aNames( getSupportedServiceNames() ); - const OUString* pNames = aNames.getConstArray(); - const OUString* pEnd = pNames + aNames.getLength(); - for ( ; pNames != pEnd && !pNames->equals( rServiceName ); ++pNames ) - ; - - return pNames != pEnd; + return cppu::supportsService(this, rServiceName); } - // ----------------------------------------------------------------------------- - Sequence< OUString > DialogProviderImpl::getSupportedServiceNames( ) throw (RuntimeException) { return getSupportedServiceNames_DialogProviderImpl(); diff --git a/scripting/source/protocolhandler/scripthandler.cxx b/scripting/source/protocolhandler/scripthandler.cxx index 1fa6eb6c03c8..391a97baa896 100644 --- a/scripting/source/protocolhandler/scripthandler.cxx +++ b/scripting/source/protocolhandler/scripthandler.cxx @@ -44,6 +44,7 @@ #include #include #include +#include #include #include "com/sun/star/uno/XComponentContext.hpp" @@ -414,21 +415,10 @@ throw( RuntimeException ) } /* XServiceInfo */ -sal_Bool SAL_CALL ScriptProtocolHandler::supportsService( -const OUString& sServiceName ) +sal_Bool SAL_CALL ScriptProtocolHandler::supportsService(const OUString& sServiceName ) throw( RuntimeException ) { - Sequence< OUString > seqServiceNames = getSupportedServiceNames(); - const OUString* pArray = seqServiceNames.getConstArray(); - for ( sal_Int32 nCounter = 0; nCounter < seqServiceNames.getLength(); nCounter++ ) - { - if ( pArray[ nCounter ] == sServiceName ) - { - return sal_True ; - } - } - - return sal_False ; + return cppu::supportsService(this, sServiceName); } /* XServiceInfo */ diff --git a/scripting/source/provider/BrowseNodeFactoryImpl.cxx b/scripting/source/provider/BrowseNodeFactoryImpl.cxx index a57c9f7124a6..569c5bd363e1 100644 --- a/scripting/source/provider/BrowseNodeFactoryImpl.cxx +++ b/scripting/source/provider/BrowseNodeFactoryImpl.cxx @@ -23,6 +23,7 @@ #include #include #include +#include #include #include @@ -755,23 +756,10 @@ BrowseNodeFactoryImpl::getSupportedServiceNames() return bnf_getSupportedServiceNames(); } -sal_Bool BrowseNodeFactoryImpl::supportsService( - OUString const & serviceName ) +sal_Bool BrowseNodeFactoryImpl::supportsService(OUString const & serviceName ) throw (RuntimeException) { -// check(); - - Sequence< OUString > supported_services( - getSupportedServiceNames() ); - - OUString const * ar = supported_services.getConstArray(); - - for ( sal_Int32 pos = supported_services.getLength(); pos--; ) - { - if (ar[ pos ].equals( serviceName )) - return sal_True; - } - return sal_False; + return cppu::supportsService(this, serviceName); } } // namespace browsenodefactory diff --git a/scripting/source/provider/MasterScriptProvider.cxx b/scripting/source/provider/MasterScriptProvider.cxx index cb3783f0eb4d..19e1134a66af 100644 --- a/scripting/source/provider/MasterScriptProvider.cxx +++ b/scripting/source/provider/MasterScriptProvider.cxx @@ -23,6 +23,7 @@ #include #include #include +#include #include #include @@ -807,20 +808,10 @@ throw( RuntimeException ) return OUString( "com.sun.star.script.provider.MasterScriptProvider" ); } -//************************************************************************* sal_Bool SAL_CALL MasterScriptProvider::supportsService( const OUString& serviceName ) throw( RuntimeException ) { - Sequence< OUString > serviceNames( getSupportedServiceNames() ); - OUString const * pNames = serviceNames.getConstArray(); - for ( sal_Int32 nPos = serviceNames.getLength(); nPos--; ) - { - if ( serviceName.equals( pNames[ nPos ] ) ) - { - return sal_True; - } - } - return sal_False; + return cppu::supportsService(this, serviceName); } //************************************************************************* diff --git a/scripting/source/stringresource/stringresource.cxx b/scripting/source/stringresource/stringresource.cxx index 33a2e30f4c28..196998a0bcfb 100644 --- a/scripting/source/stringresource/stringresource.cxx +++ b/scripting/source/stringresource/stringresource.cxx @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -139,13 +140,7 @@ OUString StringResourceImpl::getImplementationName( ) throw (RuntimeException) sal_Bool StringResourceImpl::supportsService( const OUString& rServiceName ) throw (RuntimeException) { - Sequence< OUString > aNames( getSupportedServiceNames() ); - const OUString* pNames = aNames.getConstArray(); - const OUString* pEnd = pNames + aNames.getLength(); - for ( ; pNames != pEnd && !pNames->equals( rServiceName ); ++pNames ) - ; - - return pNames != pEnd; + return cppu::supportsService(this, rServiceName); } Sequence< OUString > StringResourceImpl::getSupportedServiceNames( ) throw (RuntimeException) @@ -2315,21 +2310,11 @@ OUString StringResourceWithStorageImpl::getImplementationName( ) throw (Runtime return getImplementationName_StringResourceWithStorageImpl(); } -// ----------------------------------------------------------------------------- - sal_Bool StringResourceWithStorageImpl::supportsService( const OUString& rServiceName ) throw (RuntimeException) { - Sequence< OUString > aNames( getSupportedServiceNames() ); - const OUString* pNames = aNames.getConstArray(); - const OUString* pEnd = pNames + aNames.getLength(); - for ( ; pNames != pEnd && !pNames->equals( rServiceName ); ++pNames ) - ; - - return pNames != pEnd; + return cppu::supportsService(this, rServiceName); } -// ----------------------------------------------------------------------------- - Sequence< OUString > StringResourceWithStorageImpl::getSupportedServiceNames( ) throw (RuntimeException) { return getSupportedServiceNames_StringResourceWithStorageImpl(); @@ -2652,21 +2637,11 @@ OUString StringResourceWithLocationImpl::getImplementationName( ) throw (Runtim return getImplementationName_StringResourceWithLocationImpl(); } -// ----------------------------------------------------------------------------- - sal_Bool StringResourceWithLocationImpl::supportsService( const OUString& rServiceName ) throw (RuntimeException) { - Sequence< OUString > aNames( getSupportedServiceNames() ); - const OUString* pNames = aNames.getConstArray(); - const OUString* pEnd = pNames + aNames.getLength(); - for ( ; pNames != pEnd && !pNames->equals( rServiceName ); ++pNames ) - ; - - return pNames != pEnd; + return cppu::supportsService(this, rServiceName); } -// ----------------------------------------------------------------------------- - Sequence< OUString > StringResourceWithLocationImpl::getSupportedServiceNames( ) throw (RuntimeException) { return getSupportedServiceNames_StringResourceWithLocationImpl(); diff --git a/sfx2/source/appl/appinit.cxx b/sfx2/source/appl/appinit.cxx index 51f2b23896b1..e0f40c92b559 100644 --- a/sfx2/source/appl/appinit.cxx +++ b/sfx2/source/appl/appinit.cxx @@ -42,6 +42,7 @@ #include #include #include +#include #include @@ -128,17 +129,7 @@ OUString SAL_CALL SfxTerminateListener_Impl::getImplementationName() throw (Runt ::sal_Bool SAL_CALL SfxTerminateListener_Impl::supportsService( const OUString& sServiceName ) throw (RuntimeException) { - Sequence< OUString > lNames = getSupportedServiceNames(); - ::sal_Int32 c = lNames.getLength(); - ::sal_Int32 i = 0; - - for (i=0; i SAL_CALL SfxTerminateListener_Impl::getSupportedServiceNames() throw (RuntimeException) diff --git a/sfx2/source/appl/appuno.cxx b/sfx2/source/appl/appuno.cxx index f8fa84a60016..7b466cac550d 100644 --- a/sfx2/source/appl/appuno.cxx +++ b/sfx2/source/appl/appuno.cxx @@ -111,6 +111,8 @@ #include #include +#include + #include #define PROTOCOLHANDLER_SERVICENAME "com.sun.star.frame.ProtocolHandler" @@ -1992,16 +1994,7 @@ OUString SAL_CALL SfxAppDispatchProvider::getImplementationName() throw( css::un /* XServiceInfo */ sal_Bool SAL_CALL SfxAppDispatchProvider::supportsService( const OUString& sServiceName ) throw( css::uno::RuntimeException ) { - css::uno::Sequence< OUString > seqServiceNames = getSupportedServiceNames(); - const OUString* pArray = seqServiceNames.getConstArray(); - for ( sal_Int32 nCounter=0; nCounter #include - +#include #include "xpackcreator.hxx" @@ -164,27 +164,18 @@ void SAL_CALL OPackageStructureCreator::convertToPackage( const OUString& aFolde throw io::IOException(); // TODO/LATER: can't proceed with creation } -//------------------------------------------------------------------------- OUString SAL_CALL OPackageStructureCreator::getImplementationName() throw ( uno::RuntimeException ) { return impl_getStaticImplementationName(); } -//------------------------------------------------------------------------- sal_Bool SAL_CALL OPackageStructureCreator::supportsService( const OUString& ServiceName ) throw ( uno::RuntimeException ) { - uno::Sequence< OUString > aSeq = impl_getStaticSupportedServiceNames(); - - for ( sal_Int32 nInd = 0; nInd < aSeq.getLength(); nInd++ ) - if ( ServiceName == aSeq[nInd] ) - return sal_True; - - return sal_False; + return cppu::supportsService(this, ServiceName); } -//------------------------------------------------------------------------- uno::Sequence< OUString > SAL_CALL OPackageStructureCreator::getSupportedServiceNames() throw ( uno::RuntimeException ) { diff --git a/sfx2/source/doc/SfxDocumentMetaData.cxx b/sfx2/source/doc/SfxDocumentMetaData.cxx index 5bdcc7ec9a70..0c31186b20ad 100644 --- a/sfx2/source/doc/SfxDocumentMetaData.cxx +++ b/sfx2/source/doc/SfxDocumentMetaData.cxx @@ -80,6 +80,7 @@ #include +#include #include #include @@ -382,20 +383,7 @@ public: virtual ::sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException) { - css::uno::Sequence< OUString > sServiceNames= getSupportedServiceNames(); - sal_Int32 nLen = sServiceNames.getLength(); - OUString* pIt = sServiceNames.getArray(); - OUString* pEnd = ( pIt + nLen ); - sal_Bool bRes = sal_False; - for ( ; pIt != pEnd; ++pIt ) - { - if ( pIt->equals( ServiceName ) ) - { - bRes = sal_True; - break; - } - } - return bRes; + return cppu::supportsService(this, ServiceName); } virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) throw (::com::sun::star::uno::RuntimeException) diff --git a/sfx2/source/doc/ownsubfilterservice.cxx b/sfx2/source/doc/ownsubfilterservice.cxx index 4a03b1a3151c..26926cef58f0 100644 --- a/sfx2/source/doc/ownsubfilterservice.cxx +++ b/sfx2/source/doc/ownsubfilterservice.cxx @@ -19,6 +19,7 @@ #include #include +#include #include #include @@ -121,30 +122,19 @@ void SAL_CALL OwnSubFilterService::initialize( const uno::Sequence< uno::Any >& throw lang::IllegalArgumentException(); } - // XServiceInfo - -//------------------------------------------------------------------------- OUString SAL_CALL OwnSubFilterService::getImplementationName() throw ( uno::RuntimeException ) { return impl_getStaticImplementationName(); } -//------------------------------------------------------------------------- sal_Bool SAL_CALL OwnSubFilterService::supportsService( const OUString& ServiceName ) throw ( uno::RuntimeException ) { - uno::Sequence< OUString > aSeq = impl_getStaticSupportedServiceNames(); - - for ( sal_Int32 nInd = 0; nInd < aSeq.getLength(); nInd++ ) - if ( ServiceName == aSeq[nInd] ) - return sal_True; - - return sal_False; + return cppu::supportsService(this, ServiceName); } -//------------------------------------------------------------------------- uno::Sequence< OUString > SAL_CALL OwnSubFilterService::getSupportedServiceNames() throw ( uno::RuntimeException ) { diff --git a/sfx2/source/doc/sfxmodelfactory.cxx b/sfx2/source/doc/sfxmodelfactory.cxx index bb6b1d68745c..c5ff5c1240b8 100644 --- a/sfx2/source/doc/sfxmodelfactory.cxx +++ b/sfx2/source/doc/sfxmodelfactory.cxx @@ -25,6 +25,7 @@ #include #include +#include #include #include @@ -188,38 +189,27 @@ namespace sfx2 return xInstance; } - //-------------------------------------------------------------------- OUString SAL_CALL SfxModelFactory::getImplementationName( ) throw (RuntimeException) { return m_sImplementationName; } - //-------------------------------------------------------------------- ::sal_Bool SAL_CALL SfxModelFactory::supportsService( const OUString& _rServiceName ) throw (RuntimeException) { - return ::std::find( - m_aServiceNames.getConstArray(), - m_aServiceNames.getConstArray() + m_aServiceNames.getLength(), - _rServiceName - ) != m_aServiceNames.getConstArray() + m_aServiceNames.getLength(); + return cppu::supportsService(this, _rServiceName); } - //-------------------------------------------------------------------- Sequence< OUString > SAL_CALL SfxModelFactory::getSupportedServiceNames( ) throw (RuntimeException) { return m_aServiceNames; } - //-------------------------------------------------------------------- Reference< XSingleServiceFactory > createSfxModelFactory( const Reference< XMultiServiceFactory >& _rxServiceFactory, const OUString& _rImplementationName, const SfxModelFactoryFunc _pComponentFactoryFunc, const Sequence< OUString >& _rServiceNames ) { return new SfxModelFactory( _rxServiceFactory, _rImplementationName, _pComponentFactoryFunc, _rServiceNames ); } - -//........................................................................ } // namespace sfx2 -//........................................................................ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/view/frmload.cxx b/sfx2/source/view/frmload.cxx index fc47a787baf4..b7dfc24e7843 100644 --- a/sfx2/source/view/frmload.cxx +++ b/sfx2/source/view/frmload.cxx @@ -51,6 +51,7 @@ #include #include #include +#include #include #include #include @@ -658,16 +659,7 @@ OUString SAL_CALL SfxFrameLoader_Impl::getImplementationName() throw( RuntimeExc /* XServiceInfo */ sal_Bool SAL_CALL SfxFrameLoader_Impl::supportsService( const OUString& sServiceName ) throw( RuntimeException ) { - Sequence< OUString > seqServiceNames = getSupportedServiceNames(); - const OUString* pArray = seqServiceNames.getConstArray(); - for ( sal_Int32 nCounter=0; nCounter #include +#include #include #include @@ -161,14 +162,7 @@ OUString IdlReflectionServiceImpl::getImplementationName() sal_Bool IdlReflectionServiceImpl::supportsService( const OUString & rServiceName ) throw(::com::sun::star::uno::RuntimeException) { - const Sequence< OUString > & rSNL = getSupportedServiceNames(); - const OUString * pArray = rSNL.getConstArray(); - for ( sal_Int32 nPos = rSNL.getLength(); nPos--; ) - { - if (pArray[nPos] == rServiceName) - return sal_True; - } - return sal_False; + return cppu::supportsService(this, rServiceName); } //__________________________________________________________________________________________________ Sequence< OUString > IdlReflectionServiceImpl::getSupportedServiceNames() diff --git a/stoc/source/defaultregistry/defaultregistry.cxx b/stoc/source/defaultregistry/defaultregistry.cxx index f66a879af59e..d6e5dbed98dd 100644 --- a/stoc/source/defaultregistry/defaultregistry.cxx +++ b/stoc/source/defaultregistry/defaultregistry.cxx @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -1213,20 +1214,12 @@ OUString SAL_CALL NestedRegistryImpl::getImplementationName( ) return stoc_bootstrap::defreg_getImplementationName(); } -//************************************************************************* sal_Bool SAL_CALL NestedRegistryImpl::supportsService( const OUString& ServiceName ) throw(RuntimeException) { - Guard< Mutex > aGuard( m_mutex ); - Sequence< OUString > aSNL = getSupportedServiceNames(); - const OUString * pArray = aSNL.getArray(); - for( sal_Int32 i = 0; i < aSNL.getLength(); i++ ) - if( pArray[i] == ServiceName ) - return sal_True; - return sal_False; + return cppu::supportsService(this, ServiceName); } -//************************************************************************* Sequence SAL_CALL NestedRegistryImpl::getSupportedServiceNames( ) throw(RuntimeException) { diff --git a/stoc/source/implementationregistration/implreg.cxx b/stoc/source/implementationregistration/implreg.cxx index 929c4d709854..b7ee54998eb1 100644 --- a/stoc/source/implementationregistration/implreg.cxx +++ b/stoc/source/implementationregistration/implreg.cxx @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -1334,12 +1335,7 @@ OUString ImplementationRegistration::getImplementationName() throw(RuntimeExcept // XServiceInfo sal_Bool ImplementationRegistration::supportsService(const OUString& ServiceName) throw(RuntimeException) { - Sequence< OUString > aSNL = getSupportedServiceNames(); - const OUString * pArray = aSNL.getConstArray(); - for( sal_Int32 i = 0; i < aSNL.getLength(); i++ ) - if( pArray[i] == ServiceName ) - return sal_True; - return sal_False; + return cppu::supportsService(this, ServiceName); } // XServiceInfo diff --git a/stoc/source/inspect/introspection.cxx b/stoc/source/inspect/introspection.cxx index b3a708f2ec44..7738a130f993 100644 --- a/stoc/source/inspect/introspection.cxx +++ b/stoc/source/inspect/introspection.cxx @@ -29,6 +29,7 @@ #include #include #include +#include #include #include @@ -1780,12 +1781,7 @@ OUString ImplIntrospection::getImplementationName() throw() // XServiceInfo sal_Bool ImplIntrospection::supportsService(const OUString& ServiceName) throw() { - Sequence< OUString > aSNL = getSupportedServiceNames(); - const OUString * pArray = aSNL.getConstArray(); - for( sal_Int32 i = 0; i < aSNL.getLength(); i++ ) - if( pArray[i] == ServiceName ) - return sal_True; - return sal_False; + return cppu::supportsService(this, ServiceName); } // XServiceInfo diff --git a/stoc/source/invocation/invocation.cxx b/stoc/source/invocation/invocation.cxx index b9084ab1c1ef..80a71e4572bf 100644 --- a/stoc/source/invocation/invocation.cxx +++ b/stoc/source/invocation/invocation.cxx @@ -22,6 +22,7 @@ #include #include #include +#include #include #include @@ -1127,12 +1128,7 @@ OUString InvocationService::getImplementationName() throw( RuntimeException ) // XServiceInfo sal_Bool InvocationService::supportsService(const OUString& ServiceName) throw( RuntimeException ) { - Sequence< OUString > aSNL = getSupportedServiceNames(); - const OUString * pArray = aSNL.getConstArray(); - for( sal_Int32 i = 0; i < aSNL.getLength(); i++ ) - if( pArray[i] == ServiceName ) - return sal_True; - return sal_False; + return cppu::supportsService(this, ServiceName); } // XServiceInfo diff --git a/stoc/source/invocation_adapterfactory/iafactory.cxx b/stoc/source/invocation_adapterfactory/iafactory.cxx index 2d0c86239b6c..9f494761c93d 100644 --- a/stoc/source/invocation_adapterfactory/iafactory.cxx +++ b/stoc/source/invocation_adapterfactory/iafactory.cxx @@ -33,6 +33,7 @@ #include #include #include +#include #include #include @@ -906,14 +907,7 @@ OUString FactoryImpl::getImplementationName() sal_Bool FactoryImpl::supportsService( const OUString & rServiceName ) throw (RuntimeException) { - const Sequence< OUString > & rSNL = getSupportedServiceNames(); - const OUString * pArray = rSNL.getConstArray(); - for ( sal_Int32 nPos = rSNL.getLength(); nPos--; ) - { - if (pArray[nPos].equals( rServiceName )) - return sal_True; - } - return sal_False; + return cppu::supportsService(this, rServiceName); } //______________________________________________________________________________ Sequence< OUString > FactoryImpl::getSupportedServiceNames() diff --git a/stoc/source/javaloader/javaloader.cxx b/stoc/source/javaloader/javaloader.cxx index 02c6eb11f8e9..8b80ea7363a5 100644 --- a/stoc/source/javaloader/javaloader.cxx +++ b/stoc/source/javaloader/javaloader.cxx @@ -43,6 +43,7 @@ #include #include +#include #include #include @@ -322,14 +323,7 @@ OUString SAL_CALL JavaComponentLoader::getImplementationName() sal_Bool SAL_CALL JavaComponentLoader::supportsService(const OUString & ServiceName) throw(::com::sun::star::uno::RuntimeException) { - sal_Bool bSupport = sal_False; - - Sequence aSNL = getSupportedServiceNames(); - const OUString * pArray = aSNL.getArray(); - for(sal_Int32 i = 0; i < aSNL.getLength() && !bSupport; ++ i) - bSupport = pArray[i] == ServiceName; - - return bSupport; + return cppu::supportsService(this, ServiceName); } Sequence SAL_CALL JavaComponentLoader::getSupportedServiceNames() diff --git a/stoc/source/javavm/javavm.cxx b/stoc/source/javavm/javavm.cxx index 352ce8b4dc93..3f8139ad05d0 100644 --- a/stoc/source/javavm/javavm.cxx +++ b/stoc/source/javavm/javavm.cxx @@ -54,6 +54,7 @@ #include "cppuhelper/factory.hxx" #include "cppuhelper/implbase1.hxx" #include "cppuhelper/implementationentry.hxx" +#include #include "jvmaccess/classpath.hxx" #include "jvmaccess/unovirtualmachine.hxx" #include "jvmaccess/virtualmachine.hxx" @@ -650,11 +651,7 @@ sal_Bool SAL_CALL JavaVirtualMachine::supportsService(OUString const & rServiceName) throw (css::uno::RuntimeException) { - css::uno::Sequence< OUString > aNames(getSupportedServiceNames()); - for (sal_Int32 i = 0; i < aNames.getLength(); ++i) - if (aNames[i] == rServiceName) - return true; - return false; + return cppu::supportsService(this, rServiceName); } css::uno::Sequence< OUString > SAL_CALL diff --git a/stoc/source/loader/dllcomponentloader.cxx b/stoc/source/loader/dllcomponentloader.cxx index 9720ac09d916..f7570d347162 100644 --- a/stoc/source/loader/dllcomponentloader.cxx +++ b/stoc/source/loader/dllcomponentloader.cxx @@ -33,6 +33,7 @@ #include #include #include +#include #include #include @@ -114,19 +115,12 @@ OUString SAL_CALL DllComponentLoader::getImplementationName( ) return stoc_bootstrap::loader_getImplementationName(); } -//************************************************************************* sal_Bool SAL_CALL DllComponentLoader::supportsService( const OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException) { - Sequence< OUString > aSNL = getSupportedServiceNames(); - const OUString * pArray = aSNL.getArray(); - for( sal_Int32 i = 0; i < aSNL.getLength(); i++ ) - if( pArray[i] == ServiceName ) - return sal_True; - return sal_False; + return cppu::supportsService(this, ServiceName); } -//************************************************************************* Sequence SAL_CALL DllComponentLoader::getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException) { diff --git a/stoc/source/namingservice/namingservice.cxx b/stoc/source/namingservice/namingservice.cxx index 139de3c273ae..31639fb60f0a 100644 --- a/stoc/source/namingservice/namingservice.cxx +++ b/stoc/source/namingservice/namingservice.cxx @@ -29,6 +29,7 @@ #include #include #include +#include #include #include @@ -132,14 +133,7 @@ OUString NamingService_Impl::getImplementationName() sal_Bool NamingService_Impl::supportsService( const OUString & rServiceName ) throw(::com::sun::star::uno::RuntimeException) { - const Sequence< OUString > & rSNL = getSupportedServiceNames(); - const OUString * pArray = rSNL.getConstArray(); - for ( sal_Int32 nPos = rSNL.getLength(); nPos--; ) - { - if (pArray[nPos] == rServiceName) - return sal_True; - } - return sal_False; + return cppu::supportsService(this, rServiceName); } // XServiceInfo diff --git a/stoc/source/proxy_factory/proxyfac.cxx b/stoc/source/proxy_factory/proxyfac.cxx index f06f5a1b58fa..5ac0864ce50e 100644 --- a/stoc/source/proxy_factory/proxyfac.cxx +++ b/stoc/source/proxy_factory/proxyfac.cxx @@ -32,6 +32,7 @@ #include "cppuhelper/implbase2.hxx" #include "cppuhelper/implementationentry.hxx" #include "cppuhelper/factory.hxx" +#include #include "com/sun/star/lang/XServiceInfo.hpp" #include "com/sun/star/registry/XRegistryKey.hpp" #include "com/sun/star/reflection/XProxyFactory.hpp" @@ -440,21 +441,12 @@ OUString FactoryImpl::getImplementationName() return proxyfac_getImplementationName(); } -//______________________________________________________________________________ sal_Bool FactoryImpl::supportsService( const OUString & rServiceName ) throw (RuntimeException) { - Sequence< OUString > const & rSNL = getSupportedServiceNames(); - OUString const * pArray = rSNL.getConstArray(); - for ( sal_Int32 nPos = rSNL.getLength(); nPos--; ) - { - if (rServiceName.equals( pArray[ nPos ] )) - return true; - } - return false; + return cppu::supportsService(this, rServiceName); } -//______________________________________________________________________________ Sequence< OUString > FactoryImpl::getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException) { diff --git a/stoc/source/security/access_controller.cxx b/stoc/source/security/access_controller.cxx index 49fea7f2a026..ce78ed875b90 100644 --- a/stoc/source/security/access_controller.cxx +++ b/stoc/source/security/access_controller.cxx @@ -35,6 +35,7 @@ #include #include #include +#include #include #include @@ -968,16 +969,7 @@ OUString AccessController::getImplementationName() sal_Bool AccessController::supportsService( OUString const & serviceName ) throw (RuntimeException) { - Sequence< OUString > aSNL = getSupportedServiceNames(); - const OUString * pNames = aSNL.getConstArray(); - for ( sal_Int32 nPos = aSNL.getLength(); --nPos; ) - { - if (serviceName.equals( pNames[ nPos ] )) - { - return sal_True; - } - } - return sal_False; + return cppu::supportsService(this, serviceName); } //__________________________________________________________________________________________________ Sequence< OUString > AccessController::getSupportedServiceNames() diff --git a/stoc/source/security/file_policy.cxx b/stoc/source/security/file_policy.cxx index 70cc32551b44..46ba89f2b205 100644 --- a/stoc/source/security/file_policy.cxx +++ b/stoc/source/security/file_policy.cxx @@ -29,6 +29,7 @@ #include #include #include +#include #include #include @@ -531,16 +532,7 @@ OUString FilePolicy::getImplementationName() sal_Bool FilePolicy::supportsService( OUString const & serviceName ) throw (RuntimeException) { - Sequence< OUString > aSNL = getSupportedServiceNames(); - const OUString * pNames = aSNL.getConstArray(); - for ( sal_Int32 nPos = aSNL.getLength(); --nPos; ) - { - if (serviceName.equals( pNames[ nPos ] )) - { - return sal_True; - } - } - return sal_False; + return cppu::supportsService(this, serviceName); } //__________________________________________________________________________________________________ Sequence< OUString > FilePolicy::getSupportedServiceNames() diff --git a/stoc/source/servicemanager/servicemanager.cxx b/stoc/source/servicemanager/servicemanager.cxx index b1500665e34f..4b262f3e0cd8 100644 --- a/stoc/source/servicemanager/servicemanager.cxx +++ b/stoc/source/servicemanager/servicemanager.cxx @@ -35,7 +35,7 @@ #include #include #include - +#include #include #include @@ -1116,13 +1116,7 @@ OUString OServiceManager::getImplementationName() sal_Bool OServiceManager::supportsService(const OUString& ServiceName) throw(::com::sun::star::uno::RuntimeException) { - check_undisposed(); - Sequence< OUString > aSNL = getSupportedServiceNames(); - const OUString * pArray = aSNL.getConstArray(); - for( sal_Int32 i = 0; i < aSNL.getLength(); i++ ) - if( pArray[i] == ServiceName ) - return sal_True; - return sal_False; + return cppu::supportsService(this, ServiceName); } // XServiceInfo diff --git a/stoc/source/typeconv/convert.cxx b/stoc/source/typeconv/convert.cxx index 584b7e7f9948..57bdff8b933e 100644 --- a/stoc/source/typeconv/convert.cxx +++ b/stoc/source/typeconv/convert.cxx @@ -22,6 +22,7 @@ #include #include #include +#include #include #include @@ -292,12 +293,7 @@ OUString TypeConverter_Impl::getImplementationName() throw( RuntimeException ) // XServiceInfo sal_Bool TypeConverter_Impl::supportsService(const OUString& ServiceName) throw( RuntimeException ) { - Sequence< OUString > aSNL = getSupportedServiceNames(); - const OUString * pArray = aSNL.getConstArray(); - for( sal_Int32 i = 0; i < aSNL.getLength(); i++ ) - if( pArray[i] == ServiceName ) - return sal_True; - return sal_False; + return cppu::supportsService(this, ServiceName); } // XServiceInfo diff --git a/stoc/test/testsmgr_cpnt.cxx b/stoc/test/testsmgr_cpnt.cxx index e2d073f6bfc9..6e65b0c0b51e 100644 --- a/stoc/test/testsmgr_cpnt.cxx +++ b/stoc/test/testsmgr_cpnt.cxx @@ -22,6 +22,7 @@ #include #include #include +#include #include #include @@ -134,17 +135,10 @@ OUString Test_Manager_Impl::getImplementationName() throw() return OUString(IMPLEMENTATION_NAME); } -//************************************************************************* // Test_Manager_Impl::supportsService -// sal_Bool Test_Manager_Impl::supportsService( const OUString& ServiceName ) throw() { - Sequence< OUString > aSNL = getSupportedServiceNames(); - const OUString * pArray = aSNL.getConstArray(); - for( sal_Int32 i = 0; i < aSNL.getLength(); i++ ) - if( pArray[i] == ServiceName ) - return sal_True; - return sal_False; + return cppu::supportsService(this, ServiceName); } //************************************************************************* diff --git a/testtools/source/bridgetest/bridgetest.cxx b/testtools/source/bridgetest/bridgetest.cxx index 3c2bcda4995c..ef5ee55b05cc 100644 --- a/testtools/source/bridgetest/bridgetest.cxx +++ b/testtools/source/bridgetest/bridgetest.cxx @@ -33,6 +33,7 @@ #include #include #include +#include #include #include @@ -1244,14 +1245,7 @@ OUString TestBridgeImpl::getImplementationName() sal_Bool TestBridgeImpl::supportsService( const OUString & rServiceName ) throw (RuntimeException) { - const Sequence< OUString > & rSNL = getSupportedServiceNames(); - const OUString * pArray = rSNL.getConstArray(); - for ( sal_Int32 nPos = rSNL.getLength(); nPos--; ) - { - if (pArray[nPos] == rServiceName) - return sal_True; - } - return sal_False; + return cppu::supportsService(this, rServiceName); } //__________________________________________________________________________________________________ Sequence< OUString > TestBridgeImpl::getSupportedServiceNames() diff --git a/testtools/source/bridgetest/cppobj.cxx b/testtools/source/bridgetest/cppobj.cxx index e9133b2faf46..370c2b74adad 100644 --- a/testtools/source/bridgetest/cppobj.cxx +++ b/testtools/source/bridgetest/cppobj.cxx @@ -30,6 +30,7 @@ #include #include "cppuhelper/exc_hlp.hxx" #include "cppuhelper/compbase_ex.hxx" +#include #include #include #include "com/sun/star/uno/Any.hxx" @@ -1154,14 +1155,7 @@ OUString Test_Impl::getImplementationName() sal_Bool Test_Impl::supportsService( const OUString & rServiceName ) throw (RuntimeException) { - const Sequence< OUString > & rSNL = getSupportedServiceNames(); - const OUString * pArray = rSNL.getConstArray(); - for ( sal_Int32 nPos = rSNL.getLength(); nPos--; ) - { - if (pArray[nPos] == rServiceName) - return sal_True; - } - return sal_False; + return cppu::supportsService(this, rServiceName); } //__________________________________________________________________________________________________ Sequence< OUString > Test_Impl::getSupportedServiceNames() diff --git a/testtools/source/performance/ubobject.cxx b/testtools/source/performance/ubobject.cxx index 6e904ccf2939..9098eb726a0b 100644 --- a/testtools/source/performance/ubobject.cxx +++ b/testtools/source/performance/ubobject.cxx @@ -22,6 +22,7 @@ #include #include +#include #include #include @@ -210,14 +211,7 @@ OUString ServiceImpl::getImplementationName() sal_Bool ServiceImpl::supportsService( const OUString & rServiceName ) throw (RuntimeException) { - const Sequence< OUString > & rSNL = getSupportedServiceNames(); - const OUString * pArray = rSNL.getConstArray(); - for ( sal_Int32 nPos = rSNL.getLength(); nPos--; ) - { - if (pArray[nPos] == rServiceName) - return sal_True; - } - return sal_False; + return cppu::supportsService(this, rServiceName); } //__________________________________________________________________________________________________ Sequence< OUString > ServiceImpl::getSupportedServiceNames() diff --git a/testtools/source/performance/ubtest.cxx b/testtools/source/performance/ubtest.cxx index 1b48a730bab9..4c0ea18c2444 100644 --- a/testtools/source/performance/ubtest.cxx +++ b/testtools/source/performance/ubtest.cxx @@ -449,14 +449,7 @@ OUString TestImpl::getImplementationName() sal_Bool TestImpl::supportsService( const OUString & rServiceName ) throw (RuntimeException) { - const Sequence< OUString > & rSNL = getSupportedServiceNames(); - const OUString * pArray = rSNL.getConstArray(); - for ( sal_Int32 nPos = rSNL.getLength(); nPos--; ) - { - if (pArray[nPos] == rServiceName) - return sal_True; - } - return sal_False; + return cppu::supportsService(this, rServiceName); } //__________________________________________________________________________________________________ Sequence< OUString > TestImpl::getSupportedServiceNames() diff --git a/toolkit/source/awt/asynccallback.cxx b/toolkit/source/awt/asynccallback.cxx index 1f30e8fd598a..8d041643508e 100644 --- a/toolkit/source/awt/asynccallback.cxx +++ b/toolkit/source/awt/asynccallback.cxx @@ -24,6 +24,7 @@ #include "cppuhelper/factory.hxx" #include "cppuhelper/implementationentry.hxx" #include "cppuhelper/implbase2.hxx" +#include #include "com/sun/star/lang/XServiceInfo.hpp" #include "com/sun/star/awt/XRequestCallback.hpp" @@ -92,12 +93,7 @@ OUString SAL_CALL AsyncCallback::getImplementationName() throw (css::uno::Runtim ::sal_Bool SAL_CALL AsyncCallback::supportsService(OUString const & serviceName) throw (css::uno::RuntimeException) { - const css::uno::Sequence< OUString > serviceNames = comp_AsyncCallback::_getSupportedServiceNames(); - for (::sal_Int32 i = 0; i < serviceNames.getLength(); ++i) { - if (serviceNames[i] == serviceName) - return sal_True; - } - return sal_False; + return cppu::supportsService(this, serviceName); } css::uno::Sequence< OUString > SAL_CALL AsyncCallback::getSupportedServiceNames() throw (css::uno::RuntimeException) diff --git a/toolkit/source/awt/vclxaccessiblecomponent.cxx b/toolkit/source/awt/vclxaccessiblecomponent.cxx index 347ee5d96d8e..43bbd2e4a1b1 100644 --- a/toolkit/source/awt/vclxaccessiblecomponent.cxx +++ b/toolkit/source/awt/vclxaccessiblecomponent.cxx @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -96,13 +97,7 @@ OUString VCLXAccessibleComponent::getImplementationName() throw (uno::RuntimeExc sal_Bool VCLXAccessibleComponent::supportsService( const OUString& rServiceName ) throw (uno::RuntimeException) { - uno::Sequence< OUString > aNames( getSupportedServiceNames() ); - const OUString* pNames = aNames.getConstArray(); - const OUString* pEnd = pNames + aNames.getLength(); - for ( ; pNames != pEnd && !pNames->equals( rServiceName ); ++pNames ) - ; - - return pNames != pEnd; + return cppu::supportsService(this, rServiceName); } uno::Sequence< OUString > VCLXAccessibleComponent::getSupportedServiceNames() throw (uno::RuntimeException) diff --git a/toolkit/source/awt/vclxmenu.cxx b/toolkit/source/awt/vclxmenu.cxx index 74e5a277d933..75a99a5fce0d 100644 --- a/toolkit/source/awt/vclxmenu.cxx +++ b/toolkit/source/awt/vclxmenu.cxx @@ -23,6 +23,7 @@ #include #include +#include #include #include #include @@ -204,20 +205,12 @@ throw (css::uno::RuntimeException) return aNames; } - -::sal_Bool SAL_CALL VCLXMenu::supportsService( - const OUString& rServiceName ) +::sal_Bool SAL_CALL VCLXMenu::supportsService(const OUString& rServiceName ) throw (css::uno::RuntimeException) { - css::uno::Sequence< OUString > aServiceNames( getSupportedServiceNames() ); - - if ( aServiceNames[ 0 ] == rServiceName ) - return sal_True; - - return sal_False; + return cppu::supportsService(this, rServiceName); } - css::uno::Any VCLXMenu::queryInterface( const css::uno::Type & rType ) throw(css::uno::RuntimeException) diff --git a/toolkit/source/awt/vclxtoolkit.cxx b/toolkit/source/awt/vclxtoolkit.cxx index e80f1bc8f664..707700f63bc7 100644 --- a/toolkit/source/awt/vclxtoolkit.cxx +++ b/toolkit/source/awt/vclxtoolkit.cxx @@ -43,6 +43,7 @@ #include #include #include +#include #include #include #include @@ -1381,16 +1382,7 @@ OUString VCLXToolkit::getImplementationName() throw(::com::sun::star::uno::Runti sal_Bool VCLXToolkit::supportsService( const OUString& rServiceName ) throw(::com::sun::star::uno::RuntimeException) { - ::osl::MutexGuard aGuard( GetMutex() ); - - ::com::sun::star::uno::Sequence< OUString > aSNL = getSupportedServiceNames(); - const OUString* pArray = aSNL.getConstArray(); - const OUString* pArrayEnd = aSNL.getConstArray(); - for (; pArray != pArrayEnd; ++pArray ) - if( *pArray == rServiceName ) - break; - - return pArray != pArrayEnd; + return cppu::supportsService(this, rServiceName); } ::com::sun::star::uno::Sequence< OUString > VCLXToolkit::getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException) diff --git a/toolkit/source/controls/grid/defaultgridcolumnmodel.cxx b/toolkit/source/controls/grid/defaultgridcolumnmodel.cxx index 26ef3b6940c6..558907fa7cd0 100644 --- a/toolkit/source/controls/grid/defaultgridcolumnmodel.cxx +++ b/toolkit/source/controls/grid/defaultgridcolumnmodel.cxx @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -301,17 +302,11 @@ namespace toolkit return OUString( "org.openoffice.comp.toolkit.DefaultGridColumnModel" ); } - //------------------------------------------------------------------------------------------------------------------ sal_Bool SAL_CALL DefaultGridColumnModel::supportsService( const OUString& i_serviceName ) throw (RuntimeException) { - const Sequence< OUString > aServiceNames( getSupportedServiceNames() ); - for ( sal_Int32 i=0; i SAL_CALL DefaultGridColumnModel::getSupportedServiceNames( ) throw (RuntimeException) { const OUString aServiceName( OUString::createFromAscii( szServiceName_DefaultGridColumnModel ) ); diff --git a/toolkit/source/controls/grid/defaultgriddatamodel.cxx b/toolkit/source/controls/grid/defaultgriddatamodel.cxx index e59078e6374c..853eabb8c1b2 100644 --- a/toolkit/source/controls/grid/defaultgriddatamodel.cxx +++ b/toolkit/source/controls/grid/defaultgriddatamodel.cxx @@ -22,6 +22,7 @@ #include #include +#include #include #include #include @@ -427,13 +428,11 @@ namespace toolkit return aImplName; } - //------------------------------------------------------------------------------------------------------------------ sal_Bool SAL_CALL DefaultGridDataModel::supportsService( const OUString& ServiceName ) throw (RuntimeException) { - return ServiceName.equalsAscii( szServiceName_DefaultGridDataModel ); + return cppu::supportsService(this, ServiceName); } - //------------------------------------------------------------------------------------------------------------------ Sequence< OUString > SAL_CALL DefaultGridDataModel::getSupportedServiceNames( ) throw (RuntimeException) { static const OUString aServiceName( OUString::createFromAscii( szServiceName_DefaultGridDataModel ) ); diff --git a/toolkit/source/controls/grid/gridcolumn.cxx b/toolkit/source/controls/grid/gridcolumn.cxx index 10c796b5f495..f08b89be6374 100644 --- a/toolkit/source/controls/grid/gridcolumn.cxx +++ b/toolkit/source/controls/grid/gridcolumn.cxx @@ -20,6 +20,7 @@ #include "gridcolumn.hxx" #include +#include #include #include @@ -264,17 +265,11 @@ namespace toolkit return OUString( "org.openoffice.comp.toolkit.GridColumn" ); } - //------------------------------------------------------------------------------------------------------------------ sal_Bool SAL_CALL GridColumn::supportsService( const OUString& i_serviceName ) throw (RuntimeException) { - const Sequence< OUString > aServiceNames( getSupportedServiceNames() ); - for ( sal_Int32 i=0; i SAL_CALL GridColumn::getSupportedServiceNames( ) throw (RuntimeException) { const OUString aServiceName( OUString::createFromAscii( szServiceName_GridColumn ) ); diff --git a/toolkit/source/controls/grid/sortablegriddatamodel.cxx b/toolkit/source/controls/grid/sortablegriddatamodel.cxx index d4a218c80172..252e6929b6f2 100644 --- a/toolkit/source/controls/grid/sortablegriddatamodel.cxx +++ b/toolkit/source/controls/grid/sortablegriddatamodel.cxx @@ -27,6 +27,7 @@ #include #include +#include #include #include #include @@ -833,17 +834,11 @@ namespace toolkit return OUString( "org.openoffice.comp.toolkit.SortableGridDataModel" ); } - //------------------------------------------------------------------------------------------------------------------ ::sal_Bool SAL_CALL SortableGridDataModel::supportsService( const OUString& i_serviceName ) throw (RuntimeException) { - Sequence< OUString > const aServiceNames( getSupportedServiceNames() ); - for ( sal_Int32 i=0; i SAL_CALL SortableGridDataModel::getSupportedServiceNames( ) throw (RuntimeException) { Sequence< OUString > aServiceNames(1); diff --git a/toolkit/source/controls/unocontrol.cxx b/toolkit/source/controls/unocontrol.cxx index 5d6700e1d6dc..3830c24285fd 100644 --- a/toolkit/source/controls/unocontrol.cxx +++ b/toolkit/source/controls/unocontrol.cxx @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -1433,16 +1434,7 @@ OUString UnoControl::getImplementationName( ) throw(RuntimeException) sal_Bool UnoControl::supportsService( const OUString& rServiceName ) throw(RuntimeException) { - ::osl::MutexGuard aGuard( GetMutex() ); - - Sequence< OUString > aSNL = getSupportedServiceNames(); - const OUString* pArray = aSNL.getConstArray(); - const OUString* pArrayEnd = aSNL.getConstArray() + aSNL.getLength(); - for (; pArray != pArrayEnd; ++pArray ) - if( *pArray == rServiceName ) - break; - - return pArray != pArrayEnd; + return cppu::supportsService(this, rServiceName); } Sequence< OUString > UnoControl::getSupportedServiceNames( ) throw(RuntimeException) diff --git a/toolkit/source/controls/unocontrolmodel.cxx b/toolkit/source/controls/unocontrolmodel.cxx index 782922bb5464..79db937fc2a5 100644 --- a/toolkit/source/controls/unocontrolmodel.cxx +++ b/toolkit/source/controls/unocontrolmodel.cxx @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include @@ -1030,14 +1031,7 @@ OUString UnoControlModel::getImplementationName( ) throw(::com::sun::star::uno: sal_Bool UnoControlModel::supportsService( const OUString& rServiceName ) throw(::com::sun::star::uno::RuntimeException) { - ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() ); - - ::com::sun::star::uno::Sequence< OUString > aSNL = getSupportedServiceNames(); - const OUString * pArray = aSNL.getConstArray(); - for( sal_Int32 i = 0; i < aSNL.getLength(); i++ ) - if( pArray[i] == rServiceName ) - return sal_True; - return sal_False; + return cppu::supportsService(this, rServiceName); } ::com::sun::star::uno::Sequence< OUString > UnoControlModel::getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException) diff --git a/ucb/source/core/cmdenv.cxx b/ucb/source/core/cmdenv.cxx index ce3b9d6d346c..0752b59b53e8 100644 --- a/ucb/source/core/cmdenv.cxx +++ b/ucb/source/core/cmdenv.cxx @@ -19,6 +19,7 @@ #include "cppuhelper/factory.hxx" +#include #include "com/sun/star/lang/IllegalArgumentException.hpp" #include "cmdenv.hxx" @@ -88,14 +89,7 @@ sal_Bool SAL_CALL UcbCommandEnvironment::supportsService( const OUString& ServiceName ) throw ( uno::RuntimeException ) { - uno::Sequence< OUString > aSNL = getSupportedServiceNames(); - const OUString * pArray = aSNL.getConstArray(); - for ( sal_Int32 i = 0; i < aSNL.getLength(); i++ ) - { - if ( pArray[ i ] == ServiceName ) - return sal_True; - } - return sal_False; + return cppu::supportsService(this, ServiceName); } //========================================================================= diff --git a/ucb/source/ucp/expand/ucpexpand.cxx b/ucb/source/ucp/expand/ucpexpand.cxx index 5648f8bb7942..384133e3945e 100644 --- a/ucb/source/ucp/expand/ucpexpand.cxx +++ b/ucb/source/ucp/expand/ucpexpand.cxx @@ -23,6 +23,7 @@ #include "cppuhelper/compbase2.hxx" #include "cppuhelper/factory.hxx" #include "cppuhelper/implementationentry.hxx" +#include #include "ucbhelper/content.hxx" #include "com/sun/star/uno/XComponentContext.hpp" #include "com/sun/star/lang/DisposedException.hpp" @@ -155,23 +156,12 @@ uno::Sequence< OUString > ExpandContentProviderImpl::getSupportedServiceNames() return supportedServices(); } -//______________________________________________________________________________ -sal_Bool ExpandContentProviderImpl::supportsService( - OUString const & serviceName ) +sal_Bool ExpandContentProviderImpl::supportsService(OUString const & serviceName ) throw (uno::RuntimeException) { -// check(); - uno::Sequence< OUString > supported_services( getSupportedServiceNames() ); - OUString const * ar = supported_services.getConstArray(); - for ( sal_Int32 pos = supported_services.getLength(); pos--; ) - { - if (ar[ pos ].equals( serviceName )) - return true; - } - return false; + return cppu::supportsService(this, serviceName); } -//______________________________________________________________________________ OUString ExpandContentProviderImpl::expandUri( uno::Reference< ucb::XContentIdentifier > const & xIdentifier ) const { diff --git a/ucb/source/ucp/tdoc/tdoc_documentcontentfactory.cxx b/ucb/source/ucp/tdoc/tdoc_documentcontentfactory.cxx index cc64ec27a27e..8611380b006f 100644 --- a/ucb/source/ucp/tdoc/tdoc_documentcontentfactory.cxx +++ b/ucb/source/ucp/tdoc/tdoc_documentcontentfactory.cxx @@ -25,6 +25,7 @@ *************************************************************************/ #include "cppuhelper/factory.hxx" +#include #include "tdoc_documentcontentfactory.hxx" @@ -64,23 +65,14 @@ OUString SAL_CALL DocumentContentFactory::getImplementationName() return getImplementationName_Static(); } -//========================================================================= // virtual sal_Bool SAL_CALL DocumentContentFactory::supportsService( const OUString& ServiceName ) throw ( uno::RuntimeException ) { - uno::Sequence< OUString > aSNL = getSupportedServiceNames(); - const OUString * pArray = aSNL.getConstArray(); - for ( sal_Int32 i = 0; i < aSNL.getLength(); i++ ) - { - if ( pArray[ i ] == ServiceName ) - return sal_True; - } - return sal_False; + return cppu::supportsService(this, ServiceName); } -//========================================================================= // virtual uno::Sequence< OUString > SAL_CALL DocumentContentFactory::getSupportedServiceNames() 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 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 #include +#include 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 // declaration of generic uno interface #include // mapping stuff #include +#include #include #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 #include 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 #include +#include + #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 #include +#include #include #include #include @@ -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 #include #include +#include #include #include #include @@ -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() diff --git a/xmlhelp/source/cxxhelp/provider/provider.cxx b/xmlhelp/source/cxxhelp/provider/provider.cxx index 3c2235e88acf..72e4efd82495 100644 --- a/xmlhelp/source/cxxhelp/provider/provider.cxx +++ b/xmlhelp/source/cxxhelp/provider/provider.cxx @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include @@ -96,15 +97,7 @@ sal_Bool SAL_CALL ContentProvider::supportsService(const OUString& ServiceName ) throw( uno::RuntimeException ) { - uno::Sequence< OUString > aSNL = getSupportedServiceNames(); - const OUString* pArray = aSNL.getArray(); - for( sal_Int32 i = 0; i < aSNL.getLength(); i++ ) - { - if( pArray[ i ] == ServiceName ) - return sal_True; - } - - return sal_False; + return cppu::supportsService(this, ServiceName); } uno::Sequence< OUString > SAL_CALL diff --git a/xmlscript/source/xmlflat_imexp/xmlbas_export.cxx b/xmlscript/source/xmlflat_imexp/xmlbas_export.cxx index f033beb12e5b..a5f4b436ba33 100644 --- a/xmlscript/source/xmlflat_imexp/xmlbas_export.cxx +++ b/xmlscript/source/xmlflat_imexp/xmlbas_export.cxx @@ -26,6 +26,7 @@ #include #include #include +#include using namespace ::com::sun::star; using namespace ::com::sun::star::lang; @@ -111,16 +112,9 @@ namespace xmlscript } // XServiceInfo - sal_Bool XMLBasicExporterBase::supportsService( const OUString& rServiceName ) throw (RuntimeException) { - Sequence< OUString > aNames( getSupportedServiceNames() ); - const OUString* pNames = aNames.getConstArray(); - const OUString* pEnd = pNames + aNames.getLength(); - for ( ; pNames != pEnd && !pNames->equals( rServiceName ); ++pNames ) - ; - - return pNames != pEnd; + return cppu::supportsService(this, rServiceName); } // XInitialization diff --git a/xmlscript/source/xmlflat_imexp/xmlbas_import.cxx b/xmlscript/source/xmlflat_imexp/xmlbas_import.cxx index 08a2d54d42f8..85ad94498c6e 100644 --- a/xmlscript/source/xmlflat_imexp/xmlbas_import.cxx +++ b/xmlscript/source/xmlflat_imexp/xmlbas_import.cxx @@ -25,6 +25,7 @@ #include #include #include +#include using namespace ::com::sun::star; using namespace ::com::sun::star::lang; @@ -569,20 +570,12 @@ void BasicImport::setDocumentLocator( const Reference< xml::sax::XLocator >& /*x } // XServiceInfo - sal_Bool XMLBasicImporterBase::supportsService( const OUString& rServiceName ) throw (RuntimeException) { - Sequence< OUString > aNames( getSupportedServiceNames() ); - const OUString* pNames = aNames.getConstArray(); - const OUString* pEnd = pNames + aNames.getLength(); - for ( ; pNames != pEnd && !pNames->equals( rServiceName ); ++pNames ) - ; - - return pNames != pEnd; + return cppu::supportsService(this, rServiceName); } // XImporter - void XMLBasicImporterBase::setTargetDocument( const Reference< XComponent >& rxDoc ) throw (IllegalArgumentException, RuntimeException) { -- cgit