From ddbc111555607e62b94b74aacadd6a964b9fe4a5 Mon Sep 17 00:00:00 2001 From: Michael Weghorn Date: Mon, 19 Jul 2021 17:13:04 +0200 Subject: qt5 a11y: Set proper a11y states Set the states actually set in the 'XAccessibleStateSet', rather than setting states 0 to n-1, with n being the number of states present in the state set. With this commit in place, Accerciser now e.g. initially correctly shows the 'checked' attribute for checkboxes only if they are actually checked. (Better handling of updating states still needs to be implemented separately.) Change-Id: Idbc84f5754eae65cee471834c322b8ddfdb0bb29 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119223 Tested-by: Jenkins Reviewed-by: Michael Weghorn --- vcl/qt5/Qt5AccessibleWidget.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vcl/qt5/Qt5AccessibleWidget.cxx b/vcl/qt5/Qt5AccessibleWidget.cxx index 8b2b16727283..590c328e3098 100644 --- a/vcl/qt5/Qt5AccessibleWidget.cxx +++ b/vcl/qt5/Qt5AccessibleWidget.cxx @@ -654,9 +654,9 @@ QAccessible::State Qt5AccessibleWidget::state() const Sequence aStates = xStateSet->getStates(); - for (sal_Int32 n = 0; n < aStates.getLength(); n++) + for (const sal_Int16 nState : aStates) { - lcl_addState(&state, n); + lcl_addState(&state, nState); } return state; -- cgit v1.2.3