desktop/source/lib/init.cxx | 30 ++++++++++++++++++------------ include/vcl/svapp.hxx | 2 +- vcl/inc/jsdialog/enabled.hxx | 3 ++- vcl/jsdialog/enabled.cxx | 15 +++++++++++++-- vcl/source/window/builder.cxx | 4 ++-- 5 files changed, 36 insertions(+), 18 deletions(-)
New commits: commit cb5a8cf83262e6e2d28f7493ab7866649adee078 Author: Caolán McNamara <[email protected]> AuthorDate: Mon Jan 26 12:27:36 2026 +0000 Commit: Caolán McNamara <[email protected]> CommitDate: Tue Feb 24 09:21:12 2026 +0100 handle coverage for a self-build without dictionaries submodule Change-Id: Ifb22e1132b96f51cd754a57ec4b1dfc08cf7ff8e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198142 Tested-by: Jenkins CollaboraOffice <[email protected]> Reviewed-by: Miklos Vajna <[email protected]> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200103 Reviewed-by: Caolán McNamara <[email protected]> diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index a8d7738a0a71..8d4e348edc99 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -5644,29 +5644,35 @@ static void doc_postUnoCommand(LibreOfficeKitDocument* pThis, const char* pComma } else if (gImpl && aCommand == ".uno:UICoverage") { + bool report(true), linguisticDataAvailable(true); + std::optional<bool> applyTracking; + for (const beans::PropertyValue& rPropValue : aPropertyValuesVector) { if (rPropValue.Name == "Report") - { - bool report(true); rPropValue.Value >>= report; - if (report) - { - tools::JsonWriter aJson; - aJson.put("commandName", aCommand); - aJson.put("success", true); - Application::UICoverageReport(aJson); - pDocument->mpCallbackFlushHandlers[nView]->queue(LOK_CALLBACK_UNO_COMMAND_RESULT, aJson.finishAndGetAsOString()); - } - } + else if (rPropValue.Name == "LinguisticDataAvailable") + rPropValue.Value >>= linguisticDataAvailable; else if (rPropValue.Name == "Track") { bool track(false); rPropValue.Value >>= track; - Application::EnableUICoverage(track); + applyTracking = track; } } + if (report) + { + tools::JsonWriter aJson; + aJson.put("commandName", aCommand); + aJson.put("success", true); + Application::UICoverageReport(aJson, linguisticDataAvailable); + pDocument->mpCallbackFlushHandlers[nView]->queue(LOK_CALLBACK_UNO_COMMAND_RESULT, aJson.finishAndGetAsOString()); + } + + if (applyTracking) + Application::EnableUICoverage(*applyTracking); + return; } else if (gImpl && aCommand == ".uno:ReportWhenIdle") diff --git a/include/vcl/svapp.hxx b/include/vcl/svapp.hxx index 6b909e7e7a17..52997670f767 100644 --- a/include/vcl/svapp.hxx +++ b/include/vcl/svapp.hxx @@ -1242,7 +1242,7 @@ public: static void EnableUICoverage(bool bEnable); /** Report on what .ui files were used*/ - static void UICoverageReport(tools::JsonWriter& rJson); + static void UICoverageReport(tools::JsonWriter& rJson, bool linguisticDataAvailable); ///@} diff --git a/vcl/inc/jsdialog/enabled.hxx b/vcl/inc/jsdialog/enabled.hxx index d5a6e13e9b1c..d4347a7e5ebd 100644 --- a/vcl/inc/jsdialog/enabled.hxx +++ b/vcl/inc/jsdialog/enabled.hxx @@ -31,7 +31,8 @@ std::vector<OUString> completeWriterDialogList(const o3tl::sorted_vector<OUStrin // returns vector of writer sidebar .ui files not seen that should be seen to have complete coverage std::vector<OUString> completeWriterSidebarList(const o3tl::sorted_vector<OUString>& entries); // returns vector of common/shared dialog .ui files not seen that should be seen to have complete coverage -std::vector<OUString> completeCommonDialogList(const o3tl::sorted_vector<OUString>& entries); +std::vector<OUString> completeCommonDialogList(const o3tl::sorted_vector<OUString>& entries, + bool linguisticDataAvailable); // returns vector of common/shared sidebar .ui files not seen that should be seen to have complete coverage std::vector<OUString> completeCommonSidebarList(const o3tl::sorted_vector<OUString>& entries); } diff --git a/vcl/jsdialog/enabled.cxx b/vcl/jsdialog/enabled.cxx index 4f4b04b41bd5..0ec60a9dadec 100644 --- a/vcl/jsdialog/enabled.cxx +++ b/vcl/jsdialog/enabled.cxx @@ -711,12 +711,23 @@ std::vector<OUString> completeCommonSidebarList(const o3tl::sorted_vector<OUStri return missing; } -std::vector<OUString> completeCommonDialogList(const o3tl::sorted_vector<OUString>& entries) +std::vector<OUString> completeCommonDialogList(const o3tl::sorted_vector<OUString>& entries, + bool linguisticDataAvailable) { std::vector<OUString> missing; auto processCategory = [&](const auto& category) { for (const auto& entry : category) { + if (!linguisticDataAvailable && ( + entry == u"cui/ui/thesaurus.ui" || + entry == u"cui/ui/spellingdialog.ui" || + entry == u"cui/ui/spelloptionsdialog.ui")) + { + // Skip the dialogs that can't be reached in the absense of + // linguistic data. + continue; + } + // Skip this one, I don't think it can appear in practice if (entry == u"sfx/ui/cmisinfopage.ui") continue; @@ -754,8 +765,8 @@ std::vector<OUString> completeCommonDialogList(const o3tl::sorted_vector<OUStrin missing.push_back(sEntry); } }; - processCategory(SfxDialogList); processCategory(CuiDialogList); + processCategory(SfxDialogList); return missing; } diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx index 0f7071a596de..fc5d8385d00b 100644 --- a/vcl/source/window/builder.cxx +++ b/vcl/source/window/builder.cxx @@ -194,7 +194,7 @@ void Application::EnableUICoverage(bool bEnable) ImplGetSVData()->mpDefInst->getUsedUIList().clear(); } -void Application::UICoverageReport(tools::JsonWriter& rJson) +void Application::UICoverageReport(tools::JsonWriter& rJson, bool linguisticDataAvailable) { auto resultNode = rJson.startNode("result"); @@ -224,7 +224,7 @@ void Application::UICoverageReport(tools::JsonWriter& rJson) rJson.putSimpleValue(entry); } - std::vector<OUString> missingCommonDialogUIs = jsdialog::completeCommonDialogList(entries); + std::vector<OUString> missingCommonDialogUIs = jsdialog::completeCommonDialogList(entries, linguisticDataAvailable); rJson.put("CompleteCommonDialogCoverage", missingCommonDialogUIs.empty()); if (!missingCommonDialogUIs.empty()) {
