diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2023-03-09 17:17:41 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2023-03-09 19:36:57 +0000 |
commit | 9aca8e1333393af69972450d5e7e924cdfed4269 (patch) | |
tree | 5a3614031304b6c7c9d9510572ae854064d6fd0c /linguistic/qa | |
parent | 92598f5a5eed932048e060ab2ca17ffcbcca56dc (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 'linguistic/qa')
-rw-r--r-- | linguistic/qa/restprotocol.cxx | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/linguistic/qa/restprotocol.cxx b/linguistic/qa/restprotocol.cxx index 61c04185c757..c189228e6635 100644 --- a/linguistic/qa/restprotocol.cxx +++ b/linguistic/qa/restprotocol.cxx @@ -18,8 +18,8 @@ #include <rtl/strbuf.hxx> #include <osl/socket.hxx> #include <osl/thread.hxx> -#include <svtools/languagetoolcfg.hxx> #include <unotest/bootstrapfixturebase.hxx> +#include <officecfg/Office/Linguistic.hxx> #include <com/sun/star/beans/PropertyValue.hpp> #include <com/sun/star/connection/XAcceptor.hpp> @@ -138,24 +138,28 @@ private: void TestRestProtocol::testProofreading() { css::lang::Locale aLocale("en", "US", ""); - Sequence<::com::sun::star::beans::PropertyValue> aProperties; - SvxLanguageToolOptions& rLanguageOpts = SvxLanguageToolOptions::Get(); - rLanguageOpts.setBaseURL("http://127.0.0.1:2022/api"); - rLanguageOpts.setUsername("hcastro"); - rLanguageOpts.setApiKey("hcvhcvhcv"); - rLanguageOpts.setEnabled(true); - rLanguageOpts.setSSLVerification(false); - rLanguageOpts.setRestProtocol("duden"); - CPPUNIT_ASSERT_EQUAL(OUString("duden"), rLanguageOpts.getRestProtocol()); + using LanguageToolCfg = officecfg::Office::Linguistic::GrammarChecking::LanguageTool; + auto batch(comphelper::ConfigurationChanges::create()); + + LanguageToolCfg::BaseURL::set("http://127.0.0.1:2022/api", batch); + LanguageToolCfg::Username::set("hcastro", batch); + LanguageToolCfg::ApiKey::set("hcvhcvhcv", batch); + LanguageToolCfg::IsEnabled::set(true, batch); + LanguageToolCfg::SSLCertVerify::set(false, batch); + LanguageToolCfg::RestProtocol::set("duden", batch); + + batch->commit(); + + CPPUNIT_ASSERT_EQUAL(OUString("duden"), *LanguageToolCfg::RestProtocol::get()); Reference<::com::sun::star::linguistic2::XProofreader> xProofreader( m_xSFactory->createInstance("com.sun.star.linguistic2.Proofreader"), UNO_QUERY); CPPUNIT_ASSERT(xProofreader.is()); com::sun::star::linguistic2::ProofreadingResult aResult - = xProofreader->doProofreading("id", "ths is a tst", aLocale, 0, 0, aProperties); + = xProofreader->doProofreading("id", "ths is a tst", aLocale, 0, 0, {}); - CPPUNIT_ASSERT_EQUAL(2, aResult.aErrors.getLength()); + CPPUNIT_ASSERT_EQUAL(sal_Int32(2), aResult.aErrors.getLength()); } void TestRestProtocol::setUp() |