Class WriteTableCellRange

class ooodev.write.table.write_table_cell_range.WriteTableCellRange(owner, component, range_obj)[source]

Bases: WriteDocPropPartial, WriteTablePropPartial, CellRangeComp, CellPartial, CharacterPropertiesPartial, ParagraphPropertiesPartial, LoInstPropsPartial, PropPartial, StylePartial, QiPartial

Represents writer table rows.

Parameters:
  • owner (ComponentT) –

  • component (XCellRange) –

  • range_obj (RangeObj) –

__getitem__(key)[source]

Returns the Write Table Cell.

Parameters:

key (Any) – Key. can be a Tuple of (col, row) or a string such as “A1” or a CellObj.

Returns:

Table Cell Object.

Return type:

WriteTableCell

Example

>>> table = doc.tables[0]
>>> rng = table.get_cell_range_by_name("A1:D10")
>>> cell = rng["D3"]
>>> print(cell, cell.value)
WriteTableCell(cell_name=C4) Sean Connery

See also

__init__(owner, component, range_obj)[source]

Constructor

Parameters:
  • component (TextTableRow) – UNO object that supports om.sun.star.text.TextTableRow service.

  • owner (Any) –

  • range_obj (RangeObj) –

Return type:

None

__iter__()[source]

Iterates through the cells.

The iteration is done in a column-major order, meaning that the cells are iterated over by column, then by row.

Example

>>> rng = table.get_cell_range_by_name("A1:C3")
>>> for cell in rng:
>>> print(cell, cell.value)
WriteTableCell(cell_name=A1) Title
WriteTableCell(cell_name=B1) Year
WriteTableCell(cell_name=C1) Actor
WriteTableCell(cell_name=A2) Dr. No
WriteTableCell(cell_name=B2) 1962
WriteTableCell(cell_name=C2) Sean Connery
WriteTableCell(cell_name=A3) From Russia with Love
WriteTableCell(cell_name=B3) 1963
WriteTableCell(cell_name=C3) Sean Connery
Return type:

Generator[WriteTableCell, Any, Any]

add_chart_data_change_event_listener(listener)

allows a component supporting the XChartDataChangeEventListener interface to register as listener.

The component will be notified with a ChartDataChangeEvent every time the chart’s data changes.

Return type:

None

Parameters:

listener (com.sun.star.chart.XChartDataChangeEventListener) –

add_event_chart_data_change_event_events_disposing(cb)

Adds a listener for an event.

Event is invoked when the broadcaster is about to be disposed.

The callback EventArgs.event_data will contain a UNO com.sun.star.lang.EventObject struct.

Return type:

None

Parameters:

cb (Any) –

add_event_chart_data_changed(cb)

Adds a listener for an event.

Event is invoked when chart data changes in value or structure.

The callback EventArgs.event_data will contain a UNO com.sun.star.chart.ChartDataChangeEvent struct.

Return type:

None

Parameters:

cb (Any) –

add_event_property_change(name, cb)

Adds a listener for an event.

Event is invoked when property is changed.

The callback EventArgs.event_data will contain a com.sun.star.beans.PropertyChangeEvent struct.

Parameters:
  • name (str) – Property Name

  • cb (EventArgsCallbackT) – Callback

Return type:

None

add_event_property_change_events_disposing(name, cb)

Adds a listener for an event.

Event is invoked when the property listener is about to be disposed.

The callback EventArgs.event_data will contain a UNO com.sun.star.lang.EventObject struct.

Parameters:
  • name (str) – Property Name

  • cb (EventArgsCallbackT) – Callback

Return type:

None

add_event_vetoable_change(name, cb)

Adds a listener for an event.

Event is invoked when property is changed.

The callback EventArgs.event_data will contain a com.sun.star.beans.PropertyChangeEvent struct.

Parameters:
  • name (str) – Property Name

  • cb (EventArgsCallbackT) – Callback

Return type:

None

add_event_vetoable_change_events_disposing(name, cb)

Adds a listener for an event.

Event is invoked when the property listener is about to be disposed.

The callback EventArgs.event_data will contain a UNO com.sun.star.lang.EventObject struct.

Parameters:
  • name (str) – Property Name

  • cb (EventArgsCallbackT) – Callback

Return type:

None

apply_styles(*styles, **kwargs)

Applies style to component.

Parameters:
  • obj. (styles expandable list of styles object such as Font to apply to) –

  • kwargs (Any, optional) – Expandable list of key value pairs.

  • styles (StyleT) –

Return type:

None

get_cell(cell_obj: ooodev.utils.data_type.cell_obj.CellObj)[source]
get_cell(values: Tuple[int, int])
get_cell(col: int, row: int)
get_cell(addr: com.sun.star.table.CellAddress)
get_cell(cell: com.sun.star.table.XCell)
get_cell(val: ooodev.utils.data_type.cell_values.CellValues)
get_cell(name: str)
get_cell(*args, **kwargs)

Returns a single cell within the range.

Return type:

WriteTableCell

get_cell_by_position(col, row)[source]

Returns a single cell within the range.

Parameters:
  • col (int) – Column. Zero Based column index. Can be negative to get from end.

  • row (int) – Row. Zero Based row index. Can be negative to get from end.

Raises:

IndexError – If the index is out of range.

Returns:

Cell Object.

Return type:

WriteTableCell

get_cell_range(cell_obj: ooodev.utils.data_type.cell_obj.CellObj)[source]
get_cell_range(range_obj: ooodev.utils.data_type.range_obj.RangeObj)
get_cell_range(col_start: int, row_start: int, col_end: int)
get_cell_range(addr: com.sun.star.table.CellRangeAddress)
get_cell_range(rng: ooodev.utils.data_type.range_values.RangeValues)
get_cell_range(rng_name: str)
get_cell_range(*args, **kwargs)

Gets a range Object representing a range.

Parameters:

rng_name (str) – Range as string such as Sheet1.A1:C125 or A1:C125

Returns:

Range object.

Return type:

WriteTableCellRange

get_cell_range_by_name(rng)[source]

Returns a sub-range of cells within the range.

The sub-range is specified by its name. The format of the range name is dependent of the context of the table. In spreadsheets valid names may be A1:C5 or $B$2 or even defined names for cell ranges such as MySpecialCell.

Returns:

Cell Object.

Return type:

WriteTableCell

Parameters:

rng (str) –

Note

This method returns a sub range of cells within the range. Sub-ranges cell names and indexes do not match up with the parent range. If a sub-ranges is A3:D6 then sub_rng["A1"] is at column 0, row 0 of the sub-range but has a cell name of A3.

Example

>>> rng = table.get_cell_range_by_name("A1:D10")
>>> sub1 = rng.get_cell_range_by_name("A3:D6")
>>> print("Sub1 cell A1")
>>> print(cell, cell.value)
Sub1 cell A1
WriteTableCell(cell_name=A3) From Russia with Love
>>> sub2 = sub1.get_cell_range_by_name("A4:D5")
>>> print("Sub1")
>>> for cell in sub2:
>>>     print(cell, cell.value)
Sub2
WriteTableCell(cell_name=A4) Goldfinger
WriteTableCell(cell_name=B4) 1964
WriteTableCell(cell_name=C4) Sean Connery
WriteTableCell(cell_name=D4) Guy Hamilton
WriteTableCell(cell_name=A5) Thunderball
WriteTableCell(cell_name=B5) 1965
WriteTableCell(cell_name=C5) Sean Connery
WriteTableCell(cell_name=D5) Terence Young
get_cell_range_by_position(left, top, right, bottom)[source]

Returns a sub-range of cells within the range.

Raises:

IndexError – If the index is out of range.

Returns:

Cell Object.

Return type:

WriteTableCell

Parameters:
  • left (int) –

  • top (int) –

  • right (int) –

  • bottom (int) –

Note

This method returns a sub-range of cells within the range. Sub-ranges cell names and indexes do not match up with the parent range. If a sub-ranges is A3:D6 then sub_rng[(0,0)] is at column 0, row 0 of the sub-range but has a cell name of A3.

get_column_data(idx, as_floats=False, start_row_idx=0)[source]

Gets the column data.

Parameters:
  • idx (int) – Index of the column. Zero Based. Can be negative to get from end.

  • as_floats (bool, optional) – If True then get all values as floats. If the cell is not a number then it is converted to 0.0. Defaults to False.

  • start_row_idx (int, optional) – Start Row Index. Zero Based. Can be negative to get from end. Defaults to 0.

Returns:

Tuple of values.

Return type:

Tuple[float | str | None, …]

get_column_descriptions()

Gets the description texts for all columns.

Return type:

Tuple[str, ...]

get_column_range(col, start_row_idx=0)[source]

Returns a sub-range of cells within the range.

Parameters:
  • col (int, str) – Zero Based column index or a Colum Letter such as A. If integer then can also be a negative value to get from end.

  • start_row_idx (int, optional) – Start Row Index. Zero Based. Can be negative to get from end. Defaults to 0.

Returns:

Range object.

Return type:

WriteTableCellRange

get_data()

Gets the numerical data as a nested sequence of values.

Return type:

Tuple[Tuple[float, ...], ...]

get_data_array()

Gets an array from the contents of the cell range.

Each element of the result contains a float or a string.

Return type:

Tuple[Tuple[Any, ...], ...]

get_error()

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()

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_not_a_number()

In IEEE arithmetic format it is one of the NaN values, so there are no conflicts with existing numeric values.

Return type:

float

get_property(name, default=<object object>)

Get property value

Parameters:
  • name (str) – Property Name.

  • default (Any, optional) – Return value if property value is None.

Returns:

Property value or default.

Return type:

Any

get_row_data(idx, as_floats=False)[source]

Gets the row data.

Parameters:
  • idx (int) – Index of the row. Zero Based. Can be negative to get from end.

  • as_floats (bool, optional) – If True then get all values as floats. If the cell is not a number then it is converted to 0.0. Defaults to False.

Returns:

Tuple of values.

Return type:

Tuple[float | str | None, …]

get_row_descriptions()

retrieves the description texts for all rows.

Return type:

Tuple[str, ...]

get_row_range(row)[source]

Returns a sub-range of cells within the range for a given row.

Parameters:

row (int) – Row Index. Zero Based. Can be negative to get from end.

Returns:

Range object.

Return type:

WriteTableCellRange

get_table_column_index(idx)[source]

Gets the table row index from the range relative index.

The range index is the index of the row within this range. A range can be a subset of the table. This method returns the table row index from the range index.

Parameters:

idx (int) – Column index within this range. Zero Based. Can be negative to get from end.

Returns:

Table Row Index. Zero Based.

Return type:

int

get_table_range_obj(col_idx, row_idx)[source]

Gets a cell object that contains column and row where the cell is located in the actual table.

Parameters:
  • col_idx (int) – Column index within this range. Zero Based. Can be negative to get from end.

  • row_idx (int) – Row index within this range. Zero Based. Can be negative to get from end.

Returns:

_description_

Return type:

CellObj

get_table_row_index(idx)[source]

Gets the table row index from the range relative index.

The range index is the index of the row within this range. A range can be a subset of the table. This method returns the table row index from the range index.

Parameters:

idx (int) – Row index within this range. Zero Based. Can be negative to get from end.

Returns:

Table Row Index. Zero Based.

Return type:

int

get_type()

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()

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

is_not_a_number(number)

checks whether the value given is equal to the indicator value for a missing value.

In IEEE arithmetic format it is one of the NaN values, so there are no conflicts with existing numeric values.

Always use this method to check, if a value is not a number. If you compare the value returned by XChartData.getNotANumber() to another double value using the = operator, you may not get the desired result!

Return type:

bool

Parameters:

number (float) –

qi(atype, raise_err=False)

Generic method that get an interface instance from an object.

Parameters:
  • atype (T) – Interface type to query obj for. Any Uno class that starts with ‘X’ such as XInterface

  • raise_err (bool, optional) – If True then raises MissingInterfaceError if result is None. Default False

Raises:

MissingInterfaceError – If ‘raise_err’ is ‘True’ and result is None

Returns:

instance of interface if supported; Otherwise, None

Return type:

T | None

Note

When raise_err=True return value will never be None.

remove_chart_data_change_event_listener(listener)

Removes a previously registered listener.

Return type:

None

Parameters:

listener (com.sun.star.chart.XChartDataChangeEventListener) –

remove_event_chart_data_change_event_events_disposing(cb)

Removes a listener for an event

Return type:

None

Parameters:

cb (Any) –

remove_event_chart_data_changed(cb)

Removes a listener for an event

Return type:

None

Parameters:

cb (Any) –

remove_event_property_change(name)

Removes a listener for an event

Parameters:

name (str) – Property Name

Return type:

None

remove_event_property_change_events_disposing(name)

Removes a listener for an event

Parameters:

name (str) – Property Name

Return type:

None

remove_event_vetoable_change(name)

Removes a listener for an event

Parameters:

name (str) – Property Name

Return type:

None

remove_event_vetoable_change_events_disposing(name)

Removes a listener for an event

Parameters:

name (str) – Property Name

Return type:

None

set_column_descriptions(*descriptions)

Sets the description texts for all columns.

Return type:

None

Parameters:

descriptions (str) –

set_data(data)

Sets the chart data as an array of numbers.

Return type:

None

Parameters:

data (Tuple[Tuple[float, ...], ...]) –

set_data_array(array)[source]

Fills the cell range with values from an array.

The size of the array must be the same as the size of the cell range. Each element of the array must contain a float or a string.

Warning

The size of the array must be the same as the size of the cell range. This means when setting table data the table must be the same size as the data. When setting a table range the array must be the same size as the range.

Return type:

None

Parameters:

array (Sequence[Sequence[Any]]) –

set_formula(formula)

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_property(**kwargs)

Set property value

Parameters:

**kwargs (Any) – Variable length Key value pairs used to set properties.

Return type:

None

set_row_descriptions(*descriptions)

sets the description texts for all rows.

Return type:

None

Parameters:

descriptions (str) –

set_value(value)

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) –

property back_color: Color

Gets/Sets the background color.

Returns:

Returns Color.

Return type:

Color

property back_graphic: com.sun.star.graphic.XGraphic

Gets/Sets the graphic object that is displayed as background graphic.

Return type:

XGraphic

property back_graphic_filter: str

Gets/Sets the name of the graphic filter of the background graphic.

Return type:

str

property back_graphic_location: GraphicLocation

Gets/Sets the position of the background graphic.

Returns:

Returns GraphicLocation.

Return type:

GraphicLocation

Hint

  • GraphicLocation can be imported from ooo.dyn.style.graphic_location

property back_graphic_url: str

Gets/Sets the URL to the background graphic.

Returns:

Returns URL to the background graphic.

Return type:

str

Note

the new behavior since it this was deprecated: This property can only be set and only external URLs are supported (no more vnd.sun.star.GraphicObject scheme). When an URL is set, then it will load the graphic and set the BackGraphic property.

property back_transparent: bool

Gets/Sets whether the background is transparent.

Return type:

bool

property border_distance: UnitMM100 | None

Gets/Sets the distance from the border to the object.

When setting the value, it can be either a float or an instance of UnitT.

optional

Return type:

UnitMM100 | None

property bottom_border: BorderLine2StructComp | None

Gets/Sets the bottom border of the object.

Setting value can be done with a BorderLine2 or BorderLine2StructComp object.

optional

Returns:

Returns BorderLine2 or None if not supported.

Return type:

BorderLine2StructComp | None

Hint

  • BorderLine2 can be imported from ooo.dyn.table.border_line2

property bottom_border_distance: UnitMM100 | None

Gets/Sets the distance from the bottom border to the object.

When setting the value, it can be either a float or an instance of UnitT.

optional

Return type:

UnitMM100 | None

property break_type: BreakType | None

Gets/Sets the type of break that is applied at the beginning of the table.

optional

Returns:

Returns BreakType or None if not supported.

Return type:

BreakType | None

Hint

  • BreakType can be imported from ooo.dyn.style.break_type

property char_auto_kerning: bool | None

Gets/Sets - This optional property determines whether the kerning tables from the current font are used.

Automatic kerning applies a spacing in between certain pairs of characters to make the text look better.

Optional

Return type:

bool | None

property char_back_color: Color | None

Get/Sets - This optional property contains the text background color.

Optional

Returns:

Color or None if not supported.

Return type:

Color | None

property char_back_transparent: bool | None

Gets/Sets if the text background color is set to transparent.

Optional

Return type:

bool | None

property char_border_distance: UnitMM100 | None

Gets/Sets the distance from the border to the object.

When setting the value, it can be either a float or an instance of UnitT.

Optional

Return type:

UnitMM100 | None

property char_bottom_border: BorderLine2StructComp | None

This property contains the bottom border of the object.

Setting value can be done with a BorderLine2 or BorderLine2StructComp object.

optional

Returns:

Returns BorderLine2 or None if not supported.

Return type:

BorderLine2StructComp | None

Hint

  • BorderLine2 can be imported from ooo.dyn.table.border_line2

property char_bottom_border_distance: UnitMM100 | None

This property contains the distance from the bottom border to the object.

When setting the value, it can be either a float or an instance of UnitT.

optional

Return type:

UnitMM100 | None

property char_case_map: int | None

Gets/Sets - This optional property contains the value of the case-mapping of the text for formatting and displaying.

optional

Return type:

int | None

property char_color: Color

This property contains the value of the text color.

Returns:

Color

Return type:

Color

property char_color_theme: int | None

Gets/Sets - If available, keeps the color theme index, so that the character can be re-colored easily based on a theme.

since

LibreOffice 7.3

optional

Return type:

int | None

property char_color_tint_or_shade: int | None

Gets/Sets the tint or shade of the character color.

since

LibreOffice 7.3

optional

Return type:

int | None

property char_combine_is_on: bool | None

Gets/Sets - This optional property determines whether text is formatted in two lines.

It is linked to the properties char_combine_prefix and char_combine_suffix.

optional

Return type:

bool | None

property char_combine_prefix: str | None

Gets/Sets - This optional property contains the prefix (usually parenthesis) before text that is formatted in two lines.

It is linked to the properties char_combine_is_on and char_combine_suffix.

optional

Return type:

str | None

property char_combine_suffix: str | None

Gets/Sets - This optional property contains the suffix (usually parenthesis) after text that is formatted in two lines.

It is linked to the properties CharCombineIsOn and CharCombinePrefix.

optional

Return type:

str | None

property char_contoured: bool | None

Gets/Sets - This optional property specifies if the characters are formatted and displayed with a contour effect.

optional

Return type:

bool | None

property char_crossed_out: bool | None

Gets/Sets - This property is True if the characters are crossed out.

optional

Return type:

bool | None

property char_emphasis: int | None

Gets/Sets - This optional property contains the font emphasis value.

optional

Return type:

int | None

property char_escapement: int | None

Gets/Sets the percentage by which to raise/lower superscript/subscript characters.

Negative values denote subscripts and positive values superscripts.

optional

Return type:

int | None

property char_escapement_height: int | None

Gets/Sets - This is the relative height used for subscript or superscript characters in units of percent.

The value 100 denotes the original height of the characters.

optional

Return type:

int | None

property char_flash: bool | None

Gets/Sets - If this optional property is True, then the characters are flashing.

optional

Return type:

bool | None

property char_font_char_set: int

Gets/Sets - This property contains the text encoding of the font.

Return type:

int

property char_font_family: int

Get/Sets the font family.

Return type:

int

property char_font_name: str

Gets/Sets the name of the font style.

It may contain more than one name separated by comma.

Return type:

str

property char_font_pitch: int

Gets/Sets the font pitch.

Return type:

int

property char_font_style_name: str

Gets/Sets the name of the font style.

This property may be empty.

Return type:

str

property char_font_type: int | None

Gets/Sets - This optional property specifies the fundamental technology of the font.

optional

Return type:

int | None

property char_height: UnitPT

Gets/Sets - This value contains the height of the characters in point.

When setting the value can be a float (in points) or a UnitT instance.

Return type:

UnitPT

property char_hidden: bool | None

Gets/Sets - If this optional property is True, then the characters are invisible.

optional

Return type:

bool | None

property char_highlight: Color | None

Gets/Sets the color of the highlight.

optional

Returns:

Color

Return type:

Color

property char_interop_grab_bag: Tuple[PropertyValue, ...] | None

Gets/Sets grab bag of character properties, used as a string-any map for interim interop purposes.

This property is intentionally not handled by the ODF filter. Any member that should be handled there should be first moved out from this grab bag to a separate property.

Optional

Return type:

Tuple[PropertyValue, …] | None

property char_keep_together: bool | None

Gets/Sets - This optional property marks a range of characters to prevent it from being broken into two lines.

A line break is applied before the range of characters if the layout makes a break necessary within the range.

optional

Return type:

bool | None

property char_kerning: int | None

Gets/Sets - This optional property contains the value of the kerning of the characters.

optional

Return type:

int | None

property char_left_border: BorderLine2StructComp | None

Gets/Sets - This property contains the left border of the object.

Setting value can be done with a BorderLine2 or BorderLine2StructComp object.

optional

Returns:

Returns BorderLine2 or None if not supported.

Return type:

BorderLine2StructComp | None

Hint

  • BorderLine2 can be imported from ooo.dyn.table.border_line2

property char_left_border_distance: UnitMM100 | None

Gets/Sets - This property contains the distance from the left border to the object.

When setting the value, it can be either a float or an instance of UnitT.

optional

Return type:

UnitMM100 | None

property char_locale: Locale

Gets/Sets - This property contains the value of the locale.

Return type:

Locale

property char_no_hyphenation: bool | None

Gets/Sets - This optional property determines if the word can be hyphenated at the character.

optional

Return type:

bool | None

property char_no_line_break: bool | None

Gets/Sets - This optional property marks a range of characters to ignore a line break in this area.

A line break is applied behind the range of characters if the layout makes a break necessary within the range. That means that the text may go through the border.

optional

Return type:

bool | None

property char_posture: FontSlant

Gets/Sets - This property contains the value of the posture of the document.

Returns:

Returns FontSlant

Return type:

FontSlant

Hint

  • FontSlant can be imported from ooo.dyn.awt.font_slant

property char_relief: int | None

Gets/Sets - This optional property contains the relief style of the characters.

optional

Return type:

int | None

property char_right_border: BorderLine2StructComp | None

Gets/Sets - This property contains the right border of the object.

Setting value can be done with a BorderLine2 or BorderLine2StructComp object.

optional

Returns:

Returns BorderLine2 or None if not supported.

Return type:

BorderLine2StructComp | None

Hint

  • BorderLine2 can be imported from ooo.dyn.table.border_line2

property char_right_border_distance: UnitMM100 | None

Gets/Sets - This property contains the distance from the right border to the object.

When setting the value, it can be either a float or an instance of UnitT.

optional

Return type:

UnitMM100 | None

property char_rotation: Angle10 | None

Gets/Sets - This optional property determines the rotation of a character in tenths of a degree.

Depending on the implementation only certain values may be allowed.

optional

Returns:

Returns Angle10, 1/10th degrees, or None if not supported.

Return type:

Angle10

Hint

  • Angle10 can be imported from ooodev.units

property char_rotation_is_fit_to_line: bool | None

Gets/Sets - This optional property determines whether the text formatting tries to fit rotated text into the surrounded line height.

optional

Return type:

bool | None

property char_scale_width: int | None

Gets/Sets - This optional property determines the percentage value for scaling the width of characters.

The value refers to the original width which is denoted by 100, and it has to be greater than 0.

optional

Return type:

int | None

property char_shading_value: int | None

Gets/Sets - This optional property contains the text shading value.

optional

Return type:

int | None

property char_shadow_format: ShadowFormatStructComp | None

Gets/Sets the type, color, and width of the shadow.

When setting the value can be an instance of ShadowFormatStructComp or ShadowFormat.

optional

Returns:

Shadow Format or None if not supported.

Return type:

ShadowFormatStructComp

Hint

  • ShadowFormat can be imported from ooo.dyn.table.shadow_format

property char_shadowed: bool | None

Gets/Sets - This optional property specifies if the characters are formatted and displayed with a shadow effect.

optional

Return type:

bool | None

property char_strikeout: FontStrikeoutEnum | None

Gets/Sets - This property determines the type of the strike out of the character.

optional

Returns:

Returns FontStrikeoutEnum or None if not supported.

Return type:

FontStrikeoutEnum | None

Hint

  • FontStrikeoutEnum can be imported from ooo.dyn.awt.font_strikeout

property char_style_name: str | None

Gets/Sets - This optional property specifies the name of the style of the font.

optional

Return type:

str | None

property char_style_names: Tuple[str, ...] | None

Gets/Sets - This optional property specifies the names of the all styles applied to the font.

It is not guaranteed that the order in the sequence reflects the order of the evaluation of the character style attributes.

Optional

Return type:

Tuple[str, …] | None

property char_top_border: BorderLine2StructComp | None

Gets/Sets - This property contains the top border of the object.

Setting value can be done with a BorderLine2 or BorderLine2StructComp object.

optional

Returns:

Returns BorderLine2 or None if not supported.

Return type:

BorderLine2StructComp | None

Hint

  • BorderLine2 can be imported from ooo.dyn.table.border_line2

property char_top_border_distance: UnitMM100 | None

Gets/Sets - This property contains the distance from the top border to the object.

When setting the value, it can be either a float or an instance of UnitT.

optional

Return type:

UnitMM100 | None

property char_transparence: int | None

Gets/Sets - This is the transparency of the character text.

The value 100 means entirely transparent, while 0 means not transparent at all.

optional

Return type:

int | None

property char_underline: FontUnderlineEnum

This property contains the value for the character underline.

Return type:

FontUnderlineEnum

property char_underline_color: Color

Gets/Sets the color of the underline for the characters.

Returns:

Color

Return type:

Color

property char_underline_has_color: bool

Gets/Sets if the property char_underline_color is used for an underline.

Return type:

bool

property char_weight: float

Gets/Sets the value of the font weight.

Example

from com.sun.star.awt import FontWeight

my_char_properties.char_weight = FontWeight.BOLD
Return type:

float

property char_word_mode: bool | None

Gets/Sets - If this property is True, the underline and strike-through properties are not applied to white spaces.

optional

Return type:

bool | None

property chart_column_as_label: bool

Gets/Sets if the first column of the table should be treated as axis labels when a chart is to be created.

Return type:

bool

property chart_row_as_label: bool

Gets/Sets if the first row of the table should be treated as axis labels when a chart is to be created.

Return type:

bool

property component: com.sun.star.text.CellRange

CellRange Component

Return type:

CellRange

property continuing_previous_sub_tree: bool | None

Gets that a child node of a parent node that is not counted is continuing the numbering of parent’s previous node’s sub tree.

optional

Return type:

bool | None

property drop_cap_char_style_name: str | None

Gets/Sets the character style name for drop caps.

optional

Return type:

str | None

property drop_cap_format: DropCapFormatStructComp | None

Gets/Sets whether the first characters of the paragraph are displayed in capital letters and how they are formatted.

optional

Returns:

Drop cap format or None if not supported.

Return type:

DropCapFormatStructComp

Hint

  • DropCapFormat can be imported from ooo.dyn.style.drop_cap_format

property drop_cap_whole_word: bool | None

Gets/Sets if the property DropCapFormat is applied to the whole first word.

optional

Return type:

bool | None

property events_listener_chart_data_change_event: ChartDataChangeEventListener

Returns listener

Return type:

ChartDataChangeEventListener

Gets/Sets - This optional property contains the name of the hyperlink.

optional

Return type:

str | None

Gets/Sets - This optional property contains the name of the target for a hyperlink.

optional

Return type:

str | None

Gets/Sets - This optional property contains the URL of a hyperlink.

optional

Return type:

str | None

property left_border: BorderLine2StructComp | None

Gets/Sets the left border of the object.

optional

Return type:

BorderLine2StructComp | None

property left_border_distance: UnitMM100 | None

Gets/Sets the distance from the left border to the object.

When setting the value, it can be either a float or an instance of UnitT.

optional

Return type:

UnitMM100 | None

property list_id: str | None

Gets/Sets the id of the list to which the paragraph belongs.

optional

Return type:

str | None

property list_label_string: str | None

Gets reading the generated numbering list label.

optional

Return type:

str | None

property lo_inst: LoInst

Lo Instance

Return type:

LoInst

property number_format: int

Gets/Sets the number format.

Return type:

int

property numbering_is_number: bool | None

Gets/Sets.

Returns False if the paragraph is part of a numbering, but has no numbering label.

A paragraph is part of a numbering, if a style for a numbering is set - see numbering_style_name. If the paragraph is not part of a numbering the property is void.

optional

Return type:

bool | None

property numbering_level: int | None

Gets/Sets the numbering level of the paragraph.

optional

Return type:

int | None

property numbering_rules: IndexReplaceComp | None

Gets/Sets the numbering rules applied to this paragraph.

When setting the value, it can be either an instance of XIndexReplace or IndexReplaceComp.

optional

Return type:

IndexReplaceComp | None

property numbering_start_value: int | None

Gets/Sets the start value for numbering if a new numbering starts at this paragraph.

optional

Return type:

int | None

property numbering_style_name: str | None

Gets/Sets the name of the style for the numbering.

The name must be one of the names which are available via XStyleFamiliesSupplier.

optional

Return type:

str | None

property office_doc: OfficeDocumentT

Office Document.

Return type:

OfficeDocumentT

property outline_level: int | None

Gets/Sets the outline level to which the paragraph belongs

Value 0 indicates that the paragraph belongs to the body text.

Values [1..10] indicates that the paragraph belongs to the corresponding outline level.

optional

Return type:

int | None

property owner: Any

Owner of this component.

Return type:

Any

property page_desc_name: str | None

If this property is set, it creates a page break before the paragraph it belongs to and assigns the value as the name of the new page style sheet to use.

optional

Return type:

str | None

property page_number_offset: int | None

Gets/Sets if a page break property is set at a paragraph, this property contains the new value for the page number.

optional

Return type:

int | None

property page_style_name: str | None

Gets the name of the current page style.

optional

Return type:

str | None

property para_adjust: ParagraphAdjust

Gets/Sets the adjustment of a paragraph.

Returns:

Paragraph adjustment.

Return type:

ParagraphAdjust

Hint

  • ParagraphAdjust can be imported from ooo.dyn.style.paragraph_adjust

property para_back_color: Color | None

Gets/Sets the paragraph background color.

optional

Returns:

Color or None if not supported.

Return type:

Color | None

property para_back_graphic: XGraphic | None

Gets/Sets the graphic for the background of a paragraph.

optional

Return type:

XGraphic | None

property para_back_graphic_filter: str | None

Gets/Sets the name of the graphic filter for the background graphic of a paragraph.

optional

Return type:

str | None

property para_back_graphic_location: GraphicLocation | None

Gets/Sets the value for the position of a background graphic.

optional

Returns:

Returns GraphicLocation or None if not supported.

Return type:

GraphicLocation | None

Hint

  • GraphicLocation can be imported from ooo.dyn.style.graphic_location

property para_back_graphic_url: str | None

Gets/Sets the value of a link for the background graphic of a paragraph.

Note the new behavior since it this was deprecated: This property can only be set and only external URLs are supported (no more vnd.sun.star.GraphicObject scheme). When an URL is set, then it will load the graphic and set the ParaBackGraphic property.

optional

Return type:

str | None

property para_back_transparent: bool | None

Gets/Sets if the paragraph background color is set to transparent.

This value is True if the paragraph background color is set to transparent.

optional

Return type:

bool | None

property para_bottom_margin: UnitMM100

Gets/Sets the bottom margin of the paragraph in 100th mm.

The distance between two paragraphs is specified by:

The greater one is chosen.

This property accepts int and UnitT types when setting.

Return type:

UnitMM100

property para_context_margin: bool | None

Gets/Sets if contextual spacing is used.

If True, the top and bottom margins of the paragraph should not be applied when the previous and next paragraphs have the same style.

optional

Return type:

bool | None

property para_expand_single_word: bool | None

Gets/Sets if single words are stretched.

It is only valid if para_adjust and para_last_line_adjust are also valid.

optional

Return type:

bool | None

property para_first_line_indent: int | None

Gets/Sets the indent for the first line.

optional

Return type:

int | None

property para_hyphenation_max_hyphens: int | None

Gets/Sets the maximum number of consecutive hyphens.

optional

Return type:

int | None

property para_hyphenation_max_leading_chars: int | None

Gets/Sets the minimum number of characters to remain before the hyphen character (when hyphenation is applied).

Note

Confusingly it is named Max but specifies a minimum.

optional

Return type:

int | None

property para_hyphenation_max_trailing_chars: int | None

Gets/Sets the minimum number of characters to remain after the hyphen character (when hyphenation is applied).

optional

Note

Confusingly it is named Max but specifies a minimum.

Return type:

int | None

property para_hyphenation_min_word_length: int | None

Gets/Sets the minimum word length in characters, when hyphenation is applied.

since

LibreOffice 7.4

optional

Return type:

int | None

property para_hyphenation_no_caps: bool | None

Specifies whether words written in CAPS will be hyphenated.

Setting to true will disable hyphenation of words written in CAPS for this paragraph.

optional

Return type:

bool | None

property para_hyphenation_no_last_word: bool | None

Specifies whether last word of paragraph will be hyphenated.

Setting to true will disable hyphenation of last word for this paragraph.

since

LibreOffice 7.4

optional

Return type:

bool | None

property para_hyphenation_zone: int | None

Gets/Sets the hyphenation zone, i.e. allowed extra white space in the line before applying hyphenation.

since

LibreOffice 7.4

optional

Return type:

int | None

property para_interop_grab_bag: Tuple[PropertyValue, ...] | None

Gets/Sets grab bag of paragraph properties, used as a string-any map for interim interop purposes.

This property is intentionally not handled by the ODF filter. Any member that should be handled there should be first moved out from this grab bag to a separate property.

optional:

Return type:

Tuple[PropertyValue, …] | None

property para_is_auto_first_line_indent: bool | None

Gets/Sets if the first line should be indented automatically.

optional

Return type:

bool | None

property para_is_connect_border: bool | None

Gets/Sets if borders set at a paragraph are merged with the next paragraph.

Borders are only merged if they are identical.

optional

Return type:

bool | None

property para_is_hyphenation: bool

Gets/Sets if automatic hyphenation is applied.

Return type:

bool

property para_is_numbering_restart: bool | None

Gets/Sets if the numbering rules restart, counting at the current paragraph.

optional

Return type:

bool | None

property para_keep_together: bool | None

Gets/Sets if page or column breaks between this and the following paragraph are prevented.

Setting this property to True prevents page or column breaks between this and the following paragraph.

This feature is useful for preventing title paragraphs to be the last line on a page or column.

optional

Return type:

bool | None

property para_last_line_adjust: int

Gets/Sets the adjustment of the last line.

It is only valid if para_adjust is set to block.

Return type:

int

property para_left_margin: UnitMM100

Gets/Sets the left margin of the paragraph in 1/100th mm` units.

This property accepts int and UnitT types when setting.

Return type:

UnitMM100

property para_line_number_count: bool | None

Gets/Sets if the paragraph is included in the line numbering.

optional

Return type:

bool | None

property para_line_number_start_value: int | None

Gets/Sets the start value for the line numbering.

optional

Return type:

int | None

property para_line_spacing: LineSpacingStructComp | None

Gets/Sets the type of the line spacing of a paragraph.

Setting value can be done with a LineSpacing or LineSpacingStructComp object.

optional

Returns:

Returns BorderLine2 or None if not supported.

Return type:

LineSpacingStructComp | None

Hint

  • LineSpacing can be imported from ooo.dyn.style.line_spacing

property para_orphans: int | None

Gets/Sets the minimum number of lines of the paragraph that have to be at bottom of a page if the paragraph is spread over more than one page.

optional

Return type:

int | None

property para_register_mode_active: bool | None

Gets/Sets if the register mode is applied to a paragraph.

Note

Register mode is only used if the register mode property of the page style is switched on.

optional

Return type:

bool | None

property para_right_margin: UnitMM100

Gets/Sets the right margin of the paragraph in 100th mm units.

This property accepts float and UnitT types when setting.

Return type:

UnitMM100

property para_shadow_format: ShadowFormat | None

Gets/Sets the type, color, and size of the shadow.

optional

Return type:

ShadowFormat | None

property para_split: bool | None

Gets/Sets - Setting this property to False prevents the paragraph from getting split into two pages or columns.

optional

Return type:

bool | None

property para_style_name: str | None

Gets/Sets the name of the current paragraph style.

optional

Return type:

str | None

property para_tab_stops: Tuple[TabStop, ...] | None

Gets/Sets the positions and kinds of the tab stops within this paragraph.

optional:

Return type:

Tuple[TabStop, …] | None

property para_top_margin: UnitMM100

determines the top margin of the paragraph in 100th mm units.

The distance between two paragraphs is specified by:

The greater one is chosen.

This property accepts float and UnitT types when setting.

Return type:

UnitMM100

property para_user_defined_attributes: NameContainerComp | None

Gets/Sets - this property stores xml attributes.

They will be saved to and restored from automatic styles inside xml files.

Can be set with XNameContainer or NameContainerComp.

optional

Return type:

NameContainerComp | None

property para_vert_alignment: ParagraphVertAlignEnum | None

Gets/Set the vertical alignment of a paragraph.

When setting the value, it can be either an integer or an instance of ParagraphVertAlignEnum.

optional

Return type:

ParagraphVertAlignEnum | None

property para_widows: int | None

Gets/Sets the minimum number of lines of the paragraph that have to be at top of a page if the paragraph is spread over more than one page.

optional

Return type:

int | None

property parent: WriteTableCellRange | None

Parent of this table cell range.

Return type:

WriteTableCellRange | None

property range_obj: RangeObj

Range Object that represents this cell range.

Note

The RangeObj returned from this property is a sub-range of the parent range or Table. This means the RangeObj contains relative values to the parent range or table. For this reason the cell names and indexes do not match up with the parent range. If a sub-ranges is A3:D6 then sub_rng[(0,0)] is at column 0, row 0 of the sub-range but has a cell name of A3. The RangeObj will always start with A1 (column 0 and row 0).

Return type:

RangeObj

property right_border: BorderLine2StructComp | None

Gets/Sets the right border of the object.

Setting value can be done with a BorderLine2 or BorderLine2StructComp object.

optional

Returns:

Returns BorderLine2 or None if not supported.

Return type:

BorderLine2StructComp | None

Hint

  • BorderLine2 can be imported from ooo.dyn.table.border_line2

property right_border_distance: UnitMM100 | None

Gets/Sets the distance from the right border to the object.

When setting the value, it can be either an float or an instance of UnitT.

optional

Return type:

UnitMM100 | None

property ruby_adjust: int | None

Gets/Sets - This optional property determines the adjustment of the ruby .

optional

Return type:

int | None

property ruby_char_style_name: str | None

Gets/Sets - This optional property contains the name of the character style that is applied to RubyText.

optional

Return type:

str | None

property ruby_is_above: bool | None

Gets/Sets - This optional property determines whether the ruby text is printed above/left or below/right of the text.

This property is replaced by RubyPosition.

optional

Return type:

bool | None

property ruby_position: RubyPositionEnum | None

Gets/Sets - This optional property determines the position of the ruby .

optional

Returns:

Returns RubyPositionEnum or None if not supported.

Return type:

RubyPositionEnum | None

Hint

  • RubyPositionEnum can be imported from ooo.dyn.text.ruby_position

property ruby_text: str | None

Gets/Sets - This optional property contains the text that is set as ruby.

optional

Return type:

str | None

property text_user_defined_attributes: NameContainerComp | None

Gets/Sets - This property stores XML attributes.

They will be saved to and restored from automatic styles inside XML files.

When setting the value, it can be a NameContainerComp or a XNameContainer instance.

optional

Return type:

NameContainerComp | None

property top_border: BorderLine2StructComp | None

Gets/Sets the top border of the object.

Setting value can be done with a BorderLine2 or BorderLine2StructComp object.

optional

Returns:

Returns BorderLine2 or None if not supported.

Return type:

BorderLine2StructComp | None

Hint

  • BorderLine2 can be imported from ooo.dyn.table.border_line2

property top_border_distance: UnitMM100 | None

Gets/Sets the distance from the top border to the object.

When setting the value, it can be either an float or an instance of UnitT.

optional

Return type:

UnitMM100 | None

property unvisited_char_style_name: str | None

Gets/Sets - This optional property contains the character style name for unvisited hyperlinks.

optional

Return type:

str | None

property visited_char_style_name: str | None

Gets/Sets - This optional property contains the character style name for visited hyperlinks.

optional

Return type:

str | None

property write_doc: WriteDoc

Write Document.

Return type:

WriteDoc

property write_table: WriteTable[Any]

Write Document.

Return type:

WriteTable[Any]