lingucomponent/source/spellcheck/languagetool/languagetoolimp.cxx | 5 +++++ 1 file changed, 5 insertions(+)
New commits: commit 27b8c67bb154d2e09c2377a5f73621b72167a226 Author: Miklos Vajna <vmik...@collabora.com> AuthorDate: Fri Mar 3 10:57:39 2023 +0100 Commit: Miklos Vajna <vmik...@collabora.com> CommitDate: Fri Mar 3 10:51:30 2023 +0000 lingucomponent: don't get locales from the server when this is disabled Do it like LanguageToolGrammarChecker::doProofreading(), which already checked for this setting. Helps when soffice starts up in an environment without network access and also is pointless. Avoids this warning: warn:languagetool:13511:13511:lingucomponent/source/spellcheck/languagetool/languagetoolimp.cxx:508: CURL request returned with error: 28 Which looked odd, given that LT was disabled already. Change-Id: Ideb0c59ad79bdbd7d22acef22e31a43377d30ec1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148166 Reviewed-by: Miklos Vajna <vmik...@collabora.com> Tested-by: Jenkins diff --git a/lingucomponent/source/spellcheck/languagetool/languagetoolimp.cxx b/lingucomponent/source/spellcheck/languagetool/languagetoolimp.cxx index ff38eb67d172..fb8228890bdc 100644 --- a/lingucomponent/source/spellcheck/languagetool/languagetoolimp.cxx +++ b/lingucomponent/source/spellcheck/languagetool/languagetoolimp.cxx @@ -111,6 +111,11 @@ Sequence<Locale> SAL_CALL LanguageToolGrammarChecker::getLocales() if (m_aSuppLocales.hasElements()) return m_aSuppLocales; SvxLanguageToolOptions& rLanguageOpts = SvxLanguageToolOptions::Get(); + if (!rLanguageOpts.getEnabled()) + { + return m_aSuppLocales; + } + OString localeUrl = OUStringToOString(rLanguageOpts.getLocaleListURL(), RTL_TEXTENCODING_UTF8); if (localeUrl.isEmpty()) {