[orca] Try to filter out widget labels from truly unrelated labels



commit 396bbea0f8fc2530baf98f80bf4c7d10e05e8aea
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Sun Apr 29 10:44:27 2018 -0400

    Try to filter out widget labels from truly unrelated labels

 src/orca/script_utilities.py |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/src/orca/script_utilities.py b/src/orca/script_utilities.py
index 45f9f9c..2d2772a 100644
--- a/src/orca/script_utilities.py
+++ b/src/orca/script_utilities.py
@@ -2271,12 +2271,17 @@ class Utilities:
         except:
             return []
 
-        # Eliminate duplicates
+        rootName = root.name
+
+        # Eliminate duplicates and things suspected to be labels for widgets
         d = {}
         for label in labels:
-            if label.name and label.name in [root.name, label.parent.name]:
+            name = label.name
+            if name and name in [rootName, label.parent.name]:
+                continue
+            if len(name.split()) < 3:
                 continue
-            d[label.name] = label
+            d[name] = label
         labels = list(d.values())
 
         return sorted(labels, key=functools.cmp_to_key(self.spatialComparison))


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