summaryrefslogtreecommitdiff
path: root/desktop/source/lib
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2018-01-24 13:32:24 +0100
committerJan Holesovsky <kendy@collabora.com>2018-01-25 10:08:02 +0100
commitfa72a3379d3641565ddab561d32d0a7d03b83665 (patch)
tree2242f101b9a9fced6bebdbce1a9aa01ff3006fd7 /desktop/source/lib
parent9f05a323d50c6750e25f2ca69f758ec7fc4313bc (diff)
lok: Preload thesauri too.
Change-Id: If2bfd3a024fc61900d3c12ff976df136d4e61bf6 Reviewed-on: https://gerrit.libreoffice.org/48502 Reviewed-by: Jan Holesovsky <kendy@collabora.com> Tested-by: Jan Holesovsky <kendy@collabora.com>
Diffstat (limited to 'desktop/source/lib')
-rw-r--r--desktop/source/lib/init.cxx19
1 files changed, 16 insertions, 3 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 338d11221566..569960e82f02 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -3637,13 +3637,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)
{
@@ -3652,6 +3652,19 @@ static void preloadData()
xSpellChecker->isValid("forcefed", it, aNone);
}
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";
}
static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath, const char* pUserProfileUrl)