-
-
Notifications
You must be signed in to change notification settings - Fork 626
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
Fixup of #12861: custom annotations in Word break annotations in elem… #13149
Conversation
… in elements list
Is there an issue or exact steps to reproduce for this? |
Steps are as follows:
The mentioned error will be in the log. |
Co-authored-by: Łukasz Golonka <lukasz.golonka@mailbox.org>
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 |
Superseded by pr #13341 |
…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.
…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.
…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.
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: