summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMichael Weghorn <m.weghorn@posteo.de>2023-11-06 13:07:35 +0100
committerMichael Weghorn <m.weghorn@posteo.de>2023-11-07 07:51:37 +0100
commitdff76b069e26a6d3487f74c5784d6f6cf273a19e (patch)
treede8b28363127ddac129365fcbb8eb859ea06970f /include
parent0769e5e698a9cff77a815118dad82bc763520679 (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 'include')
-rw-r--r--include/svx/AccessibleTextHelper.hxx12
-rw-r--r--include/svx/weldeditview.hxx2
2 files changed, 13 insertions, 1 deletions
diff --git a/include/svx/AccessibleTextHelper.hxx b/include/svx/AccessibleTextHelper.hxx
index 724cb0c8a7e6..963ae41e5b30 100644
--- a/include/svx/AccessibleTextHelper.hxx
+++ b/include/svx/AccessibleTextHelper.hxx
@@ -276,6 +276,18 @@ public:
*/
void UpdateChildren();
+ /** Update the selection.
+
+ @attention Might fire state change events, therefore,
+ don't hold any mutex except solar mutex, which you are
+ required to lock before. This method should only be called
+ from the main office thread.
+
+ Call this method if the selection has changed and the
+ the AccessibleTextHelper isn't notified internally.
+ */
+ void UpdateSelection();
+
/** Drop all references and enter disposed state
This method drops all references to external objects (also
diff --git a/include/svx/weldeditview.hxx b/include/svx/weldeditview.hxx
index 004be7b609fb..43002a95e58c 100644
--- a/include/svx/weldeditview.hxx
+++ b/include/svx/weldeditview.hxx
@@ -87,7 +87,7 @@ protected:
virtual void EditViewInvalidate(const tools::Rectangle& rRect) override { Invalidate(rRect); }
- virtual void EditViewSelectionChange() override { Invalidate(); }
+ virtual void EditViewSelectionChange() override;
virtual OutputDevice& EditViewOutputDevice() const override
{