Skip to content

Commit 81578bb

Browse files
authored
Merge 8fca89a into 442476a
2 parents 442476a + 8fca89a commit 81578bb

2 files changed

Lines changed: 33 additions & 11 deletions

File tree

source/NVDAObjects/UIA/sysListView32.py

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,19 @@
1818

1919
def findExtraOverlayClasses(obj: NVDAObject, clsList: List[Type[NVDAObject]]) -> None:
2020
UIAControlType = obj.UIAElement.cachedControlType
21-
if UIAControlType == UIAHandler.UIA.UIA_ListItemControlTypeId:
22-
clsList.insert(0, SysListViewItem)
23-
elif UIAControlType == UIAHandler.UIA.UIA_ListControlTypeId:
21+
if UIAControlType == UIAHandler.UIA.UIA_ListControlTypeId:
2422
clsList.insert(0, SysListViewList)
23+
elif UIAControlType == UIAHandler.UIA.UIA_ListItemControlTypeId and isinstance(obj.parent, SysListViewList):
24+
clsList.insert(0, SysListViewItem)
25+
if obj.parent._getUIACacheablePropertyValue(UIAHandler.UIA.UIA_IsTablePatternAvailablePropertyId):
26+
clsList.insert(0, RowWithFakeNavigation)
2527

2628

2729
class SysListViewList(UIA):
2830
...
2931

3032

31-
class SysListViewItem(RowWithFakeNavigation, ListItem):
33+
class SysListViewItem(ListItem):
3234

3335
def _get_name(self) -> str:
3436
parent = self.parent
@@ -55,10 +57,14 @@ def _get_name(self) -> str:
5557
)
5658
and index > 0
5759
):
58-
columnHeaderItems = e.getCachedPropertyValueEx(
59-
UIAHandler.UIA.UIA_TableItemColumnHeaderItemsPropertyId,
60-
True
61-
)
60+
try:
61+
columnHeaderItems = e.getCachedPropertyValueEx(
62+
UIAHandler.UIA.UIA_TableItemColumnHeaderItemsPropertyId,
63+
False
64+
)
65+
except COMError:
66+
log.debugWarning("Couldn't fetch column header items", exc_info=True)
67+
columnHeaderItems = None
6268
else:
6369
columnHeaderItems = None
6470
if columnHeaderItems:

source/appModules/mmc.py

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# A part of NonVisual Desktop Access (NVDA)
2-
# Copyright (C) 2015-2020 NV Access Limited, David Parduhn, Bill Dengler, Leonard de Ruijter, Łukasz Golonka
2+
# Copyright (C) 2015-2023 NV Access Limited, David Parduhn, Bill Dengler, Leonard de Ruijter, Łukasz Golonka
33
# This file is covered by the GNU General Public License.
44
# See the file COPYING for more details.
55

@@ -9,6 +9,9 @@
99
import eventHandler
1010
from NVDAObjects.IAccessible import IAccessible
1111
from NVDAObjects.behaviors import ToolTip
12+
import NVDAObjects.window
13+
import winUser
14+
1215

1316
class MMCTable(IAccessible):
1417
def _get_focusRedirect(self):
@@ -56,8 +59,21 @@ def chooseNVDAObjectOverlayClasses(self, obj, clsList):
5659
if obj.windowClassName == "AfxWnd42u":
5760
if obj.role == controlTypes.Role.TABLE:
5861
clsList.insert(0, MMCTable)
59-
elif obj.role in (controlTypes.Role.TABLECELL,
60-
controlTypes.Role.TABLEROWHEADER):
62+
elif obj.role in (
63+
controlTypes.Role.TABLECELL,
64+
controlTypes.Role.TABLEROWHEADER
65+
):
6166
clsList.insert(0, MMCTableCell)
6267
if obj.windowClassName == "tooltips_class32" and obj.name is None:
6368
clsList.insert(0, toolTipWithEmptyName)
69+
70+
def isBadUIAWindow(self, hwnd):
71+
windowClassName = winUser.getClassName(hwnd)
72+
normalizedClassName = NVDAObjects.window.Window.normalizeWindowClassName(windowClassName)
73+
if normalizedClassName in (
74+
# #15333: SysListView32 controls in mmc are known to have an incomplete UIA implementation.
75+
# Revert back to the MSAA implementation instead.
76+
'SysListView32'
77+
):
78+
return True
79+
return False

0 commit comments

Comments
 (0)