Problem:
I created a new calc file, a new script, and bound a button to the script. It worked. Yay! If I save-close the file, and reopen it, the button no longer finds the script. This is true not only of script I write, but also of the included helloworld scripts (in both python and basic). After I re-open the file, If I check in control-properties for the button, the binding is still present, and I can also manually run the macro using:
Code: Select all
Tools->Macros->RunMacro
Code: Select all
urxvt -e $XOFFICEPATH/scalc -env:PYSCRIPT_LOG_LEVEL=DEBUG --nologo --nofirststartwizard --norestore --accept="socket,host=localhost,port=2002;urp;StarOffice.ServiceManager" &
I have tried playing with APSO. No change. I have embedded the script. No change. I have backed my JRE down from openjre 24 to openjre 17 and 11. No change.
The problem seems to be in whatever code dispatches the script, but I have no visibility into that code, and it isn't showing anything useful. Can I get a debug of what the button is doing when I click it?
The code is as follows, but seems irrelevant, since it runs. It just doesn't run a button for some reason.
Code: Select all
from __future__ import unicode_literals
import sys
import socket
import operator
import re
import uno
import unohelper
def button_foo1(*args):
self=FOO() # get the instance handle
self.importuno() # run the methods
thisclass = str(self.__class__)
self.helloworld(thisclass)
return True
class FOO():
def importuno(self):
self.ctx = uno.getComponentContext()
self.desktop = self.ctx.ServiceManager.createInstanceWithContext("com.sun.star.frame.Desktop", self.ctx)
self.document = self.desktop.getCurrentComponent()
self.controller = self.document.getCurrentController()
def helloworld(self,hellostr):
sheet = self.controller.ActiveSheet
cellc3 = sheet.getCellRangeByName("C3")
cellc3.String = hellostr
I am using:
LibreOffice 24.2.2.2 420(Build:2)
OpenJDK Runtime Environment (build 11.0.22+6-void-r1)
VOID Linux 6.6.25 MUSL
Thanks in advance!