<html>
<head>
<base href="https://bugs.documentfoundation.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_UNCONFIRMED "
title="UNCONFIRMED - PyUno wrongly converts Tuples of Strings"
href="https://bugs.documentfoundation.org/show_bug.cgi?id=125307">125307</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>PyUno wrongly converts Tuples of Strings
</td>
</tr>
<tr>
<th>Product</th>
<td>LibreOffice
</td>
</tr>
<tr>
<th>Version</th>
<td>5.2 all versions
</td>
</tr>
<tr>
<th>Hardware</th>
<td>All
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>UNCONFIRMED
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>medium
</td>
</tr>
<tr>
<th>Component</th>
<td>sdk
</td>
</tr>
<tr>
<th>Assignee</th>
<td>libreoffice-bugs@lists.freedesktop.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>tv.bugs.freedesktop.org@beamnet.de
</td>
</tr></table>
<p>
<div>
<pre>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
<a href="https://forum.openoffice.org/en/forum/viewtopic.php?t=56460">https://forum.openoffice.org/en/forum/viewtopic.php?t=56460</a>
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:</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>