How to know the current viewed page and line in writer

Miklos Vajna vmiklos at suse.cz
Wed Jul 17 00:18:25 PDT 2013


Hi,

On Tue, Jul 16, 2013 at 07:59:43PM +0300, Ptyl Dragon <ptyl at cloudon.com> wrote:
> 1. Which line the writer GUI is currently showing (which may be different
> from the line the caret / cursor is on - such as when scrolling, for
> example)

The GUI is typically showing an area of the document, which is more a
rectangle than a given set of lines. You can use
document::XViewDataSupplier to read/write that data:

http://api.libreoffice.org/docs/common/ref/com/sun/star/document/XViewDataSupplier.html

> 2. How many lines there are in total, in the writer document

Isn't that available as part of the document stats?

> Additionally, as a fallback, we would like to simply to know which page
> writer is showing, and how many pages there are in total.

See

http://opengrok.libreoffice.org/xref/core/sw/qa/extras/inc/swmodeltestbase.hxx#getPages

on how to get the number of pages using UNO.

Miklos
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20130717/b8438c42/attachment.pgp>


More information about the LibreOffice mailing list