Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions source/NVDAObjects/UIA/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1193,10 +1193,14 @@ def _get_UIASelectionPattern(self):
return self.UIASelectionPattern

def _get_UIASelectionPattern2(self):
self.UIASelectionPattern2 = self._getUIAPattern(
UIAHandler.UIA_SelectionPattern2Id,
UIAHandler.IUIAutomationSelectionPattern2
)
try:
self.UIASelectionPattern2 = self._getUIAPattern(
UIAHandler.UIA_SelectionPattern2Id,
UIAHandler.IUIAutomationSelectionPattern2
)
except COMError:
# SelectionPattern2 is not available on older Operating Systems such as Windows 7
self.UIASelectionPattern2 = None
return self.UIASelectionPattern2

def getSelectedItemsCount(self, maxItems=None):
Expand Down Expand Up @@ -1462,7 +1466,11 @@ def _get_states(self):
states.add(controlTypes.STATE_CHECKABLE)
if s==UIAHandler.ToggleState_On:
states.add(controlTypes.STATE_CHECKED)
annotationTypes = self._getUIACacheablePropertyValue(UIAHandler.UIA_AnnotationTypesPropertyId)
try:
annotationTypes = self._getUIACacheablePropertyValue(UIAHandler.UIA_AnnotationTypesPropertyId)
except COMError:
# annotationTypes cannot be fetched on older Operating Systems such as Windows 7.
annotationTypes = None
if annotationTypes:
if UIAHandler.AnnotationType_Comment in annotationTypes:
states.add(controlTypes.STATE_HASCOMMENT)
Expand Down