Index: src/orca/flat_review.py
===================================================================
--- src/orca/flat_review.py	(revision 3082)
+++ src/orca/flat_review.py	(working copy)
@@ -150,13 +150,15 @@
                  accessible,
                  string,
                  x, y,
-                 width, height):
+                 width, height,
+                 role=None):
         """Creates a new Zone, which is a horizontal region of text.
 
         Arguments:
         - accessible: the Accessible associated with this Zone
         - string: the string being displayed for this Zone
         - extents: x, y, width, height in screen coordinates
+        - role: Role to override accesible's role.
         """
 
         self.accessible = accessible
@@ -166,6 +168,7 @@
         self.y = y
         self.width = width
         self.height = height
+        self.role = role or accessible.getRole()
 
     def __getattr__(self, attr):
         """Used for lazily determining the words in a Zone.
@@ -284,8 +287,9 @@
     def __init__(self,
                  accessible,
                  x, y,
-                 width, height):
-        Zone.__init__(self, accessible, "", x, y, width, height)
+                 width, height,
+                 role=None):
+        Zone.__init__(self, accessible, "", x, y, width, height, role)
 
         # Force the use of __getattr__ so we get the actual state
         # of the accessible each time we look at the 'string' field.
@@ -300,10 +304,10 @@
                 stateCount = 1
             else:
                 stateCount = 0
-            if self.accessible.getRole() in [pyatspi.ROLE_CHECK_BOX,
-                                        pyatspi.ROLE_CHECK_MENU_ITEM,
-                                        pyatspi.ROLE_CHECK_MENU,
-                                        pyatspi.ROLE_TABLE_CELL]:
+            if self.role in [pyatspi.ROLE_CHECK_BOX,
+                             pyatspi.ROLE_CHECK_MENU_ITEM,
+                             pyatspi.ROLE_CHECK_MENU,
+                             pyatspi.ROLE_TABLE_CELL]:
                 if stateCount:
                     # Translators: this represents the state of a checkbox.
                     #
@@ -314,7 +318,7 @@
                     speechState = _("not checked")
                 brailleState = \
                     settings.brailleCheckBoxIndicators[stateCount]
-            elif self.accessible.getRole() == pyatspi.ROLE_TOGGLE_BUTTON:
+            elif self.role == pyatspi.ROLE_TOGGLE_BUTTON:
                 if stateCount:
                     # Translators: the state of a toggle button.
                     #
@@ -359,8 +363,9 @@
     def __init__(self,
                  accessible,
                  x, y,
-                 width, height):
-        Zone.__init__(self, accessible, "", x, y, width, height)
+                 width, height,
+                 role=None):
+        Zone.__init__(self, accessible, "", x, y, width, height, role)
 
         # Force the use of __getattr__ so we get the actual state
         # of the accessible each time we look at the 'string' field.
@@ -370,8 +375,8 @@
     def __getattr__(self, attr):
         if attr in ["string", "length", "brailleString"]:
             orientation = None
-            if self.accessible.getRole() in [pyatspi.ROLE_SLIDER,
-                                        pyatspi.ROLE_SCROLL_BAR]:
+            if self.role in [pyatspi.ROLE_SLIDER,
+                             pyatspi.ROLE_SCROLL_BAR]:
                 stateset = self.accessible.getState()
                 if stateset.contains(pyatspi.STATE_HORIZONTAL):
                     # Translators: The component orientation is horizontal.
@@ -924,7 +929,7 @@
 
         return zones
 
-    def _insertStateZone(self, zones, accessible):
+    def _insertStateZone(self, zones, accessible, role=None):
         """If the accessible presents non-textual state, such as a
         checkbox or radio button, insert a StateZone representing
         that state."""
@@ -932,12 +937,13 @@
         zone = None
         stateOnLeft = True
 
-        if accessible.getRole() in [pyatspi.ROLE_CHECK_BOX,
-                               pyatspi.ROLE_CHECK_MENU_ITEM,
-                               pyatspi.ROLE_CHECK_MENU,
-                               pyatspi.ROLE_RADIO_BUTTON,
-                               pyatspi.ROLE_RADIO_MENU_ITEM,
-                               pyatspi.ROLE_RADIO_MENU]:
+        role = role or accessible.getRole()
+        if role in [pyatspi.ROLE_CHECK_BOX,
+                    pyatspi.ROLE_CHECK_MENU_ITEM,
+                    pyatspi.ROLE_CHECK_MENU,
+                    pyatspi.ROLE_RADIO_BUTTON,
+                    pyatspi.ROLE_RADIO_MENU_ITEM,
+                    pyatspi.ROLE_RADIO_MENU]:
 
             # Attempt to infer if the indicator is to the left or
             # right of the text.
@@ -965,7 +971,7 @@
             zone = StateZone(accessible,
                              stateX, stateY, stateWidth, stateHeight)
 
-        elif accessible.getRole() ==  pyatspi.ROLE_TOGGLE_BUTTON:
+        elif role ==  pyatspi.ROLE_TOGGLE_BUTTON:
             # [[[TODO: WDW - This is a major hack.  We make up an
             # indicator for a toggle button to let the user know
             # whether a toggle button is pressed or not.]]]
@@ -974,7 +980,7 @@
             zone = StateZone(accessible,
                              extents.x, extents.y, 1, extents.height)
 
-        elif accessible.getRole() == pyatspi.ROLE_TABLE_CELL \
+        elif role == pyatspi.ROLE_TABLE_CELL \
             and accessible.queryAction():
             # Handle table cells that act like check boxes.
             #
@@ -985,11 +991,7 @@
                     hasToggle = True
                     break
             if hasToggle:
-                #savedRole = accessible.getRole()
-                # TODO pyatspi integration. what to do with these two things?
-             #   accessible.role = pyatspi.ROLE_CHECK_BOX
-                self._insertStateZone(zones, accessible)
-             #   accessible.role = savedRole
+                self._insertStateZone(zones, accessible, pyatspi.ROLE_CHECK_BOX)
 
         if zone:
             if stateOnLeft:
Index: src/orca/speechgenerator.py
===================================================================
--- src/orca/speechgenerator.py	(revision 3082)
+++ src/orca/speechgenerator.py	(working copy)
@@ -221,9 +221,9 @@
         else:
             return []
 
-    def _getSpeechForObjectRole(self, obj):
+    def _getSpeechForObjectRole(self, obj, role=None):
         if (obj.getRole() != pyatspi.ROLE_UNKNOWN):
-            return [rolenames.getSpeechForRoleName(obj)]
+            return [rolenames.getSpeechForRoleName(obj, role)]
         else:
             return []
 
@@ -251,7 +251,7 @@
             debug.println(debug.LEVEL_FINER,
                       "               (%s)" % text)
 
-    def _getDefaultSpeech(self, obj, already_focused):
+    def _getDefaultSpeech(self, obj, already_focused, role=None):
         """Gets a list of utterances to be spoken for the current
         object's name, role, and any accelerators.  This is usually the
         fallback speech generator should no other specialized speech
@@ -264,6 +264,8 @@
         Arguments:
         - obj: an Accessible
         - already_focused: False if object just received focus
+        - role: A role that should be used instead of the Accessible's 
+          possible role.
 
         Returns a list of utterances to be spoken for the object.
         """
@@ -276,7 +278,7 @@
             name = self._getSpeechForObjectName(obj)
             if name != label:
                 utterances.extend(name)
-            utterances.extend(self._getSpeechForObjectRole(obj))
+            utterances.extend(self._getSpeechForObjectRole(obj, role))
 
         utterances.extend(self._getSpeechForObjectAvailability(obj))
 
@@ -395,7 +397,9 @@
             name = self._getSpeechForObjectName(obj)
             if name != label:
                 utterances.extend(name)
-            utterances.extend(self._getSpeechForObjectRole(obj))
+            utterances.extend(
+                self._getSpeechForObjectRole(
+                   obj, pyatspi.ROLE_CHECK_BOX))
             utterances.append(checkedState)
             utterances.extend(self._getSpeechForObjectAvailability(obj))
         else:
@@ -642,7 +646,9 @@
                 utterances.append(description)
 
         if settings.speechVerbosityLevel == settings.VERBOSITY_LEVEL_VERBOSE:
-            utterances.append(rolenames.getSpeechForRoleName(obj))
+            utterances.append(
+              rolenames.getSpeechForRoleName(
+                obj, pyatspi.ROLE_CHECK_BOX))
 
         self._debugGenerator("_getSpeechForIcon",
                              obj,
@@ -661,7 +667,8 @@
         Returns a list of utterances to be spoken for the object.
         """
 
-        utterances = self._getDefaultSpeech(obj, already_focused)
+        utterances = self._getDefaultSpeech(
+            obj, already_focused, pyatspi.ROLE_IMAGE)
 
         self._debugGenerator("_getSpeechForImage",
                              obj,
@@ -1331,10 +1338,8 @@
                     "speechgenerator.__getTableCellUtterances " \
                     + "looking at action %d" % i)
                 if action.getName(i) == "toggle":
-#                    obj.role = rolenames.ROLE_CHECK_BOX
                     utterances = self._getSpeechForCheckBox(obj,
                                                             already_focused)
-#                    obj.role = rolenames.ROLE_TABLE_CELL
                     break
 
         displayedText = self._script.getDisplayedText( \
@@ -1349,12 +1354,10 @@
         # See bug #465989 for more details.
         #
         # [[TODO: eitani - incorprate this in new rolenames ]]
-        # if (not displayedText or len(displayedText) == 0) and obj.image:
-        #     if obj.image.imageDescription:
-        #         utterances.append(obj.image.imageDescription)
-        #     obj.role = rolenames.ROLE_IMAGE
-        #     utterances.extend(self._getSpeechForImage(obj, already_focused))
-        #     obj.role = rolenames.ROLE_TABLE_CELL
+        if (not displayedText or len(displayedText) == 0) and obj.image:
+            if obj.image.imageDescription:
+                utterances.append(obj.image.imageDescription)
+            utterances.extend(self._getSpeechForImage(obj, already_focused))
 
         state = obj.getState()
         if state.contains(pyatspi.STATE_EXPANDABLE):
Index: src/orca/rolenames.py
===================================================================
--- src/orca/rolenames.py	(revision 3082)
+++ src/orca/rolenames.py	(working copy)
@@ -1215,7 +1215,7 @@
                 pyatspi_role = getattr(pyatspi, sym)
                 rolenames[pyatspi_role] = rolenames[key]
 
-def getSpeechForRoleName(obj):
+def getSpeechForRoleName(obj, role=None):
     """Returns the localized name of the given Accessible object; the name is
     suitable to be spoken.  If a localized name cannot be discovered, this
     will return the string as defined by the at-spi.
@@ -1226,18 +1226,7 @@
     Returns a string containing the localized name of the object suitable
     to be spoken.
     """
-    role = obj.getRole()
-    # Speak out a check box if the table cell is checkable.
-    if role == pyatspi.ROLE_TABLE_CELL:
-        try:
-            action = obj.queryAction()
-        except NotImplementedError:
-            supported_actions = []
-        else:
-            supported_actions = \
-                [action.getName(i) for i in xrange(action.nActions)]
-        if 'toggle' in supported_actions:
-            role = pyatspi.ROLE_CHECK_BOX
+    role = role or obj.getRole()
 
     # Return fake "menu" role names.
     #[[[TODO: eitani - Discontinue ]]
@@ -1261,7 +1250,7 @@
         else:
             return repr(role)
 
-def getShortBrailleForRoleName(obj):
+def getShortBrailleForRoleName(obj, role=None):
     """Returns the localized name of the given Accessible object; the name is
     a short string suitable for a Braille display.  If a localized name cannot
     be discovered, this will return the string as defined by the at-spi.
@@ -1272,9 +1261,8 @@
     Returns a short string containing the localized name of the object
     suitable for a Braille display.
     """
+    role = role or obj.getRole()
 
-    role = obj.getRoe()
-
     # Return fake "menu" role names.
     #[[[TODO: eitani - Discontinue ]]
     if (role == pyatspi.ROLE_CHECK_MENU_ITEM) \
@@ -1297,7 +1285,7 @@
         else:
             return repr(role)
 
-def getLongBrailleForRoleName(obj):
+def getLongBrailleForRoleName(obj, role=None):
     """Returns the localized name of the given Accessible object; the name is
     a long string suitable for a Braille display.  If a localized name cannot
     be discovered, this will return the string as defined by the at-spi.
@@ -1308,7 +1296,7 @@
     Returns a string containing the localized name of the object suitable for
     a Braille display.
     """
-    role = obj.getRole()
+    role = role or obj.getRole()
 
     # Return fake "menu" role names.
     #[[[TODO: eitani - Discontinue ]]
@@ -1335,7 +1323,7 @@
 
 
 
-def getBrailleForRoleName(obj):
+def getBrailleForRoleName(obj, role=None):
     """Returns the localized name of the given Accessible object; the name is
     a string suitable for a Braille display.  If a localized name cannot
     be discovered, this will return the string as defined by the at-spi.
@@ -1349,6 +1337,6 @@
     """
 
     if settings.brailleRolenameStyle == settings.BRAILLE_ROLENAME_STYLE_SHORT:
-        return getShortBrailleForRoleName(obj)
+        return getShortBrailleForRoleName(obj, role)
     else:
-        return getLongBrailleForRoleName(obj)
+        return getLongBrailleForRoleName(obj, role)
Index: src/orca/where_am_I.py
===================================================================
--- src/orca/where_am_I.py	(revision 3082)
+++ src/orca/where_am_I.py	(working copy)
@@ -1131,11 +1131,9 @@
         else:
             for i in range(0, action.nActions):
                 if action.getName(i) == "toggle":
-                    #obj.role = rolenames.ROLE_CHECK_BOX
                     state = obj.getState()
                     if not state.contains(pyatspi.STATE_CHECKED):
                         notChecked = True
-                    #obj.role = rolenames.ROLE_TABLE_CELL
                     break
 
         if notChecked:
Index: src/orca/braillegenerator.py
===================================================================
--- src/orca/braillegenerator.py	(revision 3082)
+++ src/orca/braillegenerator.py	(working copy)
@@ -261,11 +261,11 @@
         #
         return valueString
 
-    def _getTextForRole(self, obj):
+    def _getTextForRole(self, obj, role=None):
         if (settings.brailleVerbosityLevel \
             == settings.VERBOSITY_LEVEL_VERBOSE)\
            and (obj.getRole() != pyatspi.ROLE_UNKNOWN):
-            return rolenames.getBrailleForRoleName(obj)
+            return rolenames.getBrailleForRoleName(obj, role)
         else:
             return None
 
@@ -285,7 +285,7 @@
         debug.println(debug.LEVEL_FINER,
                       "           role            = %s" % obj.getRoleName())
 
-    def _getDefaultBrailleRegions(self, obj):
+    def _getDefaultBrailleRegions(self, obj, role=None):
         """Gets text to be displayed for the current object's name,
         role, and any accelerators.  This is usually the fallback
         braille generator should no other specialized braille
@@ -293,6 +293,7 @@
 
         Arguments:
         - obj: an Accessible
+        - role: Role to use as an override.
 
         Returns a list where the first element is a list of Regions to
         display and the second element is the Region which should get
@@ -309,7 +310,7 @@
         text = self._script.appendString(
             text, self._script.getDisplayedText(obj))
         text = self._script.appendString(text, self._getTextForValue(obj))
-        text = self._script.appendString(text, self._getTextForRole(obj))
+        text = self._script.appendString(text, self._getTextForRole(obj, role))
 
         regions = []
         componentRegion = braille.Component(obj, text)
@@ -401,7 +402,8 @@
         text = self._script.appendString(
             text, self._script.getDisplayedText(obj))
 
-        text = self._script.appendString(text, self._getTextForRole(obj))
+        text = self._script.appendString(
+            text, self._getTextForRole(obj, pyatspi.ROLE_CHECK_BOX))
 
         regions = []
         componentRegion = braille.Component(obj, text)
@@ -639,7 +641,7 @@
 
         self._debugGenerator("_getBrailleRegionsForImage", obj)
 
-        return self._getDefaultBrailleRegions(obj)
+        return self._getDefaultBrailleRegions(obj, pyatspi.ROLE_IMAGE)
 
     def _getBrailleRegionsForLabel(self, obj):
         """Get the braille for a label.
@@ -1234,9 +1236,6 @@
                     "braillegenerator._getBrailleRegionsForTableCell " \
                     + "looking at action %d" % i)
                 if action.getName(i) == "toggle":
-                    # I think this deserves a WTF. Why are we assignig a role 
-                    # to an accessible? Is there no better way of doing this?
-                    # obj.role = pyatspi.ROLE_CHECK_BOX
                     regions = self._getBrailleRegionsForCheckBox(obj)
 
                     # If this table cell doesn't have any label associated
@@ -1254,8 +1253,6 @@
                         regions[0].append(braille.Region(" "))
                         regions[0].append(braille.Region(accHeader.name))
 
-                    # See WTF above.
-                    # obj.role = pyatspi.ROLE_TABLE_CELL
                     break
 
         if len(regions) == 0:
@@ -1278,10 +1275,8 @@
         if (not displayedText or len(displayedText) == 0) and obj.image:
             if obj.image.imageDescription:
                 regions[0].append(obj.image.imageDescription)
-            obj.role = rolenames.ROLE_IMAGE
             [cellRegions, focusRegion] = self._getBrailleRegionsForImage(obj)
             regions[0].extend(cellRegions)
-            obj.role = rolenames.ROLE_TABLE_CELL
 
         # [[[TODO: WDW - HACK attempt to determine if this is a node;
         # if so, describe its state.]]]
