Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
soffice: Announce actually deleted text on Ctrl+backspace
### Link to issue number: Fixes nvaccess#15436 ### Summary of the issue: The base class implementation `EditableText#_backspaceScriptHelper` for handling the Ctrl+Backspace keyboard shortcut retrieves the text to announce as deleted by expanding the text info to the corresponding text unit and then retrieving the text. This gives an incorrect result in at least Libreoffice Writer, where that would return a string just containing the space character when removing a word followed by a space using the Ctrl+backspace keyboard shortcut. (Writer's `IAccessibleText::textAtOffset` implementation that gets used in `IA2TextTextInfo#_getWordOffsets` handles the space as a separate word, but Ctrl+backspace removes both, the actual word and following whitespace.) ### Description of user facing changes When removing a word followed by whitespace in Libreoffice Writer, the actually removed text is announced. ### Description of development approach Instead of separately retrieving the text for a word, override the default implementation in the LibreOffice app module and announce the actually removed text when handling Ctrl+backspace. Use the caret position before and after the text has been removed to identify what the removed text is. ### Testing strategy: Test the scenario as described in issue nvaccess#15436: 1) start LibreOffice Writer 2) type "NVDA is a free screen reader." 3) press Ctrl+backspace 7 times 4) verify that the actually removed text is annonced by NVDA. ### Known issues with pull request: None ### 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.
- Loading branch information