orca r3471 - in trunk: . src/orca



Author: richb
Date: Fri Jan 18 01:54:22 2008
New Revision: 3471
URL: http://svn.gnome.org/viewvc/orca?rev=3471&view=rev

Log:
        * src/orca/default.py:
          src/orca/braillegenerator.py:
          Fix for the part of bug #508153 that we are going to fix.
          If a column header is the same as the text associated with
          a table cell, then don't speak/braille the column header.


Modified:
   trunk/ChangeLog
   trunk/src/orca/braillegenerator.py
   trunk/src/orca/default.py

Modified: trunk/src/orca/braillegenerator.py
==============================================================================
--- trunk/src/orca/braillegenerator.py	(original)
+++ trunk/src/orca/braillegenerator.py	Fri Jan 18 01:54:22 2008
@@ -1189,6 +1189,8 @@
                 regions = [regions, cellFocusedRegion]
                 return regions
 
+        label = None
+
         # [[[TODO: WDW - Attempt to infer the cell type.  There's a
         # bunch of stuff we can do here, such as check the EXPANDABLE
         # state, check the NODE_CHILD_OF relation, etc.  Logged as
@@ -1219,17 +1221,20 @@
                         n = table.getColumnAtIndex(obj.getIndexInParent())
                         accHeader = table.getColumnHeader(n)
                         regions[0].append(braille.Region(" "))
-                        regions[0].append(braille.Region(accHeader.name))
+                        label = accHeader.name
+                        regions[0].append(braille.Region(label))
 
                     break
 
+        descendant = self._script.getRealActiveDescendant(obj)
         if len(regions) == 0:
-            regions = self._getDefaultBrailleRegions(
-                              self._script.getRealActiveDescendant(obj))
+            regions = self._getDefaultBrailleRegions(descendant)
         else:
-            [cellRegions, focusRegion] = self._getDefaultBrailleRegions(\
-                self._script.getRealActiveDescendant(obj))
-            regions[0].extend(cellRegions)
+            cellText = self._script.getDisplayedText(descendant)
+            if not cellText or (cellText and label != cellText):
+                [cellRegions, focusRegion] = \
+                    self._getDefaultBrailleRegions(descendant)
+                regions[0].extend(cellRegions)
 
         # Check to see if this table cell contains an icon (image).
         # If yes:

Modified: trunk/src/orca/default.py
==============================================================================
--- trunk/src/orca/default.py	(original)
+++ trunk/src/orca/default.py	Fri Jan 18 01:54:22 2008
@@ -2347,7 +2347,8 @@
                         topName = self.getTopLevelName(newLocusOfFocus)
                         if not topName.endswith(" - Thunderbird"):
                             desc = table.getColumnDescription(newCol)
-                            if desc and len(desc):
+                            cellText = self.getDisplayedText(newLocusOfFocus)
+                            if desc and len(desc) and cellText != desc:
                                 text = desc
                                 if settings.speechVerbosityLevel \
                                        == settings.VERBOSITY_LEVEL_VERBOSE:



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