summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2023-03-09 17:17:41 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2023-03-09 19:36:57 +0000
commit9aca8e1333393af69972450d5e7e924cdfed4269 (patch)
tree5a3614031304b6c7c9d9510572ae854064d6fd0c /desktop
parent92598f5a5eed932048e060ab2ca17ffcbcca56dc (diff)
Use officecfg instead of SvxLanguageToolOptions
Change-Id: Ia9add4ff3ebe20ba491e33de1e9a2644a48ef7a3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148548 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'desktop')
-rw-r--r--desktop/source/lib/init.cxx19
1 files changed, 11 insertions, 8 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 54ffbac8e322..cf23f09f1413 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -144,7 +144,6 @@
#include <svtools/ctrltool.hxx>
#include <svtools/langtab.hxx>
#include <svtools/deeplcfg.hxx>
-#include <svtools/languagetoolcfg.hxx>
#include <vcl/fontcharmap.hxx>
#ifdef IOS
#include <vcl/sysdata.hxx>
@@ -196,6 +195,7 @@
#include "lokclipboard.hxx"
#include <officecfg/Office/Common.hxx>
#include <officecfg/Office/Impress.hxx>
+#include <officecfg/Office/Linguistic.hxx>
#include <unotools/optionsdlg.hxx>
#include <svl/ctloptions.hxx>
#include <svtools/accessibilityoptions.hxx>
@@ -7372,26 +7372,29 @@ void setLanguageToolConfig()
OUString aBaseUrl = OStringToOUString(pBaseUrlString, RTL_TEXTENCODING_UTF8);
try
{
- SvxLanguageToolOptions& rLanguageOpts = SvxLanguageToolOptions::Get();
- rLanguageOpts.setBaseURL(aBaseUrl);
- rLanguageOpts.setEnabled(true);
+ using LanguageToolCfg = officecfg::Office::Linguistic::GrammarChecking::LanguageTool;
+ auto batch(comphelper::ConfigurationChanges::create());
+
+ LanguageToolCfg::BaseURL::set(aBaseUrl, batch);
+ LanguageToolCfg::IsEnabled::set(true, batch);
if (pSSLVerification)
{
OUString aSSLVerification = OStringToOUString(pSSLVerification, RTL_TEXTENCODING_UTF8);
- rLanguageOpts.setSSLVerification(aSSLVerification == "true");
+ LanguageToolCfg::SSLCertVerify::set(aSSLVerification == "true", batch);
}
if (pRestProtocol)
{
OUString aRestProtocol = OStringToOUString(pRestProtocol, RTL_TEXTENCODING_UTF8);
- rLanguageOpts.setRestProtocol(aRestProtocol);
+ LanguageToolCfg::RestProtocol::set(aRestProtocol, batch);
}
if (pUsername && pApikey)
{
OUString aUsername = OStringToOUString(pUsername, RTL_TEXTENCODING_UTF8);
OUString aApiKey = OStringToOUString(pApikey, RTL_TEXTENCODING_UTF8);
- rLanguageOpts.setUsername(aUsername);
- rLanguageOpts.setApiKey(aApiKey);
+ LanguageToolCfg::Username::set(aUsername, batch);
+ LanguageToolCfg::ApiKey::set(aApiKey, batch);
}
+ batch->commit();
css::uno::Reference<css::linguistic2::XLinguServiceManager2> xLangSrv =
css::linguistic2::LinguServiceManager::create(xContext);