On Sat, Apr 25, 2026 at 5:32 PM Damjan Jovanovic <[email protected]> wrote:

>
>
> After some cleanups, and a way to edit Python macros, that branch should
> be ready to merge :-).
>
>
I've now also fixed a bug where the file and script nodes were getting
greyed out buttons when the library gets renamed, because after renaming
their URI (relative to their parent library) becomes invalid. In Java they
fixed that by calling updateURI() on each child during rename, but in
Python I took a different approach: the child stores a reference to the
parent instead of the URI, and dynamically derives the URI using a uri()
method, which looks up the parent's URI and concates the child's name, so
the child always has the correct URI when the parent is renamed.

Otherwise, cleanups and better parameter verification, and also
found PackageBrowseNode also needed to implement XPropertySet and
XInvocation interfaces, without which the macro selection dialog breaks
when UNO packages with Python scripts are added.

Most of all, Python scripts can now be edited :-), in a custom little
dialog window with "Run", "Save" and "Close" buttons. It all works, they
run, they are successfully saved into the document, and can be re-opened.
The editing could still be improved a lot, with line numbers, debugging, a
resizable window and fixed width font, etc., but I don't have time for that
now, and to be fair, the BeanShell editor isn't much better.

All my changes have been pushed to the python-editing-embedding branch.
Please test. I'll merge it in a few days if there are no objections.

Regards
Damjan

Reply via email to