<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] "setPropertyValue" method does not accept particular Enum value"
   href="https://bugs.documentfoundation.org/show_bug.cgi?id=129437">129437</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[PYUNO] "setPropertyValue" method does not accept particular Enum value
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>LibreOffice
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>Inherited From OOo
          </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>minor
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>framework
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>libreoffice-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>jeanmarczambon@gmail.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Description:
Given the following python code:

import uno
from com.sun.star.awt.PushButtonType import OK
def enum_error():
    ctx = uno.getComponentContext()
    button_model =
ctx.ServiceManager.createInstance("com.sun.star.awt.UnoControlButtonModel")
    button_model.PushButtonType = OK
    button_model.setPropertyValue("PushButtonType", OK)

The penultimate line passes, while the last one raises the following error:

<class 'uno.com.sun.star.lang.IllegalArgumentException'>: Unable to convert the
given value for the property PushButtonType.
Expected type: short
Found type: com.sun.star.awt.PushButtonType


The workaround is obvious with "setPropertyValue" method, but the convenient
and more efficient "setPropertyValues" raises the same error without as
efficient alternative, as far as I understand.



Steps to Reproduce:
1. Copy and run the small python script above from within a LibreOffice
session.


Actual Results:
Error raised at last line (see error message in above description)

Expected Results:
Last line should pass without error, as per the penultimate line.


Reproducible: Always


User Profile Reset: No



Additional Info:
[Information automatically included from LibreOffice]
Locale: fr
Module: TextDocument
[Information guessed from browser]
OS: Linux (All)
OS is 64bit: yes</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>