ooodev.adapter.table.cell_partial module

class ooodev.adapter.table.cell_partial.CellPartial(component, interface=com.sun.star.table.XCell)[source]

Bases: object

Partial Class for XCell.

Parameters:
  • component (XCell) –

  • interface (UnoInterface | None) –

__init__(component, interface=com.sun.star.table.XCell)[source]

Constructor

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

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

Return type:

None

get_error()[source]

returns the error value of the cell.

If the cell does not contain a formula, the error is always zero.

Return type:

int

get_formula()[source]

returns the formula string of a cell.

Even if the cell does not contain a formula, an assignment of this attribute’s value to another cell’s formula attribute would create the same cell content. This is because this attribute contains the original text value of a string cell. The value of a value cell will be formatted using the number format’s default format or the formula string, including “=”, of a formula cell.

Return type:

str

get_type()[source]

Gets the type of the cell.

Returns:

The type of the cell.

Return type:

CellContentType

Hint

  • CellContentType can be imported from ooo.dyn.table.cell_content_type.

get_value()[source]

Gets the floating point value of the cell.

For a value cell the value is returned, for a string cell zero is returned and for a formula cell the result value of a formula is returned.

Return type:

float

set_formula(formula)[source]

Sets a formula into the cell.

When assigned, the string will be interpreted and a value, text or formula cell is created, depending on the text and the number format.

Return type:

None

Parameters:

formula (str) –

set_value(value)[source]

Sets a floating point value into the cell.

After a call to this method the type of the cell is C``ellContentType.VALUE``.

Return type:

None

Parameters:

value (float) –