redlines for pyuno
Miklos Vajna
vmiklos at suse.cz
Wed Aug 7 12:23:13 PDT 2013
On Wed, Aug 07, 2013 at 12:33:35PM -0500, James Michael DuPont <jmdpplks at gmail.com> wrote:
> I am feeling stupid here, so please excuse my ignorance, but I did not find
> any api to tell me if the current cursor is in a redline, can you please
> point me in the right direction? I just found an api to give me the list of
> redlines and have been checking the cursor to see if it is in one of them.
As far as I know, that's not directly possible. Here is how I would do
the API for it:
- see
http://opengrok.libreoffice.org/xref/core/sw/source/ui/uiview/view2.cxx#639
on how to check if an SwPosition (that's the internal equivalent of a
position in the document model) is inside a redline using
SwDoc::GetRedline()
- it's already possible to check if the cursor is e.g. at the end of
line:
http://api.libreoffice.org/docs/common/ref/com/sun/star/view/XLineCursor.html#isAtEndOfLine
The implementation of that is in the SwXTextViewCursor class:
http://opengrok.libreoffice.org/xref/core/sw/source/ui/uno/unotxvw.cxx#1649
From that, you could add a new isInRedline() method to the cursor, which
would return exactly what you need.
HTH,
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/20130807/c485cf77/attachment.pgp>
More information about the LibreOffice
mailing list