summaryrefslogtreecommitdiff
path: root/comphelper
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@suse.com>2011-08-11 14:37:19 -0400
committerKohei Yoshida <kohei.yoshida@suse.com>2011-08-16 21:22:41 -0400
commitbc01bc636d104b435ea5ad1dcc7cab85d6dc4b9a (patch)
tree7a2cef219598e1609efe82cd1cf7dabcbfc4a9cc /comphelper
parent0bacaf4ef5574b87d2c6020fa057f7e89de6eb76 (diff)
Less indent level.
Diffstat (limited to 'comphelper')
-rw-r--r--comphelper/source/eventattachermgr/eventattachermgr.cxx50
1 files changed, 26 insertions, 24 deletions
diff --git a/comphelper/source/eventattachermgr/eventattachermgr.cxx b/comphelper/source/eventattachermgr/eventattachermgr.cxx
index e9d52290d460..4db4e60b71d5 100644
--- a/comphelper/source/eventattachermgr/eventattachermgr.cxx
+++ b/comphelper/source/eventattachermgr/eventattachermgr.cxx
@@ -693,32 +693,34 @@ void SAL_CALL ImplEventAttacherManager::attach(sal_Int32 nIndex, const Reference
AttachedObject_Impl & rCurObj = aCurrentPosition->aObjList.back();
rCurObj.aAttachedListenerSeq = Sequence< Reference< XEventListener > >( aCurrentPosition->aEventList.size() );
- if (!aCurrentPosition->aEventList.empty())
+ if (aCurrentPosition->aEventList.empty())
+ return;
+
+ Sequence<com::sun::star::script::EventListener> aEvents(aCurrentPosition->aEventList.size());
+ std::deque<ScriptEventDescriptor>::iterator itr = aCurrentPosition->aEventList.begin();
+ std::deque<ScriptEventDescriptor>::iterator itrEnd = aCurrentPosition->aEventList.end();
+ ::com::sun::star::script::EventListener* p = aEvents.getArray();
+ size_t i = 0;
+ for (; itr != itrEnd; ++itr)
{
- Sequence<com::sun::star::script::EventListener> aEvents(aCurrentPosition->aEventList.size());
- std::deque<ScriptEventDescriptor>::iterator itr = aCurrentPosition->aEventList.begin();
- std::deque<ScriptEventDescriptor>::iterator itrEnd = aCurrentPosition->aEventList.end();
- ::com::sun::star::script::EventListener* p = aEvents.getArray();
- size_t i = 0;
- for (; itr != itrEnd; ++itr)
- {
- com::sun::star::script::EventListener aListener;
- aListener.AllListener =
- new AttacherAllListener_Impl(this, itr->ScriptType, itr->ScriptCode);
- aListener.Helper = rCurObj.aHelper;
- aListener.ListenerType = itr->ListenerType;
- aListener.EventMethod = itr->EventMethod;
- aListener.AddListenerParam = itr->AddListenerParam;
- p[i++] = aListener;
- }
+ com::sun::star::script::EventListener aListener;
+ aListener.AllListener =
+ new AttacherAllListener_Impl(this, itr->ScriptType, itr->ScriptCode);
+ aListener.Helper = rCurObj.aHelper;
+ aListener.ListenerType = itr->ListenerType;
+ aListener.EventMethod = itr->EventMethod;
+ aListener.AddListenerParam = itr->AddListenerParam;
+ p[i++] = aListener;
+ }
- try
- {
- rCurObj.aAttachedListenerSeq = xAttacher->attachMultipleEventListeners(rCurObj.xTarget, aEvents);
- }
- catch (const Exception&)
- {
- }
+ try
+ {
+ rCurObj.aAttachedListenerSeq =
+ xAttacher->attachMultipleEventListeners(rCurObj.xTarget, aEvents);
+ }
+ catch (const Exception&)
+ {
+ // Fail gracefully.
}
}