vcl/qt5/QtAccessibleWidget.cxx | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-)
New commits: commit 94d851b27f26ad9a97c5a8a559592d6d9ea0f37b Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Fri Jan 17 14:31:31 2025 +0100 Commit: Michael Weghorn <m.wegh...@posteo.de> CommitDate: Fri Jan 17 22:28:19 2025 +0100 Revert "tdf#163335 qt a11y: Work around broken sw selection handling" The underlying issue in Writer was fixed in commit 65a5a4772af919e71a1fe7a752e622ec4cdba7ad Author: Michael Weghorn <m.wegh...@posteo.de> Date: Tue Jan 14 12:11:46 2025 +0100 tdf#163335 sw a11y: Handle cursor selection consistently , so revert the temporary workaround in the qt a11y bridge again (on master only, workaround remains in place for release branches). This reverts commit 3eaa35e8bacc19a85f5c9d907450846bfa8bffae. Change-Id: Ib53aa2d16e0302c4ccd7ba8ac38e9ebb7cf186e6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180410 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.wegh...@posteo.de> diff --git a/vcl/qt5/QtAccessibleWidget.cxx b/vcl/qt5/QtAccessibleWidget.cxx index f7f55f74f82d..7438c5e368d1 100644 --- a/vcl/qt5/QtAccessibleWidget.cxx +++ b/vcl/qt5/QtAccessibleWidget.cxx @@ -51,7 +51,6 @@ #include <com/sun/star/accessibility/XAccessibleValue.hpp> #include <com/sun/star/beans/PropertyValue.hpp> #include <com/sun/star/lang/DisposedException.hpp> -#include <com/sun/star/lang/IndexOutOfBoundsException.hpp> #include <com/sun/star/uno/Sequence.hxx> #include <comphelper/AccessibleImplementationHelper.hxx> @@ -1859,22 +1858,11 @@ QAccessibleInterface* QtAccessibleWidget::selectedItem(int nSelectionIndex) cons return nullptr; } - try - { - Reference<XAccessible> xChild = xSelection->getSelectedAccessibleChild(nSelectionIndex); - if (xChild) - return QAccessible::queryAccessibleInterface(QtAccessibleRegistry::getQObject(xChild)); - } - catch (const css::lang::IndexOutOfBoundsException&) - { - // tdf#163335: temporarily work around inconsistency in - // SwAccessibleSelectionHelper::getSelectedAccessibleChildCount - // returning a larger number of selected items than - // SwAccessibleSelectionHelper::getSelectedAccessibleChild supports - SAL_WARN("vcl.qt", "QtAccessibleWidget::selectedItem triggered an exception"); - } + Reference<XAccessible> xChild = xSelection->getSelectedAccessibleChild(nSelectionIndex); + if (!xChild) + return nullptr; - return nullptr; + return QAccessible::queryAccessibleInterface(QtAccessibleRegistry::getQObject(xChild)); } bool QtAccessibleWidget::isSelected(QAccessibleInterface* pItem) const