mirror of
https://github.com/LibreOffice/core.git
synced 2025-07-26 15:45:26 +00:00
LOK: preload hyphenators
Without this fix the hyphenation feature did not work when bind mounting was not available, e.g. in docker containers. Change-Id: I800012b5229ce5a56a5698db7057e3a27e760be3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180337 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
This commit is contained in:

committed by
Miklos Vajna

parent
e4e7616ab4
commit
7b43ce868f
@ -7775,6 +7775,19 @@ static void preloadData()
|
||||
}
|
||||
std::cerr << "\n";
|
||||
|
||||
// preload all available hyphenators
|
||||
css::uno::Reference<linguistic2::XHyphenator> xHyphenator(xLngSvcMgr->getHyphenator());
|
||||
css::uno::Reference<linguistic2::XSupportedLocales> 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())
|
||||
{
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
#include <com/sun/star/uno/Reference.h>
|
||||
|
||||
#include <comphelper/lok.hxx>
|
||||
#include <comphelper/sequence.hxx>
|
||||
#include <cppuhelper/factory.hxx>
|
||||
#include <cppuhelper/supportsservice.hxx>
|
||||
@ -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 );
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user