summaryrefslogtreecommitdiff
path: root/eventattacher
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-05-20 08:48:56 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-05-20 21:31:13 +0200
commitb33ff1a083d95388997cf301d8a1538a41c08255 (patch)
tree35c773fc0be7c6e4c4b479c9594fb1e8843ef183 /eventattacher
parentfb149c68db909e6ec17520e277583ed759a0d49a (diff)
use for-range on Sequence in e*
Change-Id: I77dc12356ee45b1dee9acaf8a73dea81588822d3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94554 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'eventattacher')
-rw-r--r--eventattacher/source/eventattacher.cxx20
1 files changed, 8 insertions, 12 deletions
diff --git a/eventattacher/source/eventattacher.cxx b/eventattacher/source/eventattacher.cxx
index 6594d66944dc..fb7bb7563a4f 100644
--- a/eventattacher/source/eventattacher.cxx
+++ b/eventattacher/source/eventattacher.cxx
@@ -316,15 +316,14 @@ Sequence<OUString> EventAttacherImpl::getSupportedServiceNames_Static( )
void SAL_CALL EventAttacherImpl::initialize(const Sequence< Any >& Arguments)
{
// get services from the argument list
- const Any * pArray = Arguments.getConstArray();
- for( sal_Int32 i = 0; i < Arguments.getLength(); i++ )
+ for( const Any& arg : Arguments )
{
- if( pArray[i].getValueType().getTypeClass() != TypeClass_INTERFACE )
+ if( arg.getValueType().getTypeClass() != TypeClass_INTERFACE )
throw IllegalArgumentException();
// InvocationAdapter service ?
Reference< XInvocationAdapterFactory2 > xALAS;
- pArray[i] >>= xALAS;
+ arg >>= xALAS;
if( xALAS.is() )
{
Guard< Mutex > aGuard( m_aMutex );
@@ -332,7 +331,7 @@ void SAL_CALL EventAttacherImpl::initialize(const Sequence< Any >& Arguments)
}
// Introspection service ?
Reference< XIntrospection > xI;
- pArray[i] >>= xI;
+ arg >>= xI;
if( xI.is() )
{
Guard< Mutex > aGuard( m_aMutex );
@@ -340,7 +339,7 @@ void SAL_CALL EventAttacherImpl::initialize(const Sequence< Any >& Arguments)
}
// Reflection service ?
Reference< XIdlReflection > xIdlR;
- pArray[i] >>= xIdlR;
+ arg >>= xIdlR;
if( xIdlR.is() )
{
Guard< Mutex > aGuard( m_aMutex );
@@ -348,7 +347,7 @@ void SAL_CALL EventAttacherImpl::initialize(const Sequence< Any >& Arguments)
}
// Converter Service ?
Reference< XTypeConverter > xC;
- pArray[i] >>= xC;
+ arg >>= xC;
if( xC.is() )
{
Guard< Mutex > aGuard( m_aMutex );
@@ -598,12 +597,9 @@ Reference<XEventListener> EventAttacherImpl::attachListenerForTarget(
OUString aAddListenerName = "add" + aListenerName;
// Send Methods to the correct addListener-Method
- Sequence< Reference< XIdlMethod > > aMethodSeq = xAccess->getMethods( MethodConcept::LISTENER );
- const Reference< XIdlMethod >* pMethods = aMethodSeq.getConstArray();
- for (sal_Int32 i = 0, n = aMethodSeq.getLength(); i < n ; ++i)
+ const Sequence< Reference< XIdlMethod > > aMethodSeq = xAccess->getMethods( MethodConcept::LISTENER );
+ for (const Reference< XIdlMethod >& rxMethod : aMethodSeq)
{
- const Reference< XIdlMethod >& rxMethod = pMethods[i];
-
// Is it the correct method?
OUString aMethName = rxMethod->getName();