diff options
author | Henry Castro <hcastro@collabora.com> | 2022-12-23 13:57:01 -0400 |
---|---|---|
committer | Henry Castro <hcastro@collabora.com> | 2023-02-01 20:06:09 +0000 |
commit | 56cb2b78dbd355c74d3454721b8d37ad24292f85 (patch) | |
tree | f3517539e8a7758bc1003ad428cf953dbafa5e34 /desktop | |
parent | 05472ebc3fd9c89080cfb28c26951164139b632a (diff) |
lok: disable spell if remote language tool enabled
.
Signed-off-by: Henry Castro <hcastro@collabora.com>
Change-Id: I73158c3feaa84af4d713d3f1b1fc9a60dcf95463
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144785
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145601
Tested-by: Jenkins
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/source/lib/init.cxx | 19 |
1 files changed, 19 insertions, 0 deletions
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) { |