https://www.openoffice.org/api/docs/com ... nvert.html
convertToTextFrame on that page works fine, where tc and tc2 are text ranges
Code: Select all
thiscomponent.text.convertToTextFrame(tc.start,tc2.end,array())
Anyone understand the bit in bold and what to put in the first array sequence? This gives a crash:
convertToTable
XTextTable
convertToTable( [in] sequence< sequence< sequence< XTextRange > > > TableRanges,
[in] sequence< sequence< ::com::sun::beans::PropertyValues > > CellProperties,
[in] sequence< ::com::sun::beans::PropertyValues > RowProperties,
[in] ::com::sun::beans::PropertyValues TableProperties )
raises( ::com::sun::lang::IllegalArgumentException,
::com::sun::beans::UnknownPropertyException );
Description
.
Parameter TableRanges
contains the TextRange interfaces of the paragraphs, cells and rows of the table.
The innter sequence contains the start and end paragraphs of each table cell. The next sequence groups the cells to a row and the outer sequence groups the rows of the table.
Parameter CellProperties
contains the properties of each cell.
Parameter RowProperties
contains the properties of each table row.
Parameter TableProperties
contains the properties of the table.
Returns
the created table.
Code: Select all
'thiscomponent.text.convertToTable(array(tc.start,tc2.end),array(),array(),array())
Code: Select all
vc=thiscomponent.currentcontroller.viewcursor
tc = vc.text.createtextcursorbyrange(vc.text.start)
tc2 = vc.text.createtextcursorbyrange(vc.text.start)
tc.goright(6,true)
tc2.goright(6,false)
tc2.goright(6,true)
thiscomponent.text.convertToTextFrame(tc.start,tc2.end,array()) 'works fine
'thiscomponent.text.convertToTable(array(tc.start,tc2.end),array(),array(),array()) 'crash
'what to put?