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.weghorn@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.weghorn@posteo.de>
diff --git a/vcl/unx/gtk4/a11y.cxx b/vcl/unx/gtk4/a11y.cxx
index 96570b0..c4cd20d 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);
}
}
/**