vcl/unx/gtk4/a11y.cxx | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-)
New commits: commit df9e08cd765731451bf58b2d23590db7263d49fe Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Tue Nov 14 12:21:17 2023 +0100 Commit: Michael Weghorn <m.wegh...@posteo.de> CommitDate: Wed Nov 15 10:10:38 2023 +0100 tdf#158030 gtk4 a11y Map {col,row}indextext obj attributes Map the "colindextext" and "rowindextext" object attributes introduced for Calc cells in Change-Id Ib675abafa2028d986b31d64ea7f5a38b1d54fc11 Author: Michael Weghorn <m.wegh...@posteo.de> Date: Tue Nov 14 10:18:37 2023 +0100 tdf158030 sc a11y: Report cell coords via {row,col}indextext obj attr to the corresponding gtk a11y relations. Together with a suggested MR for gtk [1] to add the corresponding mapping to AT-SPI2 there, following the Core Accessibility API Mappings specification [2], this makes these available on the AT-SPI2 layer. Interacting with Calc cells e.g. in Accerciser currently doesn't really work though, because LibreOffice freezes due to the Gtk implemenation of "GetChildCount" currently trying to iterate over all children, s. Gtk issue [3]. (Tested by hard-coding dummy values for a Writer paragraph in `SwAccessibleParagraph::getExtendedAttributes` instead.) [1] https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/6563 [2] https://www.w3.org/TR/core-aam-1.2/ [3] https://gitlab.gnome.org/GNOME/gtk/-/issues/6204 Change-Id: Ie53cb3cba51f5020c5a90d33dc27f2b6cd581b92 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159412 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.wegh...@posteo.de> diff --git a/vcl/unx/gtk4/a11y.cxx b/vcl/unx/gtk4/a11y.cxx index 96570b01f3c5..c4cd20d66aa2 100644 --- a/vcl/unx/gtk4/a11y.cxx +++ b/vcl/unx/gtk4/a11y.cxx @@ -313,15 +313,25 @@ static void applyStates(GtkAccessible* pGtkAccessible, } static void applyObjectAttribute(GtkAccessible* pGtkAccessible, std::u16string_view rName, - std::u16string_view rValue) + const OUString& rValue) { assert(pGtkAccessible); - if (rName == u"level") + if (rName == u"colindextext") + { + gtk_accessible_update_relation(pGtkAccessible, GTK_ACCESSIBLE_RELATION_COL_INDEX_TEXT, + rValue.toUtf8().getStr(), -1); + } + else if (rName == u"level") { const int nLevel = o3tl::toInt32(rValue); gtk_accessible_update_property(pGtkAccessible, GTK_ACCESSIBLE_PROPERTY_LEVEL, nLevel, -1); } + else if (rName == u"rowindextext") + { + gtk_accessible_update_relation(pGtkAccessible, GTK_ACCESSIBLE_RELATION_ROW_INDEX_TEXT, + rValue.toUtf8().getStr(), -1); + } } /**