[orca] Correct the position and size reported for selectable table rows



commit e23d91a7337975142eb4e950c52b1e07ed63d746
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Sun Nov 10 09:52:56 2019 -0500

    Correct the position and size reported for selectable table rows

 src/orca/script_utilities.py | 7 ++++++-
 src/orca/speech_generator.py | 2 +-
 2 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/src/orca/script_utilities.py b/src/orca/script_utilities.py
index 241d1621a..586edf202 100644
--- a/src/orca/script_utilities.py
+++ b/src/orca/script_utilities.py
@@ -4599,10 +4599,15 @@ class Utilities:
 
         return result or obj.parent
 
-    def getPositionAndSetSize(self, obj):
+    def getPositionAndSetSize(self, obj, **args):
         if not obj:
             return -1, -1
 
+        if obj.getRole() == pyatspi.ROLE_TABLE_CELL and args.get("readingRow"):
+            row, col = self.coordinatesForCell(obj)
+            rowcount, colcount = self.rowAndColumnCount(self.getTable(obj))
+            return row, rowcount
+
         isComboBox = obj.getRole() == pyatspi.ROLE_COMBO_BOX
         if isComboBox:
             selected = self.selectedChildren(obj)
diff --git a/src/orca/speech_generator.py b/src/orca/speech_generator.py
index 56744fb46..b82ef75a0 100644
--- a/src/orca/speech_generator.py
+++ b/src/orca/speech_generator.py
@@ -2011,7 +2011,7 @@ class SpeechGenerator(generator.Generator):
 
         result = []
         acss = self.voice(SYSTEM)
-        position, total = self._script.utilities.getPositionAndSetSize(obj)
+        position, total = self._script.utilities.getPositionAndSetSize(obj, **args)
         if position < 0 or total < 0:
             return []
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]