summaryrefslogtreecommitdiff
path: root/desktop/source/lib/init.cxx
diff options
context:
space:
mode:
authorTamás Zolnai <tamas.zolnai@collabora.com>2018-04-02 22:52:46 +0200
committerTamás Zolnai <tamas.zolnai@collabora.com>2018-04-03 14:00:38 +0200
commitecfd40a1bcc1fc8cdc40bdd27ea1f00ba652707e (patch)
treee149af56e34badd83966d09fa743b37ca2ef29e7 /desktop/source/lib/init.cxx
parent86e54f2d757fe300ba634cdcbf0ee8a589dbc2ae (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> Change-Id: I5c7c824b68571048ce870fd5218cb47a333f3ad8 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>
Diffstat (limited to 'desktop/source/lib/init.cxx')
-rw-r--r--desktop/source/lib/init.cxx20
1 files changed, 19 insertions, 1 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 8193dd5d3446..5959f4237738 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>
@@ -3627,6 +3628,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());
@@ -3634,7 +3650,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 << " ";
@@ -3656,6 +3671,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());