diff options
author | Jan Holesovsky <kendy@collabora.com> | 2018-01-24 13:32:24 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2018-01-24 13:53:17 +0100 |
commit | ca86867d21bc9ef423ecdbf7931eaffd06ef1bab (patch) | |
tree | 044ecf96a8a765fed8c26c157c7c5435b271ede9 /desktop/source/lib/init.cxx | |
parent | c9bc703e83c1ed5fe6de25d4ffb516fb82b709d2 (diff) |
lok: Preload thesauri too.
Change-Id: If2bfd3a024fc61900d3c12ff976df136d4e61bf6
Reviewed-on: https://gerrit.libreoffice.org/48503
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'desktop/source/lib/init.cxx')
-rw-r--r-- | desktop/source/lib/init.cxx | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index a6e40937de00..6961cca8e29c 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -3538,13 +3538,13 @@ static void lo_status_indicator_callback(void *data, comphelper::LibreOfficeKit: /// Used only by LibreOfficeKit when used by Online to pre-initialize static void preloadData() { - // First: sit down and read all dictionaries: yum. + // preload all available dictionaries css::uno::Reference<css::linguistic2::XLinguServiceManager> xLngSvcMgr = css::linguistic2::LinguServiceManager::create(comphelper::getProcessComponentContext()); css::uno::Reference<linguistic2::XSpellChecker> xSpellChecker(xLngSvcMgr->getSpellChecker()); - css::uno::Reference<linguistic2::XSupportedLocales> xLocales(xSpellChecker, css::uno::UNO_QUERY_THROW); - uno::Sequence< css::lang::Locale > aLocales = xLocales->getLocales(); + 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) { @@ -3554,6 +3554,19 @@ static void preloadData() } std::cerr << "\n"; + // preload all available thesauri + css::uno::Reference<linguistic2::XThesaurus> xThesaurus(xLngSvcMgr->getThesaurus()); + css::uno::Reference<linguistic2::XSupportedLocales> xThesLocales(xSpellChecker, css::uno::UNO_QUERY_THROW); + aLocales = xThesLocales->getLocales(); + std::cerr << "Preloading thesauri: "; + for (auto &it : aLocales) + { + std::cerr << it.Language << "_" << it.Country << " "; + css::beans::PropertyValues aNone; + xThesaurus->queryMeanings("forcefed", it, aNone); + } + std::cerr << "\n"; + css::uno::Reference< css::ui::XAcceleratorConfiguration > xGlobalCfg; xGlobalCfg = css::ui::GlobalAcceleratorConfiguration::create( comphelper::getProcessComponentContext()); |