From 0bacaf4ef5574b87d2c6020fa057f7e89de6eb76 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Thu, 11 Aug 2011 11:55:46 -0400 Subject: Reduce indentation level. --- eventattacher/source/eventattacher.cxx | 104 ++++++++++++++++----------------- 1 file changed, 52 insertions(+), 52 deletions(-) (limited to 'eventattacher') diff --git a/eventattacher/source/eventattacher.cxx b/eventattacher/source/eventattacher.cxx index 06d48346604e..29954d9893f5 100644 --- a/eventattacher/source/eventattacher.cxx +++ b/eventattacher/source/eventattacher.cxx @@ -654,70 +654,70 @@ Reference EventAttacherImpl::attachListenerForTarget( // Is it the correct method? OUString aMethName = rxMethod->getName(); - if( aAddListenerName == aMethName ) - { - Sequence< Reference< XIdlClass > > params = rxMethod->getParameterTypes(); - sal_uInt32 nParamCount = params.getLength(); + if (aAddListenerName != aMethName) + continue; - Reference< XIdlClass > xListenerType; - if( nParamCount == 1 ) - xListenerType = params.getConstArray()[0]; - else if( nParamCount == 2 ) - xListenerType = params.getConstArray()[1]; + Sequence< Reference< XIdlClass > > params = rxMethod->getParameterTypes(); + sal_uInt32 nParamCount = params.getLength(); - // Request Adapter for the actual Listener type - Reference< XInterface > xAdapter = createAllListenerAdapter( - xInvocationAdapterFactory, xListenerType, xAllListener, aHelper ); + Reference< XIdlClass > xListenerType; + if( nParamCount == 1 ) + xListenerType = params.getConstArray()[0]; + else if( nParamCount == 2 ) + xListenerType = params.getConstArray()[1]; - if( !xAdapter.is() ) - throw CannotCreateAdapterException(); - xRet = Reference< XEventListener >( xAdapter, UNO_QUERY ); + // Request Adapter for the actual Listener type + Reference< XInterface > xAdapter = createAllListenerAdapter( + xInvocationAdapterFactory, xListenerType, xAllListener, aHelper ); - // Just the Listener as parameter? - if( nParamCount == 1 ) + if( !xAdapter.is() ) + throw CannotCreateAdapterException(); + xRet = Reference< XEventListener >( xAdapter, UNO_QUERY ); + + // Just the Listener as parameter? + if( nParamCount == 1 ) + { + Sequence< Any > args( 1 ); + args.getArray()[0] <<= xAdapter; + try { - Sequence< Any > args( 1 ); - args.getArray()[0] <<= xAdapter; - try - { - rxMethod->invoke( aObject, args ); - } - catch( InvocationTargetException& ) - { - throw IntrospectionException(); - } + rxMethod->invoke( aObject, args ); } - // Else, pass the other parameter now - else if( nParamCount == 2 ) + catch( InvocationTargetException& ) { - Sequence< Any > args( 2 ); - Any* pAnys = args.getArray(); + throw IntrospectionException(); + } + } + // Else, pass the other parameter now + else if( nParamCount == 2 ) + { + Sequence< Any > args( 2 ); + Any* pAnys = args.getArray(); - // Check the type of the 1st parameter - Reference< XIdlClass > xParamClass = params.getConstArray()[0]; - if( xParamClass->getTypeClass() == TypeClass_STRING ) - { - pAnys[0] <<= aAddListenerParam; - } + // Check the type of the 1st parameter + Reference< XIdlClass > xParamClass = params.getConstArray()[0]; + if( xParamClass->getTypeClass() == TypeClass_STRING ) + { + pAnys[0] <<= aAddListenerParam; + } - // 2nd Parameter == Listener? TODO: Test! - pAnys[1] <<= xAdapter; + // 2nd Parameter == Listener? TODO: Test! + pAnys[1] <<= xAdapter; - // TODO: Convert String -> ? - // else - try - { - rxMethod->invoke( aObject, args ); - } - catch( InvocationTargetException& ) - { - throw IntrospectionException(); - } + // TODO: Convert String -> ? + // else + try + { + rxMethod->invoke( aObject, args ); + } + catch( InvocationTargetException& ) + { + throw IntrospectionException(); } - break; - // else... - // Anything else is not supported } + break; + // else... + // Anything else is not supported } return xRet; -- cgit