vcl/qt5/QtAccessibleWidget.cxx |    5 +++++
 1 file changed, 5 insertions(+)

New commits:
commit 66fa5aeec5dbeba978f70fe464fbc87c3aba8ed2
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Mon Nov 6 11:06:16 2023 +0100
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Tue Nov 7 07:57:58 2023 +0100

    qt a11y: Set passwordEdit state for PASSWORD_TEXT
    
    The Qt API doesn't have a separate role to distinguish password edits
    from other text edits, but has a `passwordEdit` state.
    
    Set that state for objects that have role
    `AccessibleRole::PASSWORD_TEXT`.
    
    With this in place, password entries,
    e.g. the one in the "Tools" -> "Options" -> "Security"
    -> "Password for Web Connections" -> "Master Password" dialog,
    are exposed via the `ATSPI_ROLE_PASSWORD_TEXT` role with the
    qt6 VCL plugin on Linux, because Qt's AT-SPI adapter takes
    the `passwordEdit` state into account when mapping the
    Qt a11y roles to AT-SPI ones. [1]
    
    [1] 
https://code.qt.io/cgit/qt/qtbase.git/tree/src/gui/accessible/linux/atspiadaptor.cpp?id=c5d9e4a7a78b82ed31e5225c169de4718dfe4f05#n1637
    
    Change-Id: Icb3f0935e703e2786c5704007cad7eea9070f8a5
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158987
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>

diff --git a/vcl/qt5/QtAccessibleWidget.cxx b/vcl/qt5/QtAccessibleWidget.cxx
index cba67bc60cc8..cbd750a4da38 100644
--- a/vcl/qt5/QtAccessibleWidget.cxx
+++ b/vcl/qt5/QtAccessibleWidget.cxx
@@ -465,6 +465,8 @@ QAccessible::Role QtAccessibleWidget::role() const
         case AccessibleRole::BLOCK_QUOTE:
             return QAccessible::Paragraph;
         case AccessibleRole::PASSWORD_TEXT:
+            // Qt API doesn't have a separate role to distinguish password 
edits,
+            // but a 'passwordEdit' state
             return QAccessible::EditableText;
         case AccessibleRole::POPUP_MENU:
             return QAccessible::PopupMenu;
@@ -687,6 +689,9 @@ QAccessible::State QtAccessibleWidget::state() const
             lcl_addState(&state, nState);
     }
 
+    if (xAc->getAccessibleRole() == AccessibleRole::PASSWORD_TEXT)
+        state.passwordEdit = true;
+
     return state;
 }
 

Reply via email to