summaryrefslogtreecommitdiffstats
path: root/lingucomponent
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2018-01-26 20:28:46 +0100
committerMichael Meeks <michael.meeks@collabora.com>2018-01-27 11:04:32 +0100
commit3a68b21c212c1c2fc7f1d8f4d1abc8990bcd91c0 (patch)
tree9c3fc0e1e217ae9c453ed961e2e1cecb17a3b9a7 /lingucomponent
parentUpdated core (diff)
downloadcore-3a68b21c212c1c2fc7f1d8f4d1abc8990bcd91c0.tar.gz
core-3a68b21c212c1c2fc7f1d8f4d1abc8990bcd91c0.zip
lok: Allow whitelisting languages that should be used by LibreOfficeKit.
LOK may get way too many languages if there are dictionaries for them installed which blows the pre-init to >2G easily; let's allow limiting that. Also make the preloading of languages work with the internal spell checking dictionaries and thesauri. Change-Id: I77119970030a7386a5cccbe4fdc89b15eab56ef1 Reviewed-on: https://gerrit.libreoffice.org/48720 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'lingucomponent')
-rw-r--r--lingucomponent/source/spellcheck/spell/sspellimp.cxx4
-rw-r--r--lingucomponent/source/thesaurus/libnth/nthesimp.cxx4
2 files changed, 8 insertions, 0 deletions
diff --git a/lingucomponent/source/spellcheck/spell/sspellimp.cxx b/lingucomponent/source/spellcheck/spell/sspellimp.cxx
index 694bc1aa27e4..12b9e240fa24 100644
--- a/lingucomponent/source/spellcheck/spell/sspellimp.cxx
+++ b/lingucomponent/source/spellcheck/spell/sspellimp.cxx
@@ -20,6 +20,7 @@
#include <com/sun/star/uno/Reference.h>
#include <com/sun/star/linguistic2/SpellFailure.hpp>
+#include <comphelper/lok.hxx>
#include <comphelper/processfactory.hxx>
#include <cppuhelper/factory.hxx>
#include <cppuhelper/supportsservice.hxx>
@@ -156,6 +157,9 @@ Sequence< Locale > SAL_CALL SpellChecker::getLocales()
{
for (auto const& locale : aLocaleNames)
{
+ if (!comphelper::LibreOfficeKit::isWhitelistedLanguage(locale))
+ continue;
+
aLocaleNamesSet.insert(locale);
}
}
diff --git a/lingucomponent/source/thesaurus/libnth/nthesimp.cxx b/lingucomponent/source/thesaurus/libnth/nthesimp.cxx
index 88a6550ddf5e..ce1d4a07f492 100644
--- a/lingucomponent/source/thesaurus/libnth/nthesimp.cxx
+++ b/lingucomponent/source/thesaurus/libnth/nthesimp.cxx
@@ -26,6 +26,7 @@
#include <com/sun/star/linguistic2/XSpellChecker1.hpp>
#include <i18nlangtag/languagetag.hxx>
#include <tools/debug.hxx>
+#include <comphelper/lok.hxx>
#include <comphelper/processfactory.hxx>
#include <osl/mutex.hxx>
#include <unotools/pathoptions.hxx>
@@ -174,6 +175,9 @@ Sequence< Locale > SAL_CALL Thesaurus::getLocales()
sal_Int32 nLen2 = aLocaleNames.getLength();
for (k = 0; k < nLen2; ++k)
{
+ if (!comphelper::LibreOfficeKit::isWhitelistedLanguage(aLocaleNames[k]))
+ continue;
+
aLocaleNamesSet.insert( aLocaleNames[k] );
}
}