What is the base for cursor x position in basic?

The x component of the cursor position does not behave as expected.

sub test
dim ovc, ov
ovc= thisComponent.CurrentController.getViewCursor()
ov = ovc.getPosition()                      'cursor position from top left of text
print ov.x                                  'position from left
end sub

When the cursor is at the left margin (irrespective of the actual value of the page margin) the result is always showing 6318. Thereafter the result increases in 1/100s of mm. The y component (ov.y) is in 1/100s of mm from the top of the page.
Is there some logic here that I am not understanding?

In fact that number 6318 is not consistent. Behaviour seems unpredictable.
(Ubuntu 20.04; LO 7.2.4.1)

I would suppose a bug. The correct position coordinates seem to depend on the existence of a character left / infrontof the actual position. Insert a zero-width-space (U+200B) at Text.Start and see…

I think this is a property whose behavior is not described. Its value changes depending on the elements displayed on the screen (sidebar hide/show, vertical ruler…)

The result seems to represent the distance to the left edge of the window, when there is space between that and the left side of the paper. When there is no such space, it is correctly measured to the left margin. This cannot be what is intended, and therefore I would certainly call it a bug.

the cursor’s coordinates relative to the top left position of the first page of the document

Yes. You found it yourself. But the actually returned values can differ in a not clearly reproducible way. That’s the reason for what I called the experienced behaviour a bug.

Now reported as bug 146361.