Hi Darragh,
I cannot help you with pyUno-specific problems and I don't know the details of that API, but your code looks strange to me-
Darragh Sherwin wrote:
I am trying set a user defined attributes on a table cell ( com.sun.star.table.CellProperties ) using the PyUNO binding but when I use the code below:
table.getCellByName( cellId ) try: userAttrs = cell.getPropertyValue( "UserDefinedAttributes" )
OK. So userAttrs is a XNameContainer. Does this container accept any kind of item you can put into any Any?
myAttr = uno.createUnoStruct("com.sun.star.beans.PropertyValue") myAttr.Name = "URL"
myAttr.Value = "myURL"
I find it strange, that you want to use a PropertyValue struct as your attribute value. Wouldn't simply using myAttr = "myURL" be better? Why do you need the redundant name "URL"?
(Unless UserDefinedAttributes is specified to be a container of named PropertyValues - which I'd consider a design flaw).
uno.invoke( userAttrs , "insertByName", (myAttr.Name, uno.Any( \ "[]com.sun.star.beans.PropertyValue", myAttr)) )
Not knowing much about PyUno, is "[]com.sun.star.beans.PropertyValue" really correct for a single property value struct? Looks like that would require an array to me.
Is there a better way to set attributes for the User Defined Attributes of Properties?
I don't know how much converting (particularly to Any) PyUno invoke() handles automatically, but in the best case it would support
uno.invoke( userAttrs, insertByName, ("URL", myAttr) )or even
userAttrs.insertByName("URL",myAttr)Ciao, J�rg
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
