diff options
author | Jan Holesovsky <kendy@collabora.com> | 2018-01-26 20:28:46 +0100 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2018-03-25 17:38:26 +0200 |
commit | 69e6707f9d65aa9253846d2aa96572dcb4240429 (patch) | |
tree | 9772ad5ac14238c7ad0599147a7dba70b3587aaa /lingucomponent | |
parent | 7907f2c478c4669962ecb60b85c3d007f4b07deb (diff) |
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>
(cherry picked from commit 3a68b21c212c1c2fc7f1d8f4d1abc8990bcd91c0)
Diffstat (limited to 'lingucomponent')
-rw-r--r-- | lingucomponent/source/spellcheck/spell/sspellimp.cxx | 4 | ||||
-rw-r--r-- | lingucomponent/source/thesaurus/libnth/nthesimp.cxx | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/lingucomponent/source/spellcheck/spell/sspellimp.cxx b/lingucomponent/source/spellcheck/spell/sspellimp.cxx index 4e64e42ce34e..399c7968f58d 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> @@ -165,6 +166,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 6f6d3880e9c7..39f0ff44651e 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] ); } } |