diff options
author | Michael Weghorn <m.weghorn@posteo.de> | 2023-11-06 13:07:35 +0100 |
---|---|---|
committer | Michael Weghorn <m.weghorn@posteo.de> | 2023-11-07 07:51:37 +0100 |
commit | dff76b069e26a6d3487f74c5784d6f6cf273a19e (patch) | |
tree | de8b28363127ddac129365fcbb8eb859ea06970f /svx | |
parent | 0769e5e698a9cff77a815118dad82bc763520679 (diff) |
tdf#135236 a11y: Notify a11y layer of WeldEditView sel change
Extend `WeldEditView::EditViewSelectionChange` to not only
invalidate the view, but also notify the `AccessibleTextHelper`
of the selection update, so the corresponding events are sent
on the a11y layer.
This e.g. causes the `CARET_CHANGED` events to be sent as
needed when moving the cursor/caret using the arrow keys in the
"Not in dictionary" text edit in Writer's spelling dialog
("Tools" -> "Spelling"), so the Orca screen reader on Linux
with the gtk3 or qt6 VCL plugin announces the new caret position,
which was no longer the case since the spelling dialog was welded
in
commit 243b5b392906042ab03800e0b5765e6f3513372c
Date: Fri Jun 14 21:56:44 2019 +0100
weld SpellDialog
The newly added `AccessibleTextHelper::UpdateSelection` is a
simplified version of `AccessibleTextHelper::UpdateChildren`.
Change-Id: I5f0898c3ccb9fd527a6ff672be49157cb6e518b1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158992
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/accessibility/AccessibleTextHelper.cxx | 15 | ||||
-rw-r--r-- | svx/source/dialog/weldeditview.cxx | 14 |
2 files changed, 29 insertions, 0 deletions
diff --git a/svx/source/accessibility/AccessibleTextHelper.cxx b/svx/source/accessibility/AccessibleTextHelper.cxx index d836f2ee4970..f12281793b78 100644 --- a/svx/source/accessibility/AccessibleTextHelper.cxx +++ b/svx/source/accessibility/AccessibleTextHelper.cxx @@ -1677,6 +1677,21 @@ namespace accessibility #endif } + void AccessibleTextHelper::UpdateSelection() + { +#ifdef DBG_UTIL + // precondition: solar mutex locked + DBG_TESTSOLARMUTEX(); + mpImpl->CheckInvariants(); +#endif + + mpImpl->UpdateSelection(); + +#ifdef DBG_UTIL + mpImpl->CheckInvariants(); +#endif + } + void AccessibleTextHelper::Dispose() { // As Dispose calls ShutdownEditSource, which in turn diff --git a/svx/source/dialog/weldeditview.cxx b/svx/source/dialog/weldeditview.cxx index 415e9e7d109d..46ab95eb9a18 100644 --- a/svx/source/dialog/weldeditview.cxx +++ b/svx/source/dialog/weldeditview.cxx @@ -1669,6 +1669,20 @@ css::uno::Reference<css::datatransfer::clipboard::XClipboard> WeldEditView::GetC return weld::CustomWidgetController::GetClipboard(); } +void WeldEditView::EditViewSelectionChange() +{ + Invalidate(); + +#if !ENABLE_WASM_STRIP_ACCESSIBILITY + if (m_xAccessible.is()) + { + ::accessibility::AccessibleTextHelper* pHelper = m_xAccessible->GetTextHelper(); + if (pHelper) + pHelper->UpdateSelection(); + } +#endif +} + namespace { class WeldEditViewUIObject final : public DrawingAreaUIObject |