vcl/source/window/accessibility.cxx |   16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

New commits:
commit 36276f606cd99561dd8449f41ba846866e75affa
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Thu Dec 19 17:44:16 2024 +0100
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Thu Dec 19 19:49:40 2024 +0100

    vcl a11y: Drop idea about more roles for msg/alert/... dialogs
    
    I'm not aware of any platform a11y API that has different
    roles for alert dialogs vs. message dialogs, etc., so even
    if LO had different roles, they would be mapped to the same
    one in the a11y bridges again. Drop the idea.
    
    Change-Id: Ic0ccd3ffda806dff008442cc1107a7f64cdd1c11
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178832
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>
    Tested-by: Jenkins

diff --git a/vcl/source/window/accessibility.cxx 
b/vcl/source/window/accessibility.cxx
index 1252ecff2376..4c01650b5b58 100644
--- a/vcl/source/window/accessibility.cxx
+++ b/vcl/source/window/accessibility.cxx
@@ -229,7 +229,7 @@ sal_uInt16 Window::getDefaultAccessibleRole() const
     sal_uInt16 nRole = accessibility::AccessibleRole::UNKNOWN;
     switch (GetType())
     {
-        case WindowType::MESSBOX: // MT: Would be nice to have special roles!
+        case WindowType::MESSBOX:
         case WindowType::INFOBOX:
         case WindowType::WARNINGBOX:
         case WindowType::ERRORBOX:
commit ee3a207a033c42cb328b49845011bafb55ee37ee
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Thu Dec 19 17:36:03 2024 +0100
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Thu Dec 19 19:49:31 2024 +0100

    vcl a11y: Drop custom special value for a11y role
    
    Use accessibility::AccessibleRole::UNKNOWN instead
    of a custom integer value of 0xFFFF to indicate
    that no role has explicitly been assigned.
    
    Change-Id: Ia9525a3235c32757eeb748127e75b684139b993f
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178831
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>
    Tested-by: Jenkins

diff --git a/vcl/source/window/accessibility.cxx 
b/vcl/source/window/accessibility.cxx
index 8977a19ec61d..1252ecff2376 100644
--- a/vcl/source/window/accessibility.cxx
+++ b/vcl/source/window/accessibility.cxx
@@ -44,7 +44,7 @@ using namespace ::com::sun::star;
 
 ImplAccessibleInfos::ImplAccessibleInfos()
 {
-    nAccessibleRole = 0xFFFF;
+    nAccessibleRole = accessibility::AccessibleRole::UNKNOWN;
     pLabeledByWindow = nullptr;
     pLabelForWindow = nullptr;
 }
@@ -220,13 +220,13 @@ void Window::SetAccessibleRole( sal_uInt16 nRole )
     if ( !mpWindowImpl->mpAccessibleInfos )
         mpWindowImpl->mpAccessibleInfos.reset( new ImplAccessibleInfos );
 
-    SAL_WARN_IF( mpWindowImpl->mpAccessibleInfos->nAccessibleRole != 0xFFFF, 
"vcl", "AccessibleRole already set!" );
+    SAL_WARN_IF( mpWindowImpl->mpAccessibleInfos->nAccessibleRole != 
accessibility::AccessibleRole::UNKNOWN, "vcl", "AccessibleRole already set!" );
     mpWindowImpl->mpAccessibleInfos->nAccessibleRole = nRole;
 }
 
 sal_uInt16 Window::getDefaultAccessibleRole() const
 {
-    sal_uInt16 nRole = 0xFFFF;
+    sal_uInt16 nRole = accessibility::AccessibleRole::UNKNOWN;
     switch (GetType())
     {
         case WindowType::MESSBOX: // MT: Would be nice to have special roles!
@@ -413,8 +413,10 @@ sal_uInt16 Window::GetAccessibleRole() const
     if (!mpWindowImpl)
         return accessibility::AccessibleRole::UNKNOWN;
 
-    sal_uInt16 nRole = mpWindowImpl->mpAccessibleInfos ? 
mpWindowImpl->mpAccessibleInfos->nAccessibleRole : 0xFFFF;
-    if ( nRole == 0xFFFF )
+    sal_uInt16 nRole = mpWindowImpl->mpAccessibleInfos
+                           ? mpWindowImpl->mpAccessibleInfos->nAccessibleRole
+                           : accessibility::AccessibleRole::UNKNOWN;
+    if (nRole == accessibility::AccessibleRole::UNKNOWN)
         nRole = getDefaultAccessibleRole();
     return nRole;
 }
commit 1b0915bb001c38a0e77f3dbaaf8405e54f6680d1
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Thu Dec 19 17:26:30 2024 +0100
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Thu Dec 19 19:49:25 2024 +0100

    vcl a11y: Use AccessibleRole constant
    
    ... instead of hard-coded 0.
    
    Change-Id: Iea69998b8dd7df7d26758f38f3295557adbf9422
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178830
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>

diff --git a/vcl/source/window/accessibility.cxx 
b/vcl/source/window/accessibility.cxx
index 0015507f66f6..8977a19ec61d 100644
--- a/vcl/source/window/accessibility.cxx
+++ b/vcl/source/window/accessibility.cxx
@@ -411,7 +411,7 @@ sal_uInt16 Window::getDefaultAccessibleRole() const
 sal_uInt16 Window::GetAccessibleRole() const
 {
     if (!mpWindowImpl)
-        return 0;
+        return accessibility::AccessibleRole::UNKNOWN;
 
     sal_uInt16 nRole = mpWindowImpl->mpAccessibleInfos ? 
mpWindowImpl->mpAccessibleInfos->nAccessibleRole : 0xFFFF;
     if ( nRole == 0xFFFF )

Reply via email to