Cancel event propagation in an XEventListener

The Application Programming Interface and the OASIS Open Document Format

Cancel event propagation in an XEventListener

Postby snnyspuc » Mon Apr 13, 2015 11:49 am

Is there any possibility to cancel the event propagation in an XEventListener ?

I have a class, DocumentEventListener, implementing the XEventListener interface which is added as a listener with the following code:

Object globalEventBroadcaster = m_xContext.getServiceManager().createInstanceWithContext("com.sun.star.frame.GlobalEventBroadcaster", m_xContext);

XEventBroadcaster xEVBC = (XEventBroadcaster) UnoRuntime.queryInterface(XEventBroadcaster.class, globalEventBroadcaster);

xEVBC.addEventListener(new DocumentEventListener(m_xContext));
OpenOffice 3.1 on Windows Vista / NeoOffice 2.2.3 with MacOS 10.4 / OpenOffice 2.4 on Ubuntu 9.04
snnyspuc
 
Posts: 1
Joined: Mon Apr 13, 2015 11:48 am

Re: Cancel event propagation in an XEventListener

Postby Villeroy » Mon Apr 13, 2015 8:07 pm

Remove the event listener. This requires a reference to the original listener you attached to the calling object. In Basic you would assign a global variable to the listener and add/remove this object as needed.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04, no OpenOffice, LibreOffice 6.4
User avatar
Villeroy
Volunteer
 
Posts: 28668
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany


Return to UNO API and ODF

Who is online

Users browsing this forum: No registered users and 0 guests