From 56cb2b78dbd355c74d3454721b8d37ad24292f85 Mon Sep 17 00:00:00 2001 From: Henry Castro Date: Fri, 23 Dec 2022 13:57:01 -0400 Subject: lok: disable spell if remote language tool enabled . Signed-off-by: Henry Castro Change-Id: I73158c3feaa84af4d713d3f1b1fc9a60dcf95463 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144785 Tested-by: Jenkins CollaboraOffice Reviewed-by: Miklos Vajna Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145601 Tested-by: Jenkins --- desktop/source/lib/init.cxx | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'desktop') diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 1097058a81c5..71c53f2d097a 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -58,6 +58,8 @@ #include #include #include +#include +#include #include #include #include @@ -7069,6 +7071,23 @@ void setLanguageToolConfig() rLanguageOpts.setUsername(aUsername); rLanguageOpts.setApiKey(aApiKey); } + + css::uno::Reference xLangSrv = + css::linguistic2::LinguServiceManager::create(xContext); + if (xLangSrv.is()) + { + css::uno::Reference xSpell = xLangSrv->getSpellChecker(); + if (xSpell.is()) + { + Sequence aEmpty; + Sequence aLocales = xSpell->getLocales(); + + for (int itLocale = 0; itLocale < aLocales.getLength(); itLocale++) + { + xLangSrv->setConfiguredServices(SN_SPELLCHECKER, aLocales[itLocale], aEmpty); + } + } + } } catch(uno::Exception const& rException) { -- cgit