ooodev.adapter.text.text_view_cursor_partial module
- class ooodev.adapter.text.text_view_cursor_partial.TextViewCursorPartial(component, interface=com.sun.star.text.XTextViewCursor)[source]
Bases:
TextCursorPartial
Partial class for XTextViewCursor.
- Parameters:
component (XTextViewCursor) –
interface (UnoInterface | None) –
- __init__(component, interface=com.sun.star.text.XTextViewCursor)[source]
Constructor
- Parameters:
component (XTextViewCursor) – UNO Component that implements
com.sun.star.text.XTextViewCursor
interface.interface (UnoInterface, optional) – The interface to be validated. Defaults to
XTextViewCursor
.
- Return type:
None
- get_position()[source]
Gets the cursor’s coordinates relative to the top left position of the first page of the document in
1/100 mm
.- Returns:
The cursor’s coordinates as
com.sun.star.awt.Point
. in1/100 mm
.- Return type:
Note
The
X
coordinate is the horizontal position, theY
coordinate is the vertical position.Warning
The
X
is relative to the document window and not the document page. This means when the document window size changes theX
coordinate will change even if the cursor has not moved. This is also the case if the document zoom changes.When the document page is zoomed all the way to fill the document window the
X
coordinate is0
when at the left hand page margin (beginning of a line).The
Y
coordinate is relative to the top of the document window and not the top of the document page. TheY
coordinate seems not to be affected by Document Zoom or scroll position.