diff options
author | Michael Weghorn <m.weghorn@posteo.de> | 2023-03-17 12:37:15 +0100 |
---|---|---|
committer | Michael Weghorn <m.weghorn@posteo.de> | 2023-03-20 21:21:30 +0000 |
commit | 4a93739e619fd4f4ec369932e923554d71297900 (patch) | |
tree | 963ac7eca47c65b15b3203d5d4ddf4addfe55e8c /sw/inc | |
parent | 92b732ce29f734d91fb6c9350b9a8b6df7f9293e (diff) |
tdf#136760 sw a11y: Provide page-relative cursor pos via doc attr
This introduce 2 new extended accessible attributes
"cursor-position-in-page-horizontal" and
"cursor-position-in-page-vertical" to expose
the page-relative position of the cursor in Writer
to assistive technology.
This is similar to how the current page
number is already exposed (attribute "page-number").
Together with a corresponding pull request for the NVDA
screen reader [1], this allows NVDA to announce the position
similar to how it is done for Microsoft Word (where the information
is not retrieved via the accessibility APIs but the
MS Office COM API, s. discussion
in the corresponding NVDA issue [2] for more details).
(Side note: Currently there is no a11y object for a Writer
page in the a11y tree, but "normal" paragraphs are direct
children of the document object.)
For performance reasons, introduce a new method
`SwCursorShell::GetCursorPagePos` to get the position
instead of passing the result from
`SwCursorShell::GetCursorDocPos` to
`SwFEShell::GetRelativePagePosition` to avoid
iterating over the doc pages.
[1] https://github.com/nvaccess/nvda/pull/14727
[2] https://github.com/nvaccess/nvda/issues/11696
Change-Id: I6fd56c5c7d051840bab836ce5fe525fdc061b376
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149051
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Diffstat (limited to 'sw/inc')
-rw-r--r-- | sw/inc/crsrsh.hxx | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sw/inc/crsrsh.hxx b/sw/inc/crsrsh.hxx index 8eac979b5617..ddb7b301beef 100644 --- a/sw/inc/crsrsh.hxx +++ b/sw/inc/crsrsh.hxx @@ -598,6 +598,8 @@ public: bool IsCursorInFootnote() const; inline Point& GetCursorDocPos() const; + // get cursor position relative to the page it is in + Point GetCursorPagePos() const; inline bool IsCursorPtAtEnd() const; inline const SwPaM* GetTableCrs() const; |