vcl/source/window/window.cxx |   15 +++------------
 1 file changed, 3 insertions(+), 12 deletions(-)

New commits:
commit ae4cbff068a669361ff9eea8cea576694b743d6c
Author:     Caolán McNamara <[email protected]>
AuthorDate: Thu Dec 18 12:19:25 2025 +0000
Commit:     Miklos Vajna <[email protected]>
CommitDate: Fri Dec 19 08:45:51 2025 +0100

    avoid a possible empty aria node
    
    if there was no description, only a name, but we end up not using it
    so only fetch the name for the case that we will use it.
    
    Change-Id: I1075bcc3cd054fbf512b240ffe09e17c12a0d868
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195852
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    Reviewed-by: Miklos Vajna <[email protected]>

diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index 3e10252954ac..795ef3f27a0f 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -3421,25 +3421,16 @@ void Window::DumpAsPropertyTree(tools::JsonWriter& 
rJsonWriter)
     if (pAccLabelledBy)
         rJsonWriter.put("labelledBy", pAccLabelledBy->get_id());
 
-    OUString sAccName = GetAccessibleName();
+    OUString sAccName = (!pAccLabelFor && !pAccLabelledBy) ? 
GetAccessibleName() : OUString();
     OUString sAccDesc = GetAccessibleDescription();
 
     if (!sAccName.isEmpty() || !sAccDesc.isEmpty())
     {
         auto aAria = rJsonWriter.startNode("aria");
-
         if (!sAccDesc.isEmpty())
-        {
             rJsonWriter.put("description", sAccDesc);
-        }
-
-        if(!pAccLabelFor && !pAccLabelledBy)
-        {
-            if (!sAccName.isEmpty())
-            {
-                rJsonWriter.put("label", sAccName);
-            }
-        }
+        if (!sAccName.isEmpty())
+            rJsonWriter.put("label", sAccName);
     }
 
     mpWindowImpl->maDumpAsPropertyTreeHdl.Call(rJsonWriter);

Reply via email to