nvda icon indicating copy to clipboard operation
nvda copied to clipboard

Correctly announce selection changes in inline cel edit control in Microsoft Excel

Open michaelDCurran opened this issue 9 months ago • 0 comments

Link to issue number:

Fixes #15843

Summary of the issue:

When editing a cell in Microsoft Excel with inline cell editing enabled, NvDA does not announce text selection changes. This is because in order to support inline cell editing, NvDA needs to redirect focus to the real cell edit control - Excel fires MSAA focus on a broken control. However, caret events do not know that focus was redirected and only go to the last queued focus object, which is still the broken control. Note that this already works when NVDA uses UIA to access MS Excel (as the UIA control is not broken).

Description of user facing changes

NVDA announces selection changes in the inline cel edit control in Microsoft Excel.

Description of development approach

Rather than redirecting focus events to an obj's focusRedirect property in executeEvent, do it earlier in queueEvent, so that lastQueuedFocusObject is the possibbly redirected focus and therefore other code paths in NVDA check against what the focus actually ends up being.

Testing strategy:

  • Open Microsoft Excel.
  • Ensure NVDA is not using UIA to access Microsoft Excel.
  • Arrow to a cell.
  • Press f2 to edit.
  • Type some text.
  • Use shift+arrow keys to select some text.
  • Verify that NVDA announces the text being selected.

Known issues with pull request:

This change is broader than the specific scenario being fixed, though it feels logically like this is what it should have been like in the first place. But to be safe, this is going to master first, and if any weirdness with events associated with the focus is seen, then this can be reverted and a more specific fix can be made. Such as in IAccessiblehandler's processGenericEvent, specifically redirect caret events to to focusRedirect on EXCEL6 objects.

Code Review Checklist:

  • [x] Documentation:
    • Change log entry
    • User Documentation
    • Developer / Technical Documentation
    • Context sensitive help for GUI changes
  • [x] Testing:
    • Unit tests
    • System (end to end) tests
    • Manual testing
  • [x] UX of all users considered:
    • Speech
    • Braille
    • Low Vision
    • Different web browsers
    • Localization in other languages / culture than English
  • [x] API is compatible with existing add-ons.
  • [x] Security precautions taken.

michaelDCurran avatar May 01 '24 02:05 michaelDCurran