ooodev.adapter.text.word_cursor_partial module
- class ooodev.adapter.text.word_cursor_partial.WordCursorPartial(component, interface=com.sun.star.text.XWordCursor)[source]
Bases:
objectPartial class for XWordCursor.
- Parameters:
component (XWordCursor) –
interface (UnoInterface | None) –
- __init__(component, interface=com.sun.star.text.XWordCursor)[source]
Constructor
- Parameters:
component (XWordCursor) – UNO Component that implements
com.sun.star.text.XWordCursorinterface.interface (UnoInterface, optional) – The interface to be validated. Defaults to
XWordCursor.
- Return type:
None
- goto_end_of_word(expand=False)[source]
Moves the cursor to the end of the current word.
- Parameters:
expand (bool, optional) – If
True, the selection is expanded to the end of the word. Defaults toFalse.- Returns:
Trueif the cursor is moved,Falseotherwise.- Return type:
bool
- goto_next_word(expand=False)[source]
Moves the cursor to the next word.
- Parameters:
expand (bool, optional) – If
True, the selection is expanded to the end of the word. Defaults toFalse.- Returns:
Trueif the cursor is moved,Falseotherwise.- Return type:
bool
Note
The function returning
Truedoes not necessarily mean that the cursor is located at the next word, or any word at all! This may happen for example if it travels over empty paragraphs.
- goto_previous_word(expand=False)[source]
Moves the cursor to the previous word.
- Parameters:
expand (bool, optional) – If
True, the selection is expanded to the start of the word. Defaults toFalse.- Returns:
Trueif the cursor is moved,Falseotherwise.- Return type:
bool
Note
The function returning
Truedoes not necessarily mean that the cursor is located at the previous word, or any word at all! This may happen for example if it travels over empty paragraphs.