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 7ef0c02054d2e589c651b1d6d62a6bac160cdb7b
Author:     Caolán McNamara <[email protected]>
AuthorDate: Mon Jan 26 12:27:36 2026 +0000
Commit:     Caolán McNamara <[email protected]>
CommitDate: Mon Jan 26 22:19:21 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]>

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index a9616855337d..795ac916c07c 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -5647,29 +5647,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 6ba2817acea6..41abc6b2f0d4 100644
--- a/include/vcl/svapp.hxx
+++ b/include/vcl/svapp.hxx
@@ -1239,7 +1239,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 caa818aa84b1..6f5628de630f 100644
--- a/vcl/jsdialog/enabled.cxx
+++ b/vcl/jsdialog/enabled.cxx
@@ -713,12 +713,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;
@@ -756,8 +767,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 d5638d4410d4..257240e0bf5e 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -192,7 +192,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");
 
@@ -222,7 +222,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())
     {

Reply via email to