i'm trying to resize the width of a cell in a row from java. Accessing the row and determing the actual positions of the array TableColumnSeparator is no problem:
Changing the Position of colSeps[0] doesn't affect the table. It seems that the local (java) change of the position isn't communicated to the running openoffice. But even reassigning the separators array to the propertySet doesn't help.
i found out, that assigning changed ColSeparators to the tables PropertySet affects the colWidths - but this can only be done in a simple table. ColSeparators of the rows PropertySet sustained all my efforts to change them.
//Get the current value: This works and returns correct data
colSepsArray = (TableColumnSeparator[]) xRowProps.getPropertyValue("TableColumnSeparators");
//I modify the postions for each seprator in the array (all summing up to 10000)
:
colSepsArray[colIndex].Position = (short) Math.ceil(RelativeWidth);
//Set back the property for row
xRowProps.setPropertyValue("TableColumnSeparators", colSepsArrayNew);
//To check: I extract the property again: But these are still the same as were orignally.
hi!
thank for your code. but when i run it, the line
"TableColumnSeparator[] xSeparators = (TableColumnSeparator[])xObj.Value;"
raise an error: "can not convert int16 to TableColumnSeparator[]"