Kaydet (Commit) fa72a337 authored tarafından Jan Holesovsky's avatar Jan Holesovsky

lok: Preload thesauri too.

Change-Id: If2bfd3a024fc61900d3c12ff976df136d4e61bf6
Reviewed-on: https://gerrit.libreoffice.org/48502Reviewed-by: 's avatarJan Holesovsky <kendy@collabora.com>
Tested-by: 's avatarJan Holesovsky <kendy@collabora.com>
üst 9f05a323
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment