Hello,
I have converted the method setControlProperty in UnoDialog:
http://opengrok.libreoffice.org/xref/components/wizards/com/sun/star/wizards/ui/UnoDialog.java#149
as follow:
def setControlProperty(self, ControlName, PropertyName, PropertyValue):
try:
if PropertyValue:
if self.xDialogModel.hasByName(ControlName) == False:
return
xPSet = self.xDialogModel.getByName(ControlName)
if isinstance(PropertyValue,tuple):
uno.invoke(xPSet, "setPropertyValue", (PropertyName,
uno.Any( \
"com.sun.star.beans.PropertyValue",PropertyValue)))
else:
xPSet.setPropertyValue(PropertyName, PropertyValue)
except Exception, exception:
traceback.print_exc()
but I get this Exception:
File "/usr/lib/python2.6/dist-packages/uno.py", line 249, in invoke
return pyuno.invoke( object, methodname, argTuple )
com.sun.star.uno.RuntimeException: value is not of same or derived type!
as vmiklos told me in IRC the third parameter of invoke should be a tuple of
PropertyValue but in the Java code the variable PropertyValue is a Bool or
a list of strings.
Anybody knows can I solve it ?
Greetings
Context
- [Libreoffice] [GSOC] Java > Python, problem with uno.invoke · Xisco Faulí
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.