mobi-doc wrote:
Why someForm.addEventListener do not work in 3.0 ?
Why the need for someForm.com_sun_star_lang_XComponent_addEventListener in order to work in 3.0 ?
Or why the need for someForm.CurrentController.addEventListener in order to work in 3.0 ?
Why all of the above have unpredicted behaviour (sometimes work, sometimes they don't) if someForm is
ThisComponent or ThisComponent.CurrentController?
The document object of writer supports
com.sun.star.lang.XComponent,
com.sun.star.document.XEventBroadcaster and so on.
Defined in com.sun.star.document.XEventBroadcaster:
Code: Select all
void addEventListener( [in] com.sun.star.document.XEventListener Listener )
Defined in com.sun.star.lang.XComponent:
Code: Select all
void addEventListener( [in] com.sun.star.lang.XEventListener xListener )
They have the same name "addEventListener" and the program does not know which method is called by the user. I think the method found first in the object is called.
The peculiar com_sun_star_lang_XComponent_addEventListener kind of method call is well (?) known by the user of the OOo Basic experience to use XEventBroadcaster interfaces. I think the problem is caused Basic does not allow to define methods with the same name and different arguments.
See:
http://wiki.services.openoffice.org/wik ... ent_Events
In this case, I think you needed to call the method with quolified name.
I'm terrified. OOo 3.0 is around the corner and a lot of my code is going to break without any clue about how to fix it.
The object of the document is changed on 3.0 but the problem is not new one. But I wonder the order of the calling methods is changed...
Please, edit this thread's initial post and add "[Solved]" to the subject line if your problem has been solved.
Apache OpenOffice 4-dev on Xubuntu 14.04