vcl/source/window/window.cxx |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

New commits:
commit 61c02f1961ab8062ee71fdf6149e22074c781988
Author:     Henry Castro <[email protected]>
AuthorDate: Fri Jan 9 07:34:40 2026 -0400
Commit:     Caolán McNamara <[email protected]>
CommitDate: Tue Jan 13 16:11:34 2026 +0100

    vcl: dump JSON representation of ARIA role 'tablist'
    
    Certain buttons serve as a tablist role for switching panes
    (e.g., in the Find and Replace dialog), which is necessary for 
accessibility.
    
    Signed-off-by: Henry Castro <[email protected]>
    Change-Id: I3d3cac62eea885a48451bcd895d10247be00b77a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196920
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    Reviewed-by: Caolán McNamara <[email protected]>

diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index 795ef3f27a0f..611f3521ebdf 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -3409,9 +3409,12 @@ void Window::DumpAsPropertyTree(tools::JsonWriter& 
rJsonWriter)
 
     // If GtkLabel has a static accessibility role, mark renderAsStatic.
     // so LOK renders it as <span> instead of <label> for correct 
accessibility.
+    OUString sAccRole;
     sal_uInt16 nAccessibleRole = GetAccessibleRole();
     if (nAccessibleRole == css::accessibility::AccessibleRole::STATIC && 
GetType() == WindowType::FIXEDTEXT)
         rJsonWriter.put("renderAsStatic", true);
+    else if (nAccessibleRole == 
css::accessibility::AccessibleRole::PAGE_TAB_LIST)
+        sAccRole = "tablist";
 
     vcl::Window* pAccLabelFor = getAccessibleRelationLabelFor();
     if (pAccLabelFor)
@@ -3424,13 +3427,15 @@ void Window::DumpAsPropertyTree(tools::JsonWriter& 
rJsonWriter)
     OUString sAccName = (!pAccLabelFor && !pAccLabelledBy) ? 
GetAccessibleName() : OUString();
     OUString sAccDesc = GetAccessibleDescription();
 
-    if (!sAccName.isEmpty() || !sAccDesc.isEmpty())
+    if (!sAccName.isEmpty() || !sAccDesc.isEmpty() || !sAccRole.isEmpty())
     {
         auto aAria = rJsonWriter.startNode("aria");
         if (!sAccDesc.isEmpty())
             rJsonWriter.put("description", sAccDesc);
         if (!sAccName.isEmpty())
             rJsonWriter.put("label", sAccName);
+        if (!sAccRole.isEmpty())
+            rJsonWriter.put("role", sAccRole);
     }
 
     mpWindowImpl->maDumpAsPropertyTreeHdl.Call(rJsonWriter);

Reply via email to