https://bugs.documentfoundation.org/show_bug.cgi?id=163175

            Bug ID: 163175
           Summary: Impossible to assign a macro to checkbox button as
                    usual
           Product: LibreOffice
           Version: 24.8.1.2 release
          Hardware: x86-64 (AMD64)
                OS: Linux (All)
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: BASIC
          Assignee: [email protected]
          Reporter: [email protected]

Hi,

I use 2 macro to assign 2 events on checkbox button. Until now this macro
worked without any problem on LibreOffice 7.6 for instance.
Now with LibreOffice 24.8.1, this macro doesn't work but there is no error
displayed : it's like the assignation is not done.

Here is the code of the 2 macros :

' assign sScriptURL event as css.awt.XActionListener::actionPerformed.
' event is assigned to the control described by the nIndex in the oForm
container
Sub AssignAction(nIndex As Integer, sScriptURL As String, oForm As Object)
  aEvent = CreateUnoStruct("com.sun.star.script.ScriptEventDescriptor")
  With aEvent
    .AddListenerParam = ""
    .EventMethod = "actionPerformed"
    .ListenerType = "XActionListener"
    .ScriptCode = sScriptURL
    .ScriptType = "Script"
  End With
  oForm.registerScriptEvent(nIndex, aEvent)
End Sub


'---------------------------------------------------------------------------

' assign sScriptURL event as css.awt.XActionListener::actionPerformed.
' event is assigned to the control described by the nIndex in the oForm
container
Sub AssignStatusModifie(nIndex As Integer, sScriptURL As String, oForm As
Object)
  aEvent = CreateUnoStruct("com.sun.star.script.ScriptEventDescriptor")
  With aEvent
    .AddListenerParam = ""
    .EventMethod = "itemStateChanged"
    .ListenerType = "XItemListener"
    .ScriptCode = sScriptURL
    .ScriptType = "Script"
  End With
  oForm.registerScriptEvent(nIndex, aEvent)
End Sub


My LibO version :
Version: 24.8.1.2 (X86_64) / LibreOffice Community
Build ID: 480(Build:2)
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: fr-FR (fr_FR.UTF-8); UI: fr-FR
Ubuntu package version: 4:24.8.1-0ubuntu0.22.04.1~lo1
Calc: threaded


Regards

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to