Kaydet (Commit) 46f681ba authored tarafından Michael Stahl's avatar Michael Stahl

xmlfix3: unoxml: CEventDispatcher::dispatchEvent(): fix iteration:

 capture listener was not called for first node in vector.
 (assuming that it was intended to be called)
üst 8ab417f8
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment