ooodev.adapter.text.text_table_partial module

class ooodev.adapter.text.text_table_partial.TextTablePartial(component, interface=com.sun.star.text.XTextTable)[source]

Bases: TextContentPartial

Partial class for XTextTable.

Parameters:
  • component (XTextTable) –

  • interface (UnoInterface | None) –

__init__(component, interface=com.sun.star.text.XTextTable)[source]

Constructor

Parameters:
  • component (XTextTable) – UNO Component that implements com.sun.star.text.XTextTable interface.

  • interface (UnoInterface, optional) – The interface to be validated. Defaults to XTextTable.

Return type:

None

create_cursor_by_cell_name(name)[source]

Creates a text table cursor and returns the XTextTableCursor interface.

Initially the cursor is positioned in the cell with the specified name.

Return type:

XTextTableCursor

Parameters:

name (str) –

get_cell_by_name(name)[source]

Example: The cell in the 4th column and third row has the name D3.

In cells that are split, the naming convention is more complex. In this case the name is a concatenation of the former cell name (i.e. D3) and the number of the new column and row index inside of the original table cell separated by dots. This is done recursively.

Parameters:
  • cell_name (str) – The name of the cell.

  • name (str) –

Returns:

The cell with the specified name.

Return type:

XCell

Example

If the cell D3 is horizontally split, it now contains the cells D3.1.1 and D3.1.2.

get_cell_names()[source]

Gets the names of all cells in the table.

Return type:

Tuple[str, ...]

get_columns()[source]

Gets the columns of the table.

Return type:

XTableColumns

get_rows()[source]

Gets the rows of the table.

Return type:

XTableRows

initialize(rows, columns)[source]

Determines the numbers of rows and columns of the text table.

This method must be called after the object is created and before the object is insert or attached elsewhere.

Return type:

None

Parameters:
  • rows (int) –

  • columns (int) –