ooodev.adapter.text.simple_text_partial module

class ooodev.adapter.text.simple_text_partial.SimpleTextPartial(component, interface=com.sun.star.text.XSimpleText)[source]

Bases: TextRangePartial

Partial class for XSimpleText.

Parameters:
  • component (XSimpleText) –

  • interface (UnoInterface | None) –

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

Constructor

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

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

Return type:

None

create_text_cursor()[source]

Creates a new text cursor.

Returns:

The new text cursor.

Return type:

XTextCursor

create_text_cursor_by_range(text_position)[source]

The initial position is set to text_position.

Parameters:

text_position (XTextRange) – The initial position of the new text cursor.

Returns:

The new text cursor.

Return type:

XTextCursor

insert_control_character(rng, control_character, absorb)[source]

Inserts a control character (like a paragraph break or a hard space) into the text.

Parameters:
  • rng (XTextRange) – The position of the new control character.

  • control_character (ControlCharacterEnum) – The control character to be inserted.

  • absorb (bool) – If TRUE the text range will contain the new inserted control character, otherwise the range (and it’s text) will remain unchanged.

Raises:

IllegalArgumentExceptioncom.sun.star.lang.IllegalArgumentException

Return type:

None

insert_string(rng, text, absorb)[source]

Inserts a string of characters into the text.

The string may contain the following white spaces:

If the parameter bAbsorb() was TRUE the text range will contain the new inserted string, otherwise the range (and it’s text) will remain unchanged.

Return type:

None

Parameters:
  • rng (XTextRange) –

  • text (str) –

  • absorb (bool) –