Skip to content

Better detection of spelling errors when typing in MS Word with UIA#12925

Merged
michaelDCurran merged 2 commits into
masterfrom
i12161
Oct 13, 2021
Merged

Better detection of spelling errors when typing in MS Word with UIA#12925
michaelDCurran merged 2 commits into
masterfrom
i12161

Conversation

@michaelDCurran

Copy link
Copy Markdown
Member

Link to issue number:

Fixes #12161

Summary of the issue:

When in any editable text control (E.g. a Word document), each time the user completes a word by typing space or another punctuation character, NVDA checks the formatting of the completed word to see if it is marked as a spelling error, and if so plays a special text error buzz sound.
However, in at least MS Word with UIA, this check for spelling errors never really finds an error as MS Word has not yet actually detected the error itself.
We need to slow down NVDA's detection to give the app more time.

Description of how this pull request fixes the issue:

Delay the fetch and check of the completed word's formatting into a future core cycle (specifically a 50 ms delay) to give the app more time to detect the error itself.

Testing strategy:

In MS Word with UIA enabled/disabled, and Mozilla Thunderbird:
Created a new document or message, and started typing text with errors. Ensured that NVDA played the spelling error sound when the completed word had an error.
This test was performed both on a plugged in machine on a high-performance power profile, and a machine on battery, on a power saver profile.
All scenarios played the spelling error sound at the appropriate time.

Known issues with pull request:

None known.

Change log entries:

New features
Changes
Bug fixes
NVDA more accurately detects spelling errors as you type in MS Word with UIA enabled. (#12161)
For Developers

Code Review Checklist:

  • Pull Request description:
    • description is up to date
    • change log entries
  • Testing:
    • Unit tests
    • System (end to end) tests
    • Manual testing
  • API is compatible with existing add-ons.
  • Documentation:
    • User Documentation
    • Developer / Technical Documentation
    • Context sensitive help for GUI changes
  • UX of all users considered:
    • Speech
    • Braille
    • Low Vision
    • Different web browsers
    • Localization in other languages / culture than English

… to give the app longer to detect the spelling error itself.
@michaelDCurran michaelDCurran requested a review from a team as a code owner October 12, 2021 03:11
@andrew-l-d

Copy link
Copy Markdown

With nvda_snapshot_alpha-23940,c6aa7712 errors are reported with the buzz generally reliably if check spelling when writing is checked. The buzz does not happen if the word is followed by punctuation but reviewing reports the misspelling.
With check spelling as you write unchecked it is necessary to misspell a word and open the spell checker. Subsequent errors are buzzed, again except when followed by punctuation.
Andrew

michaelDCurran added a commit that referenced this pull request Oct 13, 2021
…any exception not just RuntimeError as a lot of complex things could go wrong if the underlying object disappears for instance. (#12931)

Fixes #12930
Fixup of #12925

Summary of the issue:
When fetching the formatting of the last typed word after a delay, in order to detect if there is a spelling error, errors can occur if the underlying object dies or is replaced.

Description of how this pull request fixes the issue:
Catch Exception rather than RuntimeError when fetching formatting by calling GetTextWithFields.
Note that this exception will still be logged at debug warning.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NVDA does not play the buzzer sound in word when a speeling error is made

5 participants