diff options
author | Michael Weghorn <m.weghorn@posteo.de> | 2023-11-14 10:18:37 +0100 |
---|---|---|
committer | Michael Weghorn <m.weghorn@posteo.de> | 2023-11-15 10:10:07 +0100 |
commit | c2165ec33c5549dcc494ad9197727e096678fc3c (patch) | |
tree | bfad1cef5635603b8ec6c93fad114afa207931d2 /sc | |
parent | 015e7d51b671a9dbf110599855d99a57fda2ae59 (diff) |
tdf#158030 sc a11y: Report cell coords via {row,col}indextext obj attr
Expose the end-user consumable coordinates of a Calc
cell via "rowindextext" and "colindextext" object
attributes. These are specified in the ARIA specification
and the Accessibility Core API Mappings spec suggests to
map them to attributes of the same name for all of AT-SPI2,
IAccessible2 and UIA [1] [2], so no extra mapping is needed
in the platform-specific a11y bridges for now.
Orca git master already contains a commit to
make use of these attributes [3]:
commit 3c056cd7b58aa2cb1b3342c87d052704ef32fa24
Author: Joanmarie Diggs <jdiggs@igalia.com>
Date: Mon Nov 13 18:19:12 2023 +0100
Look for the rowindextext and colindextext attributes in soffice
We were looking for these attributes only in the web script because
they are ARIA properties. Ultimately we will do this check globally.
In the meantime, if LO Calc exposes these attributes, we can remove
a hack or two. Therefore add support now so that they can prototype.
The attributes are exposed to IAccessible2 and AT-SPI when using
the gtk3 VCL plugin right away.
For qt6, this works with pending Qt changes suggesting to
add support for object attributes [4] [5] and the
corresponding LO change to implement the new interface [6]
(currently via the `CustomAttributes` attribute, might make
sense to introduce separate ones, but that's something to
look into once the pending Qt changes to add a mechanism
have been reviewed).
[1] https://www.w3.org/TR/core-aam-1.2/#ariaRowIndexText
[2] https://www.w3.org/TR/core-aam-1.2/#ariaColIndexText
[3] https://gitlab.gnome.org/GNOME/orca/-/commit/3c056cd7b58aa2cb1b3342c87d052704ef32fa24
[4] https://codereview.qt-project.org/c/qt/qtbase/+/517525
[5] https://codereview.qt-project.org/c/qt/qtbase/+/517526
[6] https://gerrit.libreoffice.org/c/core/+/159309
Change-Id: Ib675abafa2028d986b31d64ea7f5a38b1d54fc11
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159411
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/Accessibility/AccessibleCell.cxx | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/sc/source/ui/Accessibility/AccessibleCell.cxx b/sc/source/ui/Accessibility/AccessibleCell.cxx index 27ac67611585..3ac2fdba307f 100644 --- a/sc/source/ui/Accessibility/AccessibleCell.cxx +++ b/sc/source/ui/Accessibility/AccessibleCell.cxx @@ -495,7 +495,14 @@ uno::Any SAL_CALL ScAccessibleCell::getExtendedAttributes() { SolarMutexGuard aGuard; - uno::Any strRet; + // report row and column index text via attributes as specified in ARIA which map + // to attributes of the same name for AT-SPI2, IAccessible2, UIA + // https://www.w3.org/TR/core-aam-1.2/#ariaRowIndexText + // https://www.w3.org/TR/core-aam-1.2/#ariaColIndexText + const OUString sRowIndexText = maCellAddress.Format(ScRefFlags::ROW_VALID); + const OUString sColIndexText = maCellAddress.Format(ScRefFlags::COL_VALID); + OUString sAttributes = "rowindextext:" + sRowIndexText + ";colindextext:" + sColIndexText + ";"; + if (mpViewShell) { OUString strFor = mpViewShell->GetFormula(maCellAddress) ; @@ -519,9 +526,10 @@ uno::Any SAL_CALL ScAccessibleCell::getExtendedAttributes() strFor += "false"; strFor += ";"; } - strRet <<= strFor ; + sAttributes += strFor ; } - return strRet; + + return uno::Any(sAttributes); } // cell has its own ParaIndent property, so when calling character attributes on cell, the ParaIndent should replace the ParaLeftMargin if its value is not zero. |