From 8383c3b1126d5e22b343bb9ef7b43cf6a19c56f2 Mon Sep 17 00:00:00 2001 From: Michael Weghorn Date: Thu, 16 Nov 2023 17:42:16 +0100 Subject: gtk4 a11y: Map BLOCK_QUOTE role to new gtk equivalent Map the role to the `GTK_ACCESSIBLE_ROLE_BLOCK_QUOTE` equivalent newly added to Gtk 4 in commit [1]: commit bbb0150383e6aabdbead635f1751322530392b3a Author: Michael Weghorn a11y: Add block quote role With this and the gtk commit in place, Accerciser shows the block quote role for Writer paragraphs using the "Block Quotation" paragraph style as expected. Also needs a bump of the gtk version to >= 4.13.4 on the gtk "main" branch after the 4.13.3 release for the `GTK_CHECK_VERSION` check to pass and actually make use of the new role, see MR [2]. Omit the fallback to `GTK_ACCESSIBLE_ROLE_PARAGRAPH` for Gtk versions >= 4.13.1 but < 4.13.4, since they are all development versions for the same stable release 4.14. [1] https://gitlab.gnome.org/GNOME/gtk/-/commit/bbb0150383e6aabdbead635f1751322530392b3a [2] https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/6574 Change-Id: I2c17da13867a61f0e6819913583392962cfd44a2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158685 Reviewed-by: Michael Weghorn Tested-by: Jenkins --- vcl/unx/gtk4/a11y.cxx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'vcl/unx') diff --git a/vcl/unx/gtk4/a11y.cxx b/vcl/unx/gtk4/a11y.cxx index c4cd20d66aa2..c8103471b085 100644 --- a/vcl/unx/gtk4/a11y.cxx +++ b/vcl/unx/gtk4/a11y.cxx @@ -54,6 +54,13 @@ map_accessible_role(const css::uno::Reference& case css::accessibility::AccessibleRole::NOTIFICATION: eRole = GTK_ACCESSIBLE_ROLE_ALERT; break; + case css::accessibility::AccessibleRole::BLOCK_QUOTE: +#if GTK_CHECK_VERSION(4, 13, 4) + eRole = GTK_ACCESSIBLE_ROLE_BLOCK_QUOTE; +#else + eRole = GTK_ACCESSIBLE_ROLE_GROUP; +#endif + break; case css::accessibility::AccessibleRole::CAPTION: eRole = GTK_ACCESSIBLE_ROLE_CAPTION; break; @@ -140,7 +147,6 @@ map_accessible_role(const css::uno::Reference& eRole = GTK_ACCESSIBLE_ROLE_WIDGET; break; case css::accessibility::AccessibleRole::PARAGRAPH: - case css::accessibility::AccessibleRole::BLOCK_QUOTE: #if GTK_CHECK_VERSION(4, 13, 1) eRole = GTK_ACCESSIBLE_ROLE_PARAGRAPH; #else -- cgit