desktop/source/lib/init.cxx |   22 +++++++++++++---------
 1 file changed, 13 insertions(+), 9 deletions(-)

New commits:
commit 190593257ad7636a9f88ff765ab66ff7307b9dca
Author:     Rashesh <rashesh.pa...@collabora.com>
AuthorDate: Mon Feb 17 18:54:58 2025 +0530
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Mon Feb 17 19:59:41 2025 +0100

    fix(sw-lokit): correctly load shared wordbooks
    
    - Fixes a regression introduced in commit 
89d86b64c93f2f47d7cfdefb928812e4de64fe3b.
    - Ensures dictionaries are reinitialized even when only shared wordbooks 
are uploaded.
    - Previously, reinitialization occurred only when user wordbooks were 
uploaded.
    
    Change-Id: I0f54b6b01fe1aefadc2c1fec2d9ae57db1c5d02a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181787
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 2178ce893d43..f226fdde89dd 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -5061,6 +5061,17 @@ static void lo_sendDialogEvent(LibreOfficeKit* 
/*pThis*/, unsigned long long int
     lcl_sendDialogEvent(nWindowId, pArguments);
 }
 
+static void reInitDictionaryList()
+{
+    uno::Reference<css::linguistic2::XSearchableDictionaryList> xDicList
+        = LinguMgr::GetDictionaryList();
+    if (xDicList.is())
+    {
+        uno::Reference<lang::XInitialization> xReInitDictionaryList(xDicList, 
uno::UNO_QUERY_THROW);
+        xReInitDictionaryList->initialize({});
+    }
+};
+
 static void updateConfig(const OUString& rConfigPath)
 {
     osl::Directory aScanRootDir(rConfigPath);
@@ -5125,14 +5136,7 @@ static void updateConfig(const OUString& rConfigPath)
         }
         else if (sFileName == "wordbook")
         {
-            uno::Reference<css::linguistic2::XSearchableDictionaryList> 
xDicList
-                = LinguMgr::GetDictionaryList();
-            if (xDicList.is())
-            {
-                uno::Reference<lang::XInitialization> 
xReInitDictionaryList(xDicList,
-                                                                            
uno::UNO_QUERY_THROW);
-                xReInitDictionaryList->initialize({});
-            }
+            reInitDictionaryList();
         }
     }
 }
@@ -8210,7 +8214,7 @@ static int lo_initialize(LibreOfficeKit* pThis, const 
char* pAppPath, const char
             uno::Reference<css::util::XPathSettings> xPathSettings = 
util::thePathSettings::get(xContext);
             uno::Reference<lang::XInitialization> 
xReInitSettings(xPathSettings, uno::UNO_QUERY_THROW);
             xReInitSettings->initialize({});
-
+            reInitDictionaryList();
         }
     }
 

Reply via email to