Writer: scroll entire pages in a readonly document with API (C++)

How can I scroll entire pages, regardless of current zoom setting, in writer via C++?

The document is readonly, so XPageCursor->jumpToPreviousPage() does seem to do nothing.
This also only would set the cursor, if I scroll in smaller increments then this would not move the cursor.

Toggling readonly before and after moving the cursor with .uno:EditDoc works in theory, but causes flickering. Cursor position is also not updated when doing .uno:GoUp or .uno:GoDown in readonly.

You can use the command dispatch framework, then .uno:PageUp can jump pages up/down, exactly as if you would hit the page up / page down keys. Hopefully that does what you need.

(You can use the macro recorder to find out exact uno command names / parameters, then the generated basic code can be re-written in C++, since it uses the same UNO API.)

Unfortunately, .uno:PageUp only scrolls roughly in screen sizes, not page sizes. This is more apparent at higher or low zoom levels

Hi

You can also try .uno:GoToStartOfPrevPage but I think the read only opening mode also blocks the functionning.

Sub PysJumpNext

Dim oCurseurVisible as object

oCurseurVisible = ThisComponent.CurrentController.ViewCursor
oCurseurVisible.jumpToNextPage

End Sub    

sub PysJumpPrevious

dim document   as object
dim dispatcher as object

document   = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
dispatcher.executeDispatch(document, ".uno:GoToStartOfPrevPage", "", 0, Array())

end sub 

Regards

Sadly doesn’t work in readonly mode. Also shows the next page in the middle of the screen instead of on top (but tbh that was not something I actually asked for)

Since 4.4 the commands seem to be uno:ScrollToPrevious and .uno:ScrollToNext - this works almost perfectly (it is at least as buggy as when using the navigator).