diff options
author | Tamás Zolnai <tamas.zolnai@collabora.com> | 2018-04-03 17:57:04 +0200 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2018-04-06 14:40:40 +0200 |
commit | 8674c0999bea80c0234c1e3bae1bc12f53b27c45 (patch) | |
tree | 0762840c51facf9d70d6cfcad8da4045104a040d /desktop/source/lib/init.cxx | |
parent | 6ac27e7d3deb8e137860d8b31f1c5eace616de53 (diff) |
lok: Make the bundled dictionaries work.
Create the user directory temporary in the temp directory and
use that to load the dictionaries (bundled extensions).
Co-author; Jan Holesovsky <kendy@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/49495
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
(cherry picked from commit ecfd40a1bcc1fc8cdc40bdd27ea1f00ba652707e)
Change-Id: I5c7c824b68571048ce870fd5218cb47a333f3ad8
Reviewed-on: https://gerrit.libreoffice.org/52347
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
Diffstat (limited to 'desktop/source/lib/init.cxx')
-rw-r--r-- | desktop/source/lib/init.cxx | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index a3b77270aaa9..1b2a95416081 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -93,6 +93,7 @@ #include <unotools/syslocaleoptions.hxx> #include <unotools/mediadescriptor.hxx> #include <unotools/pathoptions.hxx> +#include <unotools/tempfile.hxx> #include <osl/module.hxx> #include <comphelper/sequence.hxx> #include <sfx2/sfxbasemodel.hxx> @@ -3573,6 +3574,21 @@ static void lo_status_indicator_callback(void *data, comphelper::LibreOfficeKit: /// Used only by LibreOfficeKit when used by Online to pre-initialize static void preloadData() { + std::cerr << "Preloading dictionaries: "; + + // Create user profile in the temp directory for loading the dictionaries + OUString sUserPath; + rtl::Bootstrap::get("UserInstallation", sUserPath); + utl::TempFile aTempDir(nullptr, true); + aTempDir.EnableKillingFile(); + rtl::Bootstrap::set("UserInstallation", aTempDir.GetURL()); + + // Register the bundled extensions + desktop::Desktop::SynchronizeExtensionRepositories(true); + bool bAbort = desktop::Desktop::CheckExtensionDependencies(); + if(bAbort) + std::cerr << "CheckExtensionDependencies failed" << std::endl; + // preload all available dictionaries css::uno::Reference<css::linguistic2::XLinguServiceManager> xLngSvcMgr = css::linguistic2::LinguServiceManager::create(comphelper::getProcessComponentContext()); @@ -3580,7 +3596,6 @@ static void preloadData() css::uno::Reference<linguistic2::XSupportedLocales> xSpellLocales(xSpellChecker, css::uno::UNO_QUERY_THROW); uno::Sequence< css::lang::Locale > aLocales = xSpellLocales->getLocales(); - std::cerr << "Preloading dictionaries: "; for (auto &it : aLocales) { std::cerr << it.Language << "_" << it.Country << " "; @@ -3602,6 +3617,9 @@ static void preloadData() } std::cerr << "\n"; + // Set user profile's path back to the original one + rtl::Bootstrap::set("UserInstallation", sUserPath); + css::uno::Reference< css::ui::XAcceleratorConfiguration > xGlobalCfg; xGlobalCfg = css::ui::GlobalAcceleratorConfiguration::create( comphelper::getProcessComponentContext()); |