[orca] Remove the non-performant, buggy heuristic hack to find displayed labels



commit 6eafb4115f1a8ff3e31a231a7710196c0fb2e0b7
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Sat May 10 15:33:19 2014 -0400

    Remove the non-performant, buggy heuristic hack to find displayed labels

 src/orca/script_utilities.py |   78 ------------------------------------------
 1 files changed, 0 insertions(+), 78 deletions(-)
---
diff --git a/src/orca/script_utilities.py b/src/orca/script_utilities.py
index 224bfb6..6a20c0e 100644
--- a/src/orca/script_utilities.py
+++ b/src/orca/script_utilities.py
@@ -966,84 +966,6 @@ class Utilities:
                     if not target in allTargets:
                         allTargets.append(target)
                         label.append(target)
-
-        # [[[TODO: HACK - we've discovered oddness in hierarchies such as
-        # the gedit Edit->Preferences dialog.  In this dialog, we have
-        # labeled groupings of objects.  The grouping is done via a FILLER
-        # with two children - one child is the overall label, and the
-        # other is the container for the grouped objects.  When we detect
-        # this, we add the label to the overall context.
-        #
-        # We are also looking for objects which have a PANEL or a FILLER as
-        # parent, and its parent has more children. Through these children,
-        # a potential label with LABEL_FOR relation may exists. We want to
-        # present this label.
-        # This case can be seen in FileChooserDemo application, in Open dialog
-        # window, the line with "Look In" label, a combobox and some
-        # presentation buttons.
-        #
-        # Finally, we are searching the hierarchy of embedded components for
-        # children that are labels.]]]
-        #
-        if not len(label):
-            potentialLabels = []
-            useLabel = False
-            if (obj.getRole() == pyatspi.ROLE_EMBEDDED):
-                candidate = obj
-                while candidate.childCount:
-                    candidate = candidate[0]
-                # The parent of this object may contain labels
-                # or it may contain filler that contains labels.
-                #
-                candidate = candidate.parent
-                for child in candidate:
-                    if child.getRole() == pyatspi.ROLE_FILLER:
-                        candidate = child
-                        break
-                # If there are labels in this embedded component,
-                # they should be here.
-                #
-                for child in candidate:
-                    if child.getRole() == pyatspi.ROLE_LABEL:
-                        useLabel = True
-                        potentialLabels.append(child)
-            elif ((obj.getRole() == pyatspi.ROLE_FILLER) \
-                    or (obj.getRole() == pyatspi.ROLE_PANEL)) \
-                and (obj.childCount == 2):
-                child0, child1 = obj
-                child0_role = child0.getRole()
-                child1_role = child1.getRole()
-                if child0_role == pyatspi.ROLE_LABEL \
-                    and not self.__hasLabelForRelation(child0) \
-                    and child1_role in [pyatspi.ROLE_FILLER, \
-                                             pyatspi.ROLE_PANEL]:
-                    useLabel = True
-                    potentialLabels.append(child0)
-                elif child1_role == pyatspi.ROLE_LABEL \
-                    and not self.__hasLabelForRelation(child1) \
-                    and child0_role in [pyatspi.ROLE_FILLER, \
-                                             pyatspi.ROLE_PANEL]:
-                    useLabel = True
-                    potentialLabels.append(child1)
-            else:
-                parent = obj.parent
-                try:
-                    parentRole = parent.getRole()
-                except:
-                    parentRole = None
-                if parentRole in [pyatspi.ROLE_FILLER, pyatspi.ROLE_PANEL]:
-                    for potentialLabel in parent:
-                        try:
-                            useLabel = self.__isLabeling(potentialLabel, obj)
-                            if useLabel:
-                                potentialLabels.append(potentialLabel)
-                                break
-                        except:
-                            pass
-
-            if useLabel and len(potentialLabels):
-                label = potentialLabels
-
         return label
 
     @staticmethod


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