[orca] Eliminate some false positives in the label inference code



commit 378e64a0af015ee3cb3741c9069a32a87fd8b4da
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Wed Dec 24 11:55:22 2014 -0500

    Eliminate some false positives in the label inference code

 src/orca/label_inference.py |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/src/orca/label_inference.py b/src/orca/label_inference.py
index 00423c2..3025bd4 100644
--- a/src/orca/label_inference.py
+++ b/src/orca/label_inference.py
@@ -174,7 +174,7 @@ class LabelInference:
         if not obj:
             return True
 
-        nonLabelTextRoles = [pyatspi.ROLE_HEADING]
+        nonLabelTextRoles = [pyatspi.ROLE_HEADING, pyatspi.ROLE_LIST_ITEM]
         if obj.getRole() in nonLabelTextRoles:
             return True
 
@@ -317,7 +317,9 @@ class LabelInference:
         onLeft = contents[0:index]
         start = 0
         for i in range(len(onLeft) - 1, -1, -1):
-            if self._cannotLabel(onLeft[i][0]):
+            lObj, lStart, lEnd, lString = onLeft[i]
+            lExtents = self._getExtents(lObj)
+            if lExtents[0] > extents[0] or self._cannotLabel(lObj):
                 start = i + 1
                 break
 


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