desktop/source/lib/init.cxx | 2 +- include/vcl/svapp.hxx | 3 ++- vcl/source/window/builder.cxx | 10 ++++------ 3 files changed, 7 insertions(+), 8 deletions(-)
New commits: commit 1f5847bbba1365b0e517164c3149dc77d3a713e6 Author: Caolán McNamara <[email protected]> AuthorDate: Mon Dec 8 12:11:41 2025 +0000 Commit: Miklos Vajna <[email protected]> CommitDate: Tue Dec 9 09:49:37 2025 +0100 put the uicoverage into the first level json i.e. don't put json into json Change-Id: I5606c0d280e7f8c3c08cc21e1bc62689de7422bf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195226 Reviewed-by: Miklos Vajna <[email protected]> Tested-by: Jenkins CollaboraOffice <[email protected]> diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index cea09faeb448..a63b1e086d43 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -5636,7 +5636,7 @@ static void doc_postUnoCommand(LibreOfficeKitDocument* pThis, const char* pComma tools::JsonWriter aJson; aJson.put("commandName", aCommand); aJson.put("success", true); - aJson.put("result", Application::UICoverageReport()); + Application::UICoverageReport(aJson); pDocument->mpCallbackFlushHandlers[nView]->queue(LOK_CALLBACK_UNO_COMMAND_RESULT, aJson.finishAndGetAsOString()); } } diff --git a/include/vcl/svapp.hxx b/include/vcl/svapp.hxx index 829edf7f5251..6ba2817acea6 100644 --- a/include/vcl/svapp.hxx +++ b/include/vcl/svapp.hxx @@ -45,6 +45,7 @@ class BitmapEx; +namespace tools { class JsonWriter; } namespace weld { class Builder; @@ -1238,7 +1239,7 @@ public: static void EnableUICoverage(bool bEnable); /** Report on what .ui files were used*/ - static OString UICoverageReport(); + static void UICoverageReport(tools::JsonWriter& rJson); ///@} diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx index 080e0b4c4d86..aa728b28c384 100644 --- a/vcl/source/window/builder.cxx +++ b/vcl/source/window/builder.cxx @@ -192,18 +192,16 @@ void Application::EnableUICoverage(bool bEnable) ImplGetSVData()->mpDefInst->getUsedUIList().clear(); } -OString Application::UICoverageReport() +void Application::UICoverageReport(tools::JsonWriter& rJson) { - tools::JsonWriter aJson; + auto resultNode = rJson.startNode("result"); const auto& entries = ImplGetSVData()->mpDefInst->getUsedUIList(); { - auto childrenNode = aJson.startArray("used"); + auto childrenNode = rJson.startArray("used"); for (const auto& entry : entries) - aJson.putSimpleValue(entry); + rJson.putSimpleValue(entry); } - - return aJson.finishAndGetAsOString(); } std::unique_ptr<weld::Builder> Application::CreateBuilder(weld::Widget* pParent, const OUString &rUIFile, bool bMobile, sal_uInt64 nLOKWindowId)
