Fixup of #12861: custom annotations in Word break annotations in elem…#13149
Closed
LeonarddeR wants to merge 2 commits into
Closed
Fixup of #12861: custom annotations in Word break annotations in elem…#13149LeonarddeR wants to merge 2 commits into
LeonarddeR wants to merge 2 commits into
Conversation
… in elements list
Member
|
Is there an issue or exact steps to reproduce for this? |
Collaborator
Author
|
Steps are as follows:
The mentioned error will be in the log. |
lukaszgo1
reviewed
Feb 1, 2022
Co-authored-by: Łukasz Golonka <lukasz.golonka@mailbox.org>
Contributor
|
Given that this PR fixes regression introduced during 2022.1 development cycle it seems logical to at least try to get it into 2022.1 if possible. cc @michaelDCurran |
5 tasks
Member
|
Superseded by pr #13341 |
michaelDCurran
added a commit
that referenced
this pull request
Feb 16, 2022
…DA elements list. (#13341) Supersedes pr #13149 Summary of the issue: The following error is in the log when viewing annotations in the NVDA elements list: ``` ERROR - queueHandler.flushQueue (19:47:20.811) - MainThread (9476): Error in func ElementsListDialog.initElementType Traceback (most recent call last): File "queueHandler.pyc", line 55, in flushQueue File "browseMode.pyc", line 1054, in initElementType File "browseMode.pyc", line 1074, in filter File "NVDAObjects\UIA\wordDocument.pyc", line 139, in label File "NVDAObjects\UIA\wordDocument.pyc", line 95, in getCommentInfoFromPosition AttributeError: 'WordBrowseModeDocument' object has no attribute '_UIACustomAnnotationTypes' ``` This is because getCommentInfoFromPosition tries to fetch custom annotation types off its obj property, which it incorrectly expects to be a UIA NVDAObject. But in this case it is a TreeInterceptor. PR #13149 was opened to address this by specifically creating a UIA NVDAObject rather than getting it from the position TextInfo. However, Further investigation has found that it is actually not necessary to even support custom annotation types (draft comment, resolved comment) in getCommentInfoFromPosition as: 1. Quicknav / Elements List iteration was never updated to specifically jump to / list those custom comment types. See CommentUIATextInfoQuickNavItem.wantedAttribValues 2. Although the IUIAutomationTextRange implementation in MS Word does return these custom comment types in GetAttributeValue when given UIA_AnnotationTypesAttributeId, the elements returned with UIA_AnnotationObjectsAttributeId only ever return the standard Comment annotation type via their UIA_AnnotationAnnotationTypeId property. In fact for draft comments, no annotation objects are returned at all. In short, supporting custom comment annotation types in getCommentInfoFromPosition was not necessary in the first place. Description of how this pull request fixes the issue: Remove support for custom comment annotation types from getCommentInfoFromPosition. It again only supports the standard comment annotation type.
michaelDCurran
added a commit
that referenced
this pull request
Feb 16, 2022
…t column number and section number (#13283) Supersedes pr #13149 Summary of the issue: The following error is in the log when viewing annotations in the NVDA elements list: ``` ERROR - queueHandler.flushQueue (19:47:20.811) - MainThread (9476): Error in func ElementsListDialog.initElementType Traceback (most recent call last): File "queueHandler.pyc", line 55, in flushQueue File "browseMode.pyc", line 1054, in initElementType File "browseMode.pyc", line 1074, in filter File "NVDAObjects\UIA\wordDocument.pyc", line 139, in label File "NVDAObjects\UIA\wordDocument.pyc", line 95, in getCommentInfoFromPosition AttributeError: 'WordBrowseModeDocument' object has no attribute '_UIACustomAnnotationTypes' ``` This is because getCommentInfoFromPosition tries to fetch custom annotation types off its obj property, which it incorrectly expects to be a UIA NVDAObject. But in this case it is a TreeInterceptor. PR #13149 was opened to address this by specifically creating a UIA NVDAObject rather than getting it from the position TextInfo. However, Further investigation has found that it is actually not necessary to even support custom annotation types (draft comment, resolved comment) in getCommentInfoFromPosition as: 1. Quicknav / Elements List iteration was never updated to specifically jump to / list those custom comment types. See CommentUIATextInfoQuickNavItem.wantedAttribValues 2. Although the IUIAutomationTextRange implementation in MS Word does return these custom comment types in GetAttributeValue when given UIA_AnnotationTypesAttributeId, the elements returned with UIA_AnnotationObjectsAttributeId only ever return the standard Comment annotation type via their UIA_AnnotationAnnotationTypeId property. In fact for draft comments, no annotation objects are returned at all. In short, supporting custom comment annotation types in getCommentInfoFromPosition was not necessary in the first place. Description of how this pull request fixes the issue: Remove support for custom comment annotation types from getCommentInfoFromPosition. It again only supports the standard comment annotation type.
michaelDCurran
added a commit
that referenced
this pull request
Feb 23, 2022
…t column number and section number (#13283) Supersedes pr #13149 Summary of the issue: The following error is in the log when viewing annotations in the NVDA elements list: ``` ERROR - queueHandler.flushQueue (19:47:20.811) - MainThread (9476): Error in func ElementsListDialog.initElementType Traceback (most recent call last): File "queueHandler.pyc", line 55, in flushQueue File "browseMode.pyc", line 1054, in initElementType File "browseMode.pyc", line 1074, in filter File "NVDAObjects\UIA\wordDocument.pyc", line 139, in label File "NVDAObjects\UIA\wordDocument.pyc", line 95, in getCommentInfoFromPosition AttributeError: 'WordBrowseModeDocument' object has no attribute '_UIACustomAnnotationTypes' ``` This is because getCommentInfoFromPosition tries to fetch custom annotation types off its obj property, which it incorrectly expects to be a UIA NVDAObject. But in this case it is a TreeInterceptor. PR #13149 was opened to address this by specifically creating a UIA NVDAObject rather than getting it from the position TextInfo. However, Further investigation has found that it is actually not necessary to even support custom annotation types (draft comment, resolved comment) in getCommentInfoFromPosition as: 1. Quicknav / Elements List iteration was never updated to specifically jump to / list those custom comment types. See CommentUIATextInfoQuickNavItem.wantedAttribValues 2. Although the IUIAutomationTextRange implementation in MS Word does return these custom comment types in GetAttributeValue when given UIA_AnnotationTypesAttributeId, the elements returned with UIA_AnnotationObjectsAttributeId only ever return the standard Comment annotation type via their UIA_AnnotationAnnotationTypeId property. In fact for draft comments, no annotation objects are returned at all. In short, supporting custom comment annotation types in getCommentInfoFromPosition was not necessary in the first place. Description of how this pull request fixes the issue: Remove support for custom comment annotation types from getCommentInfoFromPosition. It again only supports the standard comment annotation type.
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:
Fixup for #12861
Summary of the issue:
The following error is in the log when vieiwing annotations in the elements list:
Description of how this pull request fixes the issue:
Hopefully fix this, though I don't have a way to reproduce how the custom annotations work. @michaelDCurran could you please take a look?
Testing strategy:
To be tested with a real test case, to be provided.
Known issues with pull request:
None known
Change log entries:
None needed.
Code Review Checklist: