-
-
Notifications
You must be signed in to change notification settings - Fork 614
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reporting indent in Word with UIA (fix-up) #12924
Conversation
- fixed issue when first line indent is negative - do not report 0 values in formatting information
And while at it, would you mind give your opinion on #12908 (comment)? |
Also _getIndentValueDisplayString moved in the class and made private.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @CyrilleB79, I've added some minor notes to the documentation but this looks ready to be merged otherwise.
Co-authored-by: Sean Budd <seanbudd123@gmail.com>
See test results for failed build of commit 190d4a3379 |
@seanbudd I have addressed all the review comments.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @CyrilleB79
Link to issue number:
Fixes #12899
Fix-up of #12908
Relates to #12770
Summary of the issue:
Historically, the indent in NVDA is reported via object model and its terminology is similar to what is found in Word's paragraph formatting dialog.
In #12908, reporting indant via UIA has been introduced. A mapping between UIA text attributes relative to indent and the type of indent that is reported was used. This mapping was doing the following assumption:
This assumption is not always correct for the first two points. And you can seen that object model access. And UIA access give not the same results in the following examples:
Moreover, first line negative was reported in the object model code, whereas it does not appear at all in the UIA code, what evidences missing code.
Description of how this pull request fixes the issue:
Correct matching between Word's and UIA terminology has been implemented. To clarify:
Word's terminology
UIA terminology
Addition: do not report zero indent
In addition, I have removed reporting any type of indent when its value is zero. Indeed, it was not reported in this case with the object model access, and I felt it was worth continuing in this way. Moreover, in #12908, nothing has been indicated that zero values should now be reported, so I assumed that it was unintentional.
Possible alternative design
I have aligned what is reported to what preexisted with the object model access, since in #12908 no information was indicating that it should have been modified.
But another option may have been to report indentation as provided by UIA and to align the object model access code to what is provided by UIA.
I have also not chosen this alternative design because I think that today, only Word provides indentation information via UIA. Thus, this makes sense to follow with Words conventions. If another provider should provide indent information one day, maybe the way indentation is reported should be reconsidered and uniformed.
Should you however prefer this alternative design, just let me know.
Testing strategy:
Tested various paragraph formatting with non-zero left indent and the 3 following cases:
Known issues with pull request:
Code design:
The
getIndentValueDisplayString
function stands alone in theNVDAObjects\UIA\__init__.py
. If you have any better proposal, just let me know.Change log entries:
Not needed, it is just a fix-up PR.
Should the alternative design be implemented however, then the new way to report indent should then be notified.
Code Review Checklist: