Files
odfstudio/pyuno/source/module
Neil Roberts 346e0f8891 tdf#171122 pyuno: Handle service constructors
This makes it so that services can be imported in Python with code like
this:

from com.sun.star.resource import StringResourceWithLocation

And then an instance of the service can be constructed using any of its
constructors as a class method like this:

res = StringResourceWithLocation.create(ctx, root_url, True, locale,
                                        dlg, '', None)

This has the advantage that the number of arguments can be checked
properly and a more useful error message can be reported if they are not
correct. Because pyuno knows what types the arguments are supposed to
be, it can also do a better job of coercing them to the right ones. For
example in the example above it is possible to pass None for an
interface argument even though that normally represents the void type.

This idea evolved out of the discussion for tdf#169229.

Change-Id: I9b542178f1c101d58dcbbd241d4ecbc9fe38bc2c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199104
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
2026-03-04 13:52:55 +01:00
..