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 /stoc | |
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 'stoc')
-rw-r--r-- | stoc/source/corereflection/crefl.cxx | 10 | ||||
-rw-r--r-- | stoc/source/defaultregistry/defaultregistry.cxx | 11 | ||||
-rw-r--r-- | stoc/source/implementationregistration/implreg.cxx | 8 | ||||
-rw-r--r-- | stoc/source/inspect/introspection.cxx | 8 | ||||
-rw-r--r-- | stoc/source/invocation/invocation.cxx | 8 | ||||
-rw-r--r-- | stoc/source/invocation_adapterfactory/iafactory.cxx | 10 | ||||
-rw-r--r-- | stoc/source/javaloader/javaloader.cxx | 10 | ||||
-rw-r--r-- | stoc/source/javavm/javavm.cxx | 7 | ||||
-rw-r--r-- | stoc/source/loader/dllcomponentloader.cxx | 10 | ||||
-rw-r--r-- | stoc/source/namingservice/namingservice.cxx | 10 | ||||
-rw-r--r-- | stoc/source/proxy_factory/proxyfac.cxx | 12 | ||||
-rw-r--r-- | stoc/source/security/access_controller.cxx | 12 | ||||
-rw-r--r-- | stoc/source/security/file_policy.cxx | 12 | ||||
-rw-r--r-- | stoc/source/servicemanager/servicemanager.cxx | 10 | ||||
-rw-r--r-- | stoc/source/typeconv/convert.cxx | 8 | ||||
-rw-r--r-- | stoc/test/testsmgr_cpnt.cxx | 10 |
16 files changed, 32 insertions, 124 deletions
diff --git a/stoc/source/corereflection/crefl.cxx b/stoc/source/corereflection/crefl.cxx index a5eb2d3f83b7..f5919ca94c13 100644 --- a/stoc/source/corereflection/crefl.cxx +++ b/stoc/source/corereflection/crefl.cxx @@ -19,6 +19,7 @@ #include <cppuhelper/queryinterface.hxx> #include <cppuhelper/implementationentry.hxx> +#include <cppuhelper/supportsservice.hxx> #include <com/sun/star/lang/XComponent.hpp> #include <com/sun/star/reflection/XConstantTypeDescription.hpp> @@ -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 <cppuhelper/implbase4.hxx> #include <cppuhelper/implbase3.hxx> #include <cppuhelper/implementationentry.hxx> +#include <cppuhelper/supportsservice.hxx> #include <registry/registry.hxx> #include <com/sun/star/registry/XSimpleRegistry.hpp> @@ -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<OUString> 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 <cppuhelper/weak.hxx> #include <cppuhelper/implbase3.hxx> #include <cppuhelper/implementationentry.hxx> +#include <cppuhelper/supportsservice.hxx> #include <uno/mapping.hxx> #include <osl/thread.h> @@ -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 <cppuhelper/component.hxx> #include <cppuhelper/factory.hxx> #include <cppuhelper/implbase3.hxx> +#include <cppuhelper/supportsservice.hxx> #include <cppuhelper/typeprovider.hxx> #include <salhelper/simplereferenceobject.hxx> @@ -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 <cppuhelper/weak.hxx> #include <cppuhelper/factory.hxx> #include <cppuhelper/implementationentry.hxx> +#include <cppuhelper/supportsservice.hxx> #include <cppuhelper/typeprovider.hxx> #include <cppuhelper/implbase2.hxx> @@ -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 <cppuhelper/factory.hxx> #include <cppuhelper/implbase3.hxx> #include <cppuhelper/implementationentry.hxx> +#include <cppuhelper/supportsservice.hxx> #include <com/sun/star/uno/XAggregation.hpp> #include <com/sun/star/script/XTypeConverter.hpp> @@ -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 <cppuhelper/implementationentry.hxx> #include <cppuhelper/implbase2.hxx> +#include <cppuhelper/supportsservice.hxx> #include <com/sun/star/loader/XImplementationLoader.hpp> #include <com/sun/star/lang/IllegalArgumentException.hpp> @@ -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<OUString> 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<OUString> 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 <cppuhelper/supportsservice.hxx> #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 <cppuhelper/shlib.hxx> #include <cppuhelper/implbase3.hxx> #include <cppuhelper/implementationentry.hxx> +#include <cppuhelper/supportsservice.hxx> #include <cppuhelper/bootstrap.hxx> #include <com/sun/star/loader/XImplementationLoader.hpp> @@ -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<OUString> 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 <cppuhelper/component.hxx> #include <cppuhelper/implbase2.hxx> #include <cppuhelper/implementationentry.hxx> +#include <cppuhelper/supportsservice.hxx> #include <com/sun/star/uno/XNamingService.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> @@ -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 <cppuhelper/supportsservice.hxx> #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 <cppuhelper/compbase3.hxx> #include <cppuhelper/factory.hxx> #include <cppuhelper/implementationentry.hxx> +#include <cppuhelper/supportsservice.hxx> #include <com/sun/star/uno/XCurrentContext.hpp> #include <com/sun/star/uno/DeploymentException.hpp> @@ -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 <cppuhelper/access_control.hxx> #include <cppuhelper/compbase2.hxx> #include <cppuhelper/implementationentry.hxx> +#include <cppuhelper/supportsservice.hxx> #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/security/XAccessController.hpp> @@ -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 <cppuhelper/bootstrap.hxx> #include <cppuhelper/compbase6.hxx> #include <cppuhelper/compbase7.hxx> - +#include <cppuhelper/supportsservice.hxx> #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/lang/XMultiComponentFactory.hpp> @@ -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 <cppuhelper/factory.hxx> #include <cppuhelper/implementationentry.hxx> #include <cppuhelper/implbase2.hxx> +#include <cppuhelper/supportsservice.hxx> #include <typelib/typedescription.hxx> #include <uno/data.h> @@ -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 <osl/thread.h> #include <osl/mutex.hxx> #include <cppuhelper/queryinterface.hxx> +#include <cppuhelper/supportsservice.hxx> #include <cppuhelper/weak.hxx> #include <uno/mapping.hxx> @@ -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); } //************************************************************************* |