I want to add a presentation listener to a macro in LibreOffice 4.2.6.3 for Impress.
This is the basic code so far:
Option Explicit
Global oDoc
Global oPresentation
Global oController
Global oListener
Sub addListener
oDoc=ThisComponent
oPresentation=oDoc.Presentation
oListener=createUnoListener("test_","com.sun.star.presentation.XSlideShowListener")
Presentation.start()
oController=oPresentation.Controller
oController.addEventListener(oListener)
end sub
In addition i have added implementations for the listener methods with the “test_” prefix".
This gives me the error “Object variable not set.” for oController. Using “oController=oPresentation.getController()”
gives the same error. oController=ThisComponent.getCurrentController()
works however, but this gives me a “DrawController”. This does not seem like the correct controller for a presetation, as only the method “disposing” is called when going through the presentation.How do I make the above code work?