11# A part of NonVisual Desktop Access (NVDA)
2- # Copyright (C) 2017-2021 NV Access Limited, Joseph Lee
2+ # Copyright (C) 2017-2022 NV Access Limited, Joseph Lee
33# This file is covered by the GNU General Public License.
44# See the file COPYING for more details.
55
@@ -123,7 +123,7 @@ def event_UIA_elementSelected(self, obj, nextHandler):
123123 # For consistent experience, report the new category first by traversing through controls.
124124 # #8189: do not announce candidates list itself (not items),
125125 # as this is repeated each time candidate items are selected.
126- if obj .UIAElement . cachedAutomationID == "CandidateList" :
126+ if obj .UIAAutomationId == "CandidateList" :
127127 return
128128 speech .cancelSpeech ()
129129 # Sometimes, due to bad tree traversal or wrong item getting selected,
@@ -139,7 +139,7 @@ def event_UIA_elementSelected(self, obj, nextHandler):
139139 if (
140140 obj and obj .UIAElement .cachedClassName == "ListViewItem"
141141 and obj .parent and isinstance (obj .parent , UIA )
142- and obj .parent .UIAElement . cachedAutomationID != "TEMPLATE_PART_ClipboardItemsList"
142+ and obj .parent .UIAAutomationId != "TEMPLATE_PART_ClipboardItemsList"
143143 ):
144144 # The difference between emoji panel and suggestions list is absence of categories/emoji separation.
145145 # Turns out automation ID for the container is different,
@@ -256,7 +256,7 @@ def event_nameChange(self, obj, nextHandler):
256256 (obj .UIAElement .cachedClassName in ("CRootKey" , "GridViewItem" ))
257257 # Just ignore useless clipboard status.
258258 # Also top emoji search result must be announced for better user experience.
259- or (obj .UIAElement . cachedAutomationID in (
259+ or (obj .UIAAutomationId in (
260260 "TEMPLATE_PART_ClipboardItemsList" ,
261261 "TEMPLATE_PART_Search_TextBlock"
262262 ))
@@ -271,21 +271,21 @@ def event_nameChange(self, obj, nextHandler):
271271 # In some cases, parent will be None, as seen when emoji panel is closed in build 18267.
272272 try :
273273 if (
274- obj .UIAElement . cachedAutomationID == "TEMPLATE_PART_ClipboardItemIndex"
275- or obj .parent .UIAElement . cachedAutomationID == "TEMPLATE_PART_ClipboardItemsList"
274+ obj .UIAAutomationId == "TEMPLATE_PART_ClipboardItemIndex"
275+ or obj .parent .UIAAutomationId == "TEMPLATE_PART_ClipboardItemsList"
276276 ):
277277 return
278278 except AttributeError :
279279 return
280280 if (
281281 not self ._emojiPanelJustOpened
282- or obj .UIAElement . cachedAutomationID != "TEMPLATE_PART_ExpressionGroupedFullView"
282+ or obj .UIAAutomationId != "TEMPLATE_PART_ExpressionGroupedFullView"
283283 ):
284284 speech .cancelSpeech ()
285285 self ._emojiPanelJustOpened = False
286286 # Don't forget to add "Microsoft Candidate UI" as something that should be suppressed.
287287 if (
288- obj .UIAElement . cachedAutomationID not in (
288+ obj .UIAAutomationId not in (
289289 "TEMPLATE_PART_ExpressionFullViewItemsGrid" ,
290290 "TEMPLATE_PART_ClipboardItemIndex" ,
291291 "CandidateWindowControl"
0 commit comments