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:02:19 +0100
commitc896282fb7f38661cc9c39542d72ab3610ac990a (patch)
tree8874166284e57e18d0db889b48d5eb29dd408427 /lingucomponent
parenttdf#38915: set cProcessed condition on any process outcome (diff)
downloadcore-c896282fb7f38661cc9c39542d72ab3610ac990a.tar.gz
core-c896282fb7f38661cc9c39542d72ab3610ac990a.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/48722 Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-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 27b8f910448c..7e9916f224a3 100644
--- a/lingucomponent/source/spellcheck/spell/sspellimp.cxx
+++ b/lingucomponent/source/spellcheck/spell/sspellimp.cxx
@@ -21,6 +21,7 @@
#include <com/sun/star/linguistic2/XSearchableDictionaryList.hpp>
#include <com/sun/star/linguistic2/SpellFailure.hpp>
+#include <comphelper/lok.hxx>
#include <comphelper/processfactory.hxx>
#include <cppuhelper/factory.hxx>
#include <cppuhelper/supportsservice.hxx>
@@ -168,6 +169,9 @@ Sequence< Locale > SAL_CALL SpellChecker::getLocales()
sal_Int32 nLen2 = aLocaleNames.getLength();
for (k = 0; k < nLen2; ++k)
{
+ if (!comphelper::LibreOfficeKit::isWhitelistedLanguage(aLocaleNames[k]))
+ continue;
+
aLocaleNamesSet.insert( aLocaleNames[k] );
}
}
diff --git a/lingucomponent/source/thesaurus/libnth/nthesimp.cxx b/lingucomponent/source/thesaurus/libnth/nthesimp.cxx
index f8a66da0d962..9fc3007078f6 100644
--- a/lingucomponent/source/thesaurus/libnth/nthesimp.cxx
+++ b/lingucomponent/source/thesaurus/libnth/nthesimp.cxx
@@ -25,6 +25,7 @@
#include <com/sun/star/linguistic2/LinguServiceManager.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>
@@ -172,6 +173,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] );
}
}