vcl/source/window/window.cxx | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-)
New commits: commit fbfeb33b38cc0a644c0315448f6a2d8637a0007e Author: Michael Meeks <michael.me...@collabora.com> AuthorDate: Fri May 10 20:29:32 2024 +0100 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Sat May 11 14:27:33 2024 +0200 lok: Don't dump empty aria properties in every JSON element. They simply bloat the json to no benefit if the properties are empty, avoid serializing empty values. Change-Id: I83c780d01820ec39acc85899d45ad9e929ad7e76 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167496 Reviewed-by: Marco Cecchetti <marco.cecche...@collabora.com> Tested-by: Michael Meeks <michael.me...@collabora.com> (cherry picked from commit 24876e5611abbaec9b2fe5fcbcf4be71a10ee366) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167457 Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> Tested-by: Jenkins diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index b7f0ea58181b..3cb43a8a4a05 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -3410,13 +3410,17 @@ void Window::DumpAsPropertyTree(tools::JsonWriter& rJsonWriter) if(!pAccLabelFor && !pAccLabelledBy) { - auto aAria = rJsonWriter.startNode("aria"); + OUString sAccName = GetAccessibleName(); + OUString sAccDesc = GetAccessibleDescription(); - OUString sAccString = GetAccessibleName(); - rJsonWriter.put("label", sAccString); - - sAccString = GetAccessibleDescription(); - rJsonWriter.put("description", sAccString); + if (!sAccName.isEmpty() || !sAccDesc.isEmpty()) + { + auto aAria = rJsonWriter.startNode("aria"); + if (!sAccName.isEmpty()) + rJsonWriter.put("label", sAccName); + if (!sAccDesc.isEmpty()) + rJsonWriter.put("description", sAccDesc); + } } mpWindowImpl->maDumpAsPropertyTreeHdl.Call(rJsonWriter);