Skip to content

Braille in UIA word documents: improve focus ancestry, cursor routing, and newly inserted bullets/numbers#8576

Merged
michaelDCurran merged 11 commits into
masterfrom
i7971
Aug 1, 2018
Merged

Braille in UIA word documents: improve focus ancestry, cursor routing, and newly inserted bullets/numbers#8576
michaelDCurran merged 11 commits into
masterfrom
i7971

Conversation

@michaelDCurran

Copy link
Copy Markdown
Member

Link to issue number:

Fixes #8407
Fixes #7971
Fixes #7970

Summary of the issue:

There are several issues with braille support for Microsoft word when using UI automation:

  • Focus ancestry for both speech and braille is overly redundant. The title of the document is reported at least 3 times.
  • Braille cursor routing is incorrect when on list items due to the bullet/number text taking up cells in the wrong way.
  • When inserting a new bullet/number in Ms Word, the bullet/number is neither spoken nor brailled.

Description of how this pull request fixes the issue:

  • The focus ancestry has been improved by ignoring one of the redundant objects above the document, and the name of the document itself has been changed back to what it was pre UIA (namely "Microsoft word") rather than repeating the full title of the document again.
  • Braille cursor routing has been fixed when on list items in MS Word by stripping the nullet/number off the start of the actual text, and instead exposing it as the line-prefix formatField attribute that braille/speech knows how to handle.
  • works around a bug in MS word where expanding to line on the last line of a document (that is blank) fails. In this case we manually move the end of the text range to the end of the document. This addresses the reporting of newly inserted bullets/numbers and also stops the page number from inappropriately being announced when arrowing up from this blank line into other content.

Testing performed:

Tested several complex documents with Microsoft word with UIA support enabled. Tested with both speech and braille.

Known issues with pull request:

None.

Change log entry:

Bug fixes:

Specifically:
* strip the bullet off the start of the actual text and place it in the line-prefix formatField attribute. this allows braille cursor routing to work correctly on list items.
* Work around a bug in MS Word where expanding to line on the final line of the document when it is blank fails. In this case, move the end of the range to to the end of the document manually. this  allows NVDA to expose newly inserted bullets in both speech and braille.
…m is still announced on the first character like it used to. Now via a line-prefix_speakAlways boolean attribute.
@michaelDCurran michaelDCurran requested a review from dkager July 31, 2018 02:29
@michaelDCurran michaelDCurran changed the title Improve braille with UIA Word documents Braille in UIA word documents: improve focus ancestry, cursor routing, and newly inserted bullets/numbers Jul 31, 2018

@LeonarddeR LeonarddeR left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will test drive this with a braille display later today.

@@ -441,7 +441,10 @@ class ProtectedDocumentPane(IAccessible):
"""The pane that gets focus in case a document opens in protected mode in word

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This pane 'doesn't seem to be limited to protected documents only.

Comment thread source/NVDAObjects/UIA/wordDocument.py Outdated
def _get_name(self):
# Microsoft Word duplicates the full title of the document on this control, which is redundant as it appears in the title of the app itself.
# Translators: The name of a control that shows a Microsoft Word document.
return _("Microsoft Word")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this really be translatable as it is the name of an application? Personally, I'd vote for removing the name altogether, but that's just my personal preference.

@michaelDCurran

michaelDCurran commented Jul 31, 2018 via email

Copy link
Copy Markdown
Member Author

LeonarddeR
LeonarddeR previously approved these changes Jul 31, 2018

@LeonarddeR LeonarddeR left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow, this is really a massive improvement!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants