I have a similar problem. I edit existing documents many pages long and I need to see a couple of paragraphs ahead. During editing I frequently end up at the bottom of the screen. I sort of solved mine with the following hack.
At regular intervals I insert a code to my document using a macro. When the macro fires to insert the code into the text, it runs the following code,
sub scrollViewUp()
Dim oDoc: oDoc = ThisComponent
Dim oVCurs, oTCurs
oVCurs = oDoc.currentController.getViewCursor()
'Save the position
oTCurs = oDoc.Text.createTextCursorByRange(oVCurs)
oVCurs.screenDown()
'In case VC off the screen
oVCurs.gotoRange(oTCurs,false)
'Make cursor visible
oDoc.currentcontroller.select(oVCurs)
end sub
The end result is that the current position of the cursor/view is shifted to the top of the window. This works only while there is text off screen below.
If the position is too high/low, you can use the following to adjust up or down,
'
' i takes accepts following values
' 0 - scrolls up 1 line
' 1 - scrolls down 1 line
' 2 - scrolls up a screen full
' 3 - scrolls down a screen full
'
sub doscrollEvent(i)
dim found as boolean
found = false
dim comp,compchild
comp = thiscomponent.currentcontroller.frame.getcomponentwindow
compchild = comp.getAccessibleContext.getAccessibleChild(0)
on error resume next
dim j
for j = 0 to compchild.getAccessibleContext.getAccessibleChildcount -1
with compchild.getAccessibleContext.getAccessibleChild(j)
if .getAccessibleContext.getAccessibleName = "Vertical scroll bar" then found = true
if found then
.getAccessibleContext.doAccessibleAction(i)
exit for
end if
end with
next
end sub
I am currently looking to use an event listener to have this run automatically even if I dont run my macro but I havenāt figured that part yetā¦ Iāll update when/if I do.
HTH