summaryrefslogtreecommitdiff
path: root/sw/source/uibase/uiview/view0.cxx
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2022-10-28 22:11:59 +0200
committerTomaž Vajngerl <quikee@gmail.com>2022-11-18 02:05:55 +0100
commit00128f14c400b661444676410b2088aca357291c (patch)
tree52b89f59e8419117ad24fdbdd81c884a9b629bd5 /sw/source/uibase/uiview/view0.cxx
parent0eec6d44c65f895c6fe2172792717418627db05d (diff)
sw: add a menu option to enable/disable online a11y check
Change-Id: I656037ef4e40e7c79daef5dd73f8f10c9818ac25 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142215 Tested-by: Tomaž Vajngerl <quikee@gmail.com> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'sw/source/uibase/uiview/view0.cxx')
-rw-r--r--sw/source/uibase/uiview/view0.cxx24
1 files changed, 24 insertions, 0 deletions
diff --git a/sw/source/uibase/uiview/view0.cxx b/sw/source/uibase/uiview/view0.cxx
index fefada834a84..c6b9d0e22d34 100644
--- a/sw/source/uibase/uiview/view0.cxx
+++ b/sw/source/uibase/uiview/view0.cxx
@@ -25,6 +25,7 @@
#include <unotools/configmgr.hxx>
#include <unotools/linguprops.hxx>
#include <unotools/lingucfg.hxx>
+#include <officecfg/Office/Common.hxx>
#include <viewopt.hxx>
#include <globals.h>
#include <sfx2/infobar.hxx>
@@ -326,6 +327,12 @@ void SwView::StateViewOptions(SfxItemSet &rSet)
case SID_AUTOSPELL_CHECK:
aBool.SetValue( pOpt->IsOnlineSpell() );
break;
+ case SID_ACCESSIBILITY_CHECK_ONLINE:
+ {
+ bool bOnlineAccessibilityCheck = officecfg::Office::Common::Accessibility::OnlineAccessibilityCheck::get();
+ aBool.SetValue(bOnlineAccessibilityCheck);
+ }
+ break;
case FN_SHADOWCURSOR:
if ( pOpt->getBrowseMode() )
{
@@ -574,6 +581,23 @@ void SwView::ExecViewOptions(SfxRequest &rReq)
}
break;
+ case SID_ACCESSIBILITY_CHECK_ONLINE:
+ {
+ if (pArgs && pArgs->HasItem(FN_PARAM_1, &pItem))
+ {
+ bSet = static_cast<const SfxBoolItem*>(pItem)->GetValue();
+ }
+ else if (STATE_TOGGLE == eState)
+ {
+ bool bOnlineCheck = officecfg::Office::Common::Accessibility::OnlineAccessibilityCheck::get();
+ bSet = !bOnlineCheck;
+ }
+ std::shared_ptr<comphelper::ConfigurationChanges> batch(comphelper::ConfigurationChanges::create());
+ officecfg::Office::Common::Accessibility::OnlineAccessibilityCheck::set(bSet, batch);
+ batch->commit();
+ }
+ break;
+
case FN_SHADOWCURSOR:
if( STATE_TOGGLE == eState )
{