summaryrefslogtreecommitdiff
path: root/unoxml
diff options
context:
space:
mode:
authorMichael Stahl <mst@openoffice.org>2011-01-19 20:27:23 +0100
committerMichael Stahl <mst@openoffice.org>2011-01-19 20:27:23 +0100
commit46f681baadad8838b5efb5c9a2deb8b97161e9b9 (patch)
tree5051292a4ec8842969743eb27a3ed182c09a2f92 /unoxml
parent8ab417f83b7a6ee8a11deb5f534d6fc6c6fd9899 (diff)
xmlfix3: unoxml: CEventDispatcher::dispatchEvent(): fix iteration:
capture listener was not called for first node in vector. (assuming that it was intended to be called)
Diffstat (limited to 'unoxml')
-rw-r--r--unoxml/source/events/eventdispatcher.cxx19
1 files changed, 10 insertions, 9 deletions
diff --git a/unoxml/source/events/eventdispatcher.cxx b/unoxml/source/events/eventdispatcher.cxx
index c6e5bc4aebf2..7c7e72bb8429 100644
--- a/unoxml/source/events/eventdispatcher.cxx
+++ b/unoxml/source/events/eventdispatcher.cxx
@@ -186,25 +186,26 @@ namespace DOM { namespace events {
// to target. after that, any target listeners have to be called
// then bubbeling phase listeners are called in target to root
// order
- NodeVector::const_iterator inode;
-
// start at the root
- inode = captureVector.end();
- inode--;
- if (inode != captureVector.end())
+ NodeVector::const_reverse_iterator rinode =
+ const_cast<const NodeVector&>(captureVector).rbegin();
+ if (rinode != const_cast<const NodeVector&>(captureVector).rend())
{
// capturing phase:
pEvent->m_phase = PhaseType_CAPTURING_PHASE;
- while (inode != captureVector.begin())
+ while (rinode !=
+ const_cast<const NodeVector&>(captureVector).rend())
{
//pEvent->m_currentTarget = *inode;
pEvent->m_currentTarget = Reference< XEventTarget >(
- DOM::CNode::getCNode(*inode).get());
- callListeners(*inode, aType, xEvent, sal_True);
+ DOM::CNode::getCNode(*rinode).get());
+ callListeners(*rinode, aType, xEvent, sal_True);
if (pEvent->m_canceled) return sal_True;
- inode--;
+ rinode++;
}
+ NodeVector::const_iterator inode = captureVector.begin();
+
// target phase
pEvent->m_phase = PhaseType_AT_TARGET;
callListeners(*inode, aType, xEvent, sal_False);