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
Thank you for reporting the bug. Please attach a sample document, as this makes it easier for us to verify the bug. I have set the bug's status to 'NEEDINFO'. Please change it back to 'UNCONFIRMED' once the requested document is provided. (Please note that the attachment will be public, remove any sensitive information before attaching it. See https://wiki.documentfoundation.org/QA/FAQ#How_can_I_eliminate_confidential_data_from_a_sample_document.3F for help on how to do so.)
Created attachment 196743 [details] An exemple of macros not working on LibO 24.8.1 When you click on the green button, a checkbox "CB1" is created and two events macro are assigned to this checkbox CB1. It's working with Libo 7.6.7.2 (tested now) but not with 24.8.1 (tested now) : the checkbox is created but the macro aren't attached to it. You need to erase the checkbox if it existes before clicking the button.
I add that I create before the checkbox by macro too and I assign in the same macro the events macro to add after the checkbox is created.
Tested with Version: 25.2.0.0.alpha0+ (X86_64) / LibreOffice Community Build ID: 4787fd4fc86230893a6da309f45964116b3a67df CPU threads: 4; OS: Linux 6.8; UI render: default; VCL: gtk3 Locale: cs-CZ (cs_CZ.UTF-8); UI: en-US Calc: threaded When I click green button, the checkbox is created and in the checkbox's properties - Events - are two macros aasigned. looks good to me. Please can zou test with dev version? You can download it here: http://dev-builds.libreoffice.org/daily/master/ Thank you
Hi, I've tested and it works. But there'i an artefact with the display (see png file).
Created attachment 196929 [details] Problem with chekbox display
(In reply to Thierry Munoz from comment #5) > Hi, > I've tested and it works. But there'i an artefact with the display (see png > file). Tested with : Version: 25.2.0.0.alpha0+ (X86_64) / LibreOffice Community Build ID: 3370e122d7f9edf40895f90706047ceb8ee7229d CPU threads: 4; OS: Linux 5.15; UI render: default; VCL: gtk3 Locale: fr-FR (fr_FR.UTF-8); UI: en-US Calc: threaded
Created attachment 196931 [details] Problem with checkbox text An other picture showing the problem with the checkbox text created. It seems that the text is repeated with a gap.
(In reply to Thierry Munoz from comment #5) > Hi, > I've tested and it works. But there'i an artefact with the display (see png > file). Reported as bug 164270.