desktop/source/lib/init.cxx | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+)
New commits: commit 56cb2b78dbd355c74d3454721b8d37ad24292f85 Author: Henry Castro <hcas...@collabora.com> AuthorDate: Fri Dec 23 13:57:01 2022 -0400 Commit: Henry Castro <hcas...@collabora.com> CommitDate: Wed Feb 1 20:06:09 2023 +0000 lok: disable spell if remote language tool enabled . Signed-off-by: Henry Castro <hcas...@collabora.com> Change-Id: I73158c3feaa84af4d713d3f1b1fc9a60dcf95463 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144785 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Miklos Vajna <vmik...@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145601 Tested-by: Jenkins 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 <rtl/bootstrap.hxx> #include <rtl/strbuf.hxx> #include <rtl/uri.hxx> +#include <svl/zforlist.hxx> +#include <linguistic/misc.hxx> #include <cppuhelper/bootstrap.hxx> #include <comphelper/base64.hxx> #include <comphelper/dispatchcommand.hxx> @@ -7069,6 +7071,23 @@ void setLanguageToolConfig() rLanguageOpts.setUsername(aUsername); rLanguageOpts.setApiKey(aApiKey); } + + css::uno::Reference<css::linguistic2::XLinguServiceManager2> xLangSrv = + css::linguistic2::LinguServiceManager::create(xContext); + if (xLangSrv.is()) + { + css::uno::Reference<css::linguistic2::XSpellChecker> xSpell = xLangSrv->getSpellChecker(); + if (xSpell.is()) + { + Sequence<OUString> aEmpty; + Sequence<css::lang::Locale> aLocales = xSpell->getLocales(); + + for (int itLocale = 0; itLocale < aLocales.getLength(); itLocale++) + { + xLangSrv->setConfiguredServices(SN_SPELLCHECKER, aLocales[itLocale], aEmpty); + } + } + } } catch(uno::Exception const& rException) {