summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorMarco Cecchetti <marco.cecchetti@collabora.com>2023-10-10 10:50:50 +0200
committerMiklos Vajna <vmiklos@collabora.com>2023-10-27 19:28:52 +0200
commitf3b20f31d55f304ed9d4a3eb257bf9d468fffe5f (patch)
tree8c7e439b15e7f30e7f4b288c1ab870dfa0e5325a /svx
parent217f23f6437b1cac10fb4ea09b72fa896d46bd6b (diff)
lok: a11y: impress: help screen reader to report shape selection
Refactored LOKDocumentFocusListener::notifyEvent. Implemented 2 new callbacks: - LOK_CALLBACK_A11Y_EDITING_IN_SELECTION_STATE: it says the client if editing in a shape or cell is active or it isn't. - LOK_CALLBACK_A11Y_SELECTION_CHANGED: it says if a shape has been selected/unselected, the name of the shape and text content are sent too for being reported by a screen reader. (cherry picked from commit 76899152ec3d1924cc72d2b869e197a1e34a0a1a) Conflicts: sfx2/source/view/viewsh.cxx Change-Id: I644bcc7daeb8772805688a9bccdabd0631ce0a22 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158562 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/accessibility/ChildrenManagerImpl.cxx17
1 files changed, 17 insertions, 0 deletions
diff --git a/svx/source/accessibility/ChildrenManagerImpl.cxx b/svx/source/accessibility/ChildrenManagerImpl.cxx
index cc107bc4b0df..96e27c079e9b 100644
--- a/svx/source/accessibility/ChildrenManagerImpl.cxx
+++ b/svx/source/accessibility/ChildrenManagerImpl.cxx
@@ -1008,6 +1008,23 @@ void ChildrenManagerImpl::UpdateSelection()
}
}
+ // We need to know when text content is no more edited but shape is still selected.
+ // For instance when ESC is pressed.
+ // The only difference is provided by nSelectedChildCount: on editing is equal to 1.
+ // In the following a shape get selected, but it was already selected, anyway editing is no more active.
+ if (comphelper::LibreOfficeKit::isActive() && pNewFocusedShape && nAddSelect == 0)
+ {
+ sal_Int64 nChildCount = pNewFocusedShape->getAccessibleChildCount();
+ sal_Int64 nSelectedChildCount = pNewFocusedShape->getSelectedAccessibleChildCount();
+ if (nChildCount > 0 && nSelectedChildCount == 0)
+ {
+ Reference< XAccessible > xShape(pNewFocusedShape);
+ uno::Any anyShape;
+ anyShape <<= xShape;
+ mrContext.CommitChange(AccessibleEventId::SELECTION_CHANGED,anyShape,uno::Any(), -1);
+ }
+ }
+
// Remember whether there is a shape that now has the focus.
mpFocusedShape = pNewFocusedShape;
}