vcl/source/window/window.cxx | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-)
New commits: commit fa9407dd54a6de8b503891f693cc72fb62a077a2 Author: Henry Castro <[email protected]> AuthorDate: Tue Dec 16 10:41:03 2025 -0400 Commit: Henry Castro <[email protected]> CommitDate: Thu Dec 18 14:34:52 2025 +0100 lok: a11y: fix the accessible description property The accessible description is useful for setting the image alt attribute on the client side. Change-Id: I86f4e8b6486d89c446019339699ab030dccb6c0f Signed-off-by: Henry Castro <[email protected]> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195725 Tested-by: Caolán McNamara <[email protected]> Reviewed-by: Caolán McNamara <[email protected]> Tested-by: Jenkins CollaboraOffice <[email protected]> diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index 78a6a63f5d5b..3e10252954ac 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -3421,18 +3421,24 @@ void Window::DumpAsPropertyTree(tools::JsonWriter& rJsonWriter) if (pAccLabelledBy) rJsonWriter.put("labelledBy", pAccLabelledBy->get_id()); - if(!pAccLabelFor && !pAccLabelledBy) + OUString sAccName = GetAccessibleName(); + OUString sAccDesc = GetAccessibleDescription(); + + if (!sAccName.isEmpty() || !sAccDesc.isEmpty()) { - OUString sAccName = GetAccessibleName(); - OUString sAccDesc = GetAccessibleDescription(); + auto aAria = rJsonWriter.startNode("aria"); + + if (!sAccDesc.isEmpty()) + { + rJsonWriter.put("description", sAccDesc); + } - if (!sAccName.isEmpty() || !sAccDesc.isEmpty()) + if(!pAccLabelFor && !pAccLabelledBy) { - auto aAria = rJsonWriter.startNode("aria"); if (!sAccName.isEmpty()) + { rJsonWriter.put("label", sAccName); - if (!sAccDesc.isEmpty()) - rJsonWriter.put("description", sAccDesc); + } } }
