diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 7f09d490ba0a..498e8cb3975b 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -7775,6 +7775,19 @@ static void preloadData() } std::cerr << "\n"; + // preload all available hyphenators + css::uno::Reference xHyphenator(xLngSvcMgr->getHyphenator()); + css::uno::Reference xHyphLocales(xHyphenator, css::uno::UNO_QUERY_THROW); + aLocales = xHyphLocales->getLocales(); + std::cerr << "Preloading local hyphenators: "; + for (auto &it : std::as_const(aLocales)) + { + std::cerr << LanguageTag::convertToBcp47(it) << " "; + css::beans::PropertyValues aNone; + xHyphenator->createPossibleHyphens(u"forcefed"_ustr, it, aNone); + } + std::cerr << "\n"; + std::cerr << "Preloading breakiterator\n"; if (aLocales.getLength()) { diff --git a/lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx b/lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx index 8ac156ef8cb3..60cbfb5a87d9 100644 --- a/lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx +++ b/lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx @@ -19,6 +19,7 @@ #include +#include #include #include #include @@ -138,6 +139,8 @@ Sequence< Locale > SAL_CALL Hyphenator::getLocales() { for (const auto& rLocaleName : dict.aLocaleNames) { + if (!comphelper::LibreOfficeKit::isAllowlistedLanguage(rLocaleName)) + continue; aLocaleNamesSet.insert( rLocaleName ); } }