[Libreoffice-bugs] [Bug 125307] New: PyUno wrongly converts Tuples of Strings
bugzilla-daemon at bugs.documentfoundation.org
bugzilla-daemon at bugs.documentfoundation.org
Wed May 15 12:44:03 UTC 2019
https://bugs.documentfoundation.org/show_bug.cgi?id=125307
Bug ID: 125307
Summary: PyUno wrongly converts Tuples of Strings
Product: LibreOffice
Version: 5.2 all versions
Hardware: All
OS: All
Status: UNCONFIRMED
Severity: normal
Priority: medium
Component: sdk
Assignee: libreoffice-bugs at lists.freedesktop.org
Reporter: tv.bugs.freedesktop.org at beamnet.de
Description:
Some uno functions, e.g. XPropertySet.setPropertyValue, accept arguments that
can be of type Any("[]String").
Calling such a method with a tuple of strings (which would correspond to what's
returned by getProperty) gives "inappropriate property value".
What appears to happen (from debugging with PYSCRIPT_LOG_LEVEL=DEBUG
PYUNO_LOGLEVEL=ARGS ) is that the tuple of strings get's converted into a Any
of type []Any with each element of the list being an Any of type String.
Manually calling with
uno.invoke(..., "setPropertyValue", ("myprop", uno.Any("[]String",
mytupleofstr)))
works, as described in
https://forum.openoffice.org/en/forum/viewtopic.php?t=56460
Steps to Reproduce:
Create a property of type []String in a python extension.
Try to read -> works, gives tuple of Strings.
Try to write -> doesn't work, uno.invoke works.
Actual Results:
try py->uno[0x561181e85c80].setPropertyValue((string)"lstFoo", ([]any){
(any){ (string)"Apples" }, (any){ (string)"Bananas" }, (any){ (string)"Oranges"
}, (any){ (string)"Grapes" } })
except py->uno[0x561181e85c80].setPropertyValue =
(com.sun.star.lang.IllegalArgumentException){
(com.sun.star.uno.RuntimeException){ (com.sun.star.uno.Exception){ Message =
(string)"configmgr inappropriate property value", Context =
(com.sun.star.uno.XInterface)0x56117709f6e0 } }, ArgumentPosition = (short)0x-1
}
Expected Results:
Conversion being to Any("[]String", ...).
Reproducible: Always
User Profile Reset: No
Additional Info:
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20190515/248fcb98/attachment.html>
More information about the Libreoffice-bugs
mailing list