Files
odfstudio/pyuno/source
Neil Roberts 97302647ba tdf#173114 pyuno: Don’t require XInvocation2
If an object implements XInvocation then the Invocation service will
directly return the object instead of creating its own invocation
wrapper. In that case the object isn’t guaranteed to also implement
XInvocation2. Previously, this was making pyuno just throw an exception
whenever it encounters one of these objects.

The only case where XInvocation2 is actually used is the implementation
of the __dir__ method. I don’t think this method is used very often so
it’s probably OK to just make it return an empty list if XInvocation2
isn’t supported. That way we can just store a reference to XInvocation
instead of XInvocation2.

This change makes it possible to use objects that implement XInvocation
from Python, for example ooo.vba.excel.Application.

Change-Id: I822c4ffa760f52d6488b9c1009435d059fc19fdd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/209086
Tested-by: Jenkins
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
2026-08-13 12:43:01 +02:00
..