ooodev.adapter.text.word_cursor_partial module
- class ooodev.adapter.text.word_cursor_partial.WordCursorPartial(component, interface=com.sun.star.text.XWordCursor)[source]
Bases:
object
Partial 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.XWordCursor
interface.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:
True
if the cursor is moved,False
otherwise.- 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:
True
if the cursor is moved,False
otherwise.- Return type:
bool
Note
The function returning
True
does 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:
True
if the cursor is moved,False
otherwise.- Return type:
bool
Note
The function returning
True
does 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.