Bug 118418 - Scrolling API?
Ilmari Lauhakangas
ilmari.lauhakangas at libreoffice.org
Mon Feb 17 16:32:09 UTC 2020
Martin Pieuchot kirjoitti 17.2.2020 klo 18.21:
> On 22/01/20(Wed) 17:38, Caolán McNamara wrote:
>> On Mon, 2019-12-16 at 13:10 +0100, Martin Pieuchot wrote:
>>> I'm looking for help/explanation about the coordinate system and
>>> scrolling API to use in `SwAccessibleParagraph'.
>>>
>>> I'm currently working on bug #118418 [1], trying to implement
>>> scrollSubstringTo() and scrollSubstringToPoint() like I did for
>>> gtk [2] and evince [3].
>>>
>>> The diff below clearly shows that I don't know how to translate a
>>> character index to coordinates that can be feed to Window's Scroll().
>>>
>>> So here are my questions:
>>>
>>> - Is calling getWindow()'s Scroll() the correct way to realize the
>>> scrolling. If so, the code below doesn't correctly refresh all the
>>> text, so what am I missing?
>>>
>>> - What API should I use to convert the coordinates?
>>
>> I don't know for sure the correct answer, but I feel that for writer
>> ScrollMDI might be your friend here and that the code should look
>> something like the attached SwAccessibleParagraph::scrollToPosition
>> demo. I haven't tested or checked further if its the right approach but
>> maybe that helps.
>
> It helped, thanks a lot !
>
> Diff below implements scrollSubstringTo()'s SCROLL_ANYWHERE. I'm
> interested in comments and/or suggestions.
Please submit this to gerrit, so people can review it by the usual
procedure. Thanks.
Ilmari
More information about the LibreOffice
mailing list