Skip to content

Commit b5601d7

Browse files
authored
Merge 20cb041 into 8d34a18
2 parents 8d34a18 + 20cb041 commit b5601d7

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

source/virtualBuffers/__init__.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# A part of NonVisual Desktop Access (NVDA)
33
# This file is covered by the GNU General Public License.
44
# See the file COPYING for more details.
5-
# Copyright (C) 2007-2022 NV Access Limited, Peter Vágner
5+
# Copyright (C) 2007-2022 NV Access Limited, Peter Vágner, Cyrille Bougot
66

77
import time
88
import threading
@@ -671,10 +671,10 @@ def _getNearestTableCell(
671671

672672
# Cells are grouped by row, so in most cases, we simply need to search in the right direction.
673673
for info in self._iterTableCells(tableID, direction=movement, startPos=startPos):
674-
_ignore, row, col, rowSpan, colSpan = self._getTableCellCoords(info)
675-
if row <= destRow < row + rowSpan and col <= destCol < col + colSpan:
674+
cell = self._getTableCellCoords(info)
675+
if cell.row <= destRow < cell.row + cell.rowSpan and cell.col <= destCol < cell.col + cell.colSpan:
676676
return info
677-
elif row > destRow and movement == "next":
677+
elif cell.row > destRow and movement == "next":
678678
# Optimisation: We've gone forward past destRow, so we know we won't find the cell.
679679
# We can't reverse this logic when moving backwards because there might be a prior cell on an earlier row which spans multiple rows.
680680
break
@@ -688,8 +688,8 @@ def _getNearestTableCell(
688688
# In this case, there might be a cell on an earlier row which spans multiple rows.
689689
# Therefore, try searching backwards.
690690
for info in self._iterTableCells(tableID, direction="previous", startPos=startPos):
691-
_ignore, row, col, rowSpan, colSpan = self._getTableCellCoords(info)
692-
if row <= destRow < row + rowSpan and col <= destCol < col + colSpan:
691+
cell = self._getTableCellCoords(info)
692+
if cell.row <= destRow < cell.row + cell.rowSpan and cell.col <= destCol < cell.col + cell.colSpan:
693693
return info
694694
else:
695695
raise LookupError

0 commit comments

Comments
 (0)