diff options
author | Henry Castro <hcastro@collabora.com> | 2022-11-22 11:39:45 -0400 |
---|---|---|
committer | Henry Castro <hcastro@collabora.com> | 2023-01-31 16:04:39 +0000 |
commit | 5cd9ca5d4232c725661131137975549c06231d5c (patch) | |
tree | 93e011dcde3c90405342d088e8f03c8a27164114 /desktop | |
parent | 1d89f4835384e6379177e1607bb648b567e3fdab (diff) |
lok: add Rest Protocol property
Signed-off-by: Henry Castro <hcastro@collabora.com>
Change-Id: I7353e16dbf835684e5ce5963387359924352937b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143124
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145599
Tested-by: Jenkins
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/source/lib/init.cxx | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 45b2b126fadb..1097058a81c5 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -7041,22 +7041,27 @@ void setLanguageToolConfig() { const char* pEnabled = ::getenv("LANGUAGETOOL_ENABLED"); const char* pBaseUrlString = ::getenv("LANGUAGETOOL_BASEURL"); - const char* pUsername = ::getenv("LANGUAGETOOL_USERNAME"); - const char* pApikey = ::getenv("LANGUAGETOOL_APIKEY"); - const char* pSSLVerification = ::getenv("LANGUAGETOOL_SSL_VERIFICATION"); + if (pEnabled && pBaseUrlString) { + const char* pUsername = ::getenv("LANGUAGETOOL_USERNAME"); + const char* pApikey = ::getenv("LANGUAGETOOL_APIKEY"); + const char* pSSLVerification = ::getenv("LANGUAGETOOL_SSL_VERIFICATION"); + const char* pRestProtocol = ::getenv("LANGUAGETOOL_RESTPROTOCOL"); + OUString aEnabled = OStringToOUString(pEnabled, RTL_TEXTENCODING_UTF8); OUString aSSLVerification = OStringToOUString(pSSLVerification, RTL_TEXTENCODING_UTF8); if (aEnabled != "true") return; OUString aBaseUrl = OStringToOUString(pBaseUrlString, RTL_TEXTENCODING_UTF8); + OUString aRestProtocol = OStringToOUString(pRestProtocol, RTL_TEXTENCODING_UTF8); try { SvxLanguageToolOptions& rLanguageOpts = SvxLanguageToolOptions::Get(); rLanguageOpts.setBaseURL(aBaseUrl); rLanguageOpts.setEnabled(true); rLanguageOpts.setSSLVerification(aSSLVerification == "true"); + rLanguageOpts.setRestProtocol(aRestProtocol); if (pUsername && pApikey) { OUString aUsername = OStringToOUString(pUsername, RTL_TEXTENCODING_UTF8); |