[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3' - desktop/source
Jan Holesovsky
kendy at collabora.com
Wed Jan 24 12:53:39 UTC 2018
desktop/source/lib/init.cxx | 19 ++++++++++++++++---
1 file changed, 16 insertions(+), 3 deletions(-)
New commits:
commit ca86867d21bc9ef423ecdbf7931eaffd06ef1bab
Author: Jan Holesovsky <kendy at collabora.com>
Date: Wed Jan 24 13:32:24 2018 +0100
lok: Preload thesauri too.
Change-Id: If2bfd3a024fc61900d3c12ff976df136d4e61bf6
Reviewed-on: https://gerrit.libreoffice.org/48503
Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
Tested-by: Michael Meeks <michael.meeks at collabora.com>
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());
More information about the Libreoffice-commits
mailing list