MS Word with UIA: support moving by sentence with legacy object model when available#12874
Merged
Conversation
…row) where the legacy MS Word object model is still available. E.g. MS Word, Outlook, but not Windows Mail. This implementation should be removed and replace with pure UI Automation as soon as moving by sentence is supported by MS Word with UI Automation custom patterns.
See test results for failed build of commit e58e650ebe |
seanbudd
approved these changes
Sep 27, 2021
| if isScriptWaiting(): | ||
| return | ||
| if not self.WinwordSelectionObject: | ||
| # Legacy object model not available. |
Member
There was a problem hiding this comment.
Should an error be logged here?
LeonarddeR
reviewed
Sep 29, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Link to issue number:
Fixes #9254
Summary of the issue:
In the past, NVDA has had the functionality to move by sentence in MS word (alt+downArrow and alt+upArrow). This functionality used the MS Word object model.
With the switch to using UI automation to access MS Word, move by sentence was lost, as MS Word's UI automation implementation provides no concept of a sentence unit.
Description of how this pull request fixes the issue:
This pr provides an implementation of moving by sentence for MS Word with UIA by falling back to the MS word object model for this specific feature, if the object model is available.
This therefore will work in MS Word and Outlook, but not in Windows Mail.
Testing strategy:
Known issues with pull request:
Our goal must be to use UIA by default in MS Word, and not rely on the object model, as Microsoft is no longer fixing existing or new bugs found with the object model.
It could be possible in future that even making this small set of object model calls could introduce unknown unstable behaviour in future builds of MS Word, thus it is very important that we switch to using UI automation to move by sentence as soon as it is possible to do so. Microsoft has planned to expose this vya UIA custom patterns in the very near future.
Change log entries:
Bug fixes
Code Review Checklist: