diff options
author | Kohei Yoshida <kohei.yoshida@suse.com> | 2011-08-11 11:55:46 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@suse.com> | 2011-08-16 21:22:41 -0400 |
commit | 0bacaf4ef5574b87d2c6020fa057f7e89de6eb76 (patch) | |
tree | 045f37321f9c6d9f7329058e58c9122ff9b1368c /eventattacher/source/eventattacher.cxx | |
parent | 23e922056586ee96b54d1e0540a54bce845b091b (diff) |
Reduce indentation level.
Diffstat (limited to 'eventattacher/source/eventattacher.cxx')
-rw-r--r-- | eventattacher/source/eventattacher.cxx | 104 |
1 files changed, 52 insertions, 52 deletions
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<XEventListener> 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; |