Index: ChangeLog
===================================================================
--- ChangeLog	(revision 2140)
+++ ChangeLog	(working copy)
@@ -42,6 +42,13 @@
           src/orca/keybindings.py:
           Fixed bug #402494 – For statement refactoring.
 
+        * src/orca/scripts/planner.py:
+          src/orca/scripts/gcalctool.py:
+          src/orca/scripts/Thunderbird.py:
+          src/orca/scripts/StarOffice.py:
+          src/orca/Gecko.py:
+          Further adjustments to the refactoring done in bug #395548.
+
 2007-03-06  Lynn Monsanto <lynn.monsanto@sun.com>
 
         * test/harness/runone.sh, test/harness/runall.sh: Partial 
Index: src/orca/scripts/planner.py
===================================================================
--- src/orca/scripts/planner.py	(revision 2140)
+++ src/orca/scripts/planner.py	(working copy)
@@ -61,8 +61,8 @@
         self._debugGenerator("_getBrailleRegionsForRadioButton", obj)
 
         text = ""
-        text = self.appendString(text, self.getDisplayedLabel(obj))
-        text = self.appendString(text, self.getDisplayedText(obj))
+        text = self._script.appendString(text, self._script.getDisplayedLabel(obj))
+        text = self._script.appendString(text, self._script.getDisplayedText(obj))
 
         # First special toggle button is the one in the toolbar and
         # that it has no name Application should implement an
@@ -72,7 +72,7 @@
         #
         roleList = [rolenames.ROLE_TOGGLE_BUTTON, rolenames.ROLE_TOOL_BAR]
 
-        if self.isDesiredFocusedItem(obj, roleList) and not obj.name:
+        if self._script.isDesiredFocusedItem(obj, roleList) and not obj.name:
             text += _("Display more options")
 
         # Second special case is each one of the four graphics toggle
@@ -87,20 +87,20 @@
                      rolenames.ROLE_FILLER,\
                      rolenames.ROLE_PANEL,\
                      rolenames.ROLE_PANEL]
-        if self.isDesiredFocusedItem(obj, rolesList):
+        if self._script.isDesiredFocusedItem(obj, rolesList):
             debug.println(debug.LEVEL_FINEST,
                           "planner.onFocus - main window: " \
                           + "one of the four graphic toggle buttons.")
             filler = obj.parent
-            allLabels = self.findByRole(filler, rolenames.ROLE_LABEL)
+            allLabels = self._script.findByRole(filler, rolenames.ROLE_LABEL)
             text += allLabels[0].name
 
         if obj.state.count(atspi.Accessibility.STATE_CHECKED):
-            text = self.appendString(text, "&=y")
+            text = self._script.appendString(text, "&=y")
         else:
-            text = self.appendString(text, "& y")
+            text = self._script.appendString(text, "& y")
 
-        text = self.appendString(text, self._getTextForRole(obj))
+        text = self._script.appendString(text, self._getTextForRole(obj))
 
         regions = []
         componentRegion = braille.Component(obj, text)
@@ -132,7 +132,7 @@
         roleList=[rolenames.ROLE_TOGGLE_BUTTON,\
                   rolenames.ROLE_TOOL_BAR]
 
-        if self.isDesiredFocusedItem(obj, roleList) and not obj.name:
+        if self._script.isDesiredFocusedItem(obj, roleList) and not obj.name:
             if not already_focused:
                 tmp.append(_("Display more options"))
                 tmp.extend(self._getDefaultSpeech(obj, already_focused))
@@ -162,13 +162,13 @@
                     rolenames.ROLE_FILLER,\
                     rolenames.ROLE_PANEL,\
                     rolenames.ROLE_PANEL]
-        if self.isDesiredFocusedItem(obj, roleList):
+        if self._script.isDesiredFocusedItem(obj, roleList):
             debug.println(debug.LEVEL_FINEST,
                           "planner.onFocus - main window: " \
                           + "one of the four graphic toggle buttons.")
             if not already_focused:
                 filler = obj.parent
-                allLabels = self.findByRole(filler, rolenames.ROLE_LABEL)
+                allLabels = self._script.findByRole(filler, rolenames.ROLE_LABEL)
                 tmp.append(allLabels[0].name)
                 tmp.extend(self._getDefaultSpeech(obj, already_focused))
                 if obj.state.count(atspi.Accessibility.STATE_CHECKED):
Index: src/orca/scripts/gcalctool.py
===================================================================
--- src/orca/scripts/gcalctool.py	(revision 2140)
+++ src/orca/scripts/gcalctool.py	(working copy)
@@ -60,7 +60,7 @@
         if obj.name:
             name = obj.name
         else:
-            name = self.getDisplayedText(obj)
+            name = self._script.getDisplayedText(obj)
 
         if name:
             return [name]
Index: src/orca/scripts/Thunderbird.py
===================================================================
--- src/orca/scripts/Thunderbird.py	(revision 2140)
+++ src/orca/scripts/Thunderbird.py	(working copy)
@@ -112,8 +112,8 @@
 
             # Append the text and label. Skip displayed text
             # that starts with "chrome://"
-            text = self.getDisplayedText(parent)
-            label = self.getDisplayedLabel(parent)
+            text = self._script.getDisplayedText(parent)
+            label = self._script.getDisplayedLabel(parent)
             if text and (text != label) and len(text) \
                 and (not text.startswith("chrome://")):
                 utterances.append(text)
Index: src/orca/scripts/StarOffice.py
===================================================================
--- src/orca/scripts/StarOffice.py	(revision 2140)
+++ src/orca/scripts/StarOffice.py	(working copy)
@@ -337,14 +337,14 @@
                 inputLineForCell = locateInputLine(obj)
 
             regions = []
-            text = self.getDisplayedText(obj)
+            text = self._script.getDisplayedText(obj)
             componentRegion = braille.Component(obj, text)
             regions.append(componentRegion)
 
             # If the spread sheet table cell has something in it, then we
             # want to append the name of the cell (which will be its location).
-            # Note that if the cell was empty, then self.getDisplayedText will
-            # have already done this for us.
+            # Note that if the cell was empty, then 
+            # self._script.getDisplayedText will have already done this for us.
             #
             if obj.text:
                 objectText = self._script.getText(obj, 0, -1)
Index: src/orca/Gecko.py
===================================================================
--- src/orca/Gecko.py	(revision 2140)
+++ src/orca/Gecko.py	(working copy)
@@ -169,8 +169,8 @@
         #
         text = ""
         if not self._script.inDocumentContent():
-            text = self.appendString(text, self.getDisplayedLabel(obj))
-            text = self.appendString(text, self.getDisplayedText(obj))
+            text = self._script.appendString(text, self._script.getDisplayedLabel(obj))
+            text = self._script.appendString(text, self._script.getDisplayedText(obj))
         else:
             isLabelled = False
             relations = obj.relations
@@ -181,14 +181,14 @@
                         isLabelled = True
                         break
             if not isLabelled and obj.name and len(obj.name):
-                text = self.appendString(text, obj.name)
+                text = self._script.appendString(text, obj.name)
 
         if obj.state.count(atspi.Accessibility.STATE_CHECKED):
-            text = self.appendString(text, "<x>")
+            text = self._script.appendString(text, "<x>")
         else:
-            text = self.appendString(text, "< >")
+            text = self._script.appendString(text, "< >")
 
-        text = self.appendString(text, self._getTextForRole(obj))
+        text = self._script.appendString(text, self._getTextForRole(obj))
 
         regions = []
         componentRegion = braille.Component(obj, text)
@@ -220,7 +220,7 @@
         # class - we'll give this thing a name here, and we'll make it
         # be the name of the autocomplete.
         #
-        label = self.getDisplayedLabel(parent)
+        label = self._script.getDisplayedLabel(parent)
         if not label or not len(label):
             label = parent.name
 
@@ -251,7 +251,7 @@
         # set, we will use it as the label of the combo box.  Otherwise,
         # we'll fall back to the accessible name.
         #
-        label = self.getDisplayedLabel(obj)
+        label = self._script.getDisplayedLabel(obj)
         if not label:
             label = obj.name
 
@@ -320,8 +320,8 @@
         regions = []
 
         text = ""
-        text = self.appendString(text, self.getDisplayedLabel(obj))
-        text = self.appendString(text, self.getDisplayedText(obj))
+        text = self._script.appendString(text, self._script.getDisplayedLabel(obj))
+        text = self._script.appendString(text, self._script.getDisplayedText(obj))
 
         # If there's no text for the link, expose part of the
         # link to the user if the image is in a link.
@@ -334,10 +334,10 @@
                 for region in linkRegions:
                     text += region.string
         elif link:
-            text = self.appendString(text, self._getTextForRole(link))
+            text = self._script.appendString(text, self._getTextForRole(link))
 
-        text = self.appendString(text, self._getTextForValue(obj))
-        text = self.appendString(text, self._getTextForRole(obj))
+        text = self._script.appendString(text, self._getTextForValue(obj))
+        text = self._script.appendString(text, self._getTextForRole(obj))
 
         regions = []
         componentRegion = braille.Component(obj, text)
@@ -361,8 +361,8 @@
         regions = []
 
         text = ""
-        text = self.appendString(text, self.getDisplayedLabel(obj))
-        text = self.appendString(text, self.getDisplayedText(obj))
+        text = self._script.appendString(text, self._script.getDisplayedLabel(obj))
+        text = self._script.appendString(text, self._script.getDisplayedText(obj))
 
         # If there's no text for the link, expose part of the
         # URI to the user.
@@ -372,8 +372,8 @@
             if basename:
                 text = basename
 
-        text = self.appendString(text, self._getTextForValue(obj))
-        text = self.appendString(text, self._getTextForRole(obj))
+        text = self._script.appendString(text, self._getTextForValue(obj))
+        text = self._script.appendString(text, self._getTextForRole(obj))
 
         regions = []
         componentRegion = braille.Component(obj, text)
@@ -455,14 +455,14 @@
         # class - we'll give this thing a name here, and we'll make it
         # be the name of the autocomplete.
         #
-        label = self.getDisplayedLabel(parent)
+        label = self._script.getDisplayedLabel(parent)
         if not label or not len(label):
             label = parent.name
         utterances.append(label)
 
         utterances.extend(self._getSpeechForObjectRole(obj))
 
-        [text, caretOffset, startOffset] = self.getTextLineAtCaret(obj)
+        [text, caretOffset, startOffset] = self._script.getTextLineAtCaret(obj)
         utterances.append(text)
 
         self._debugGenerator("Gecko._getSpeechForText",
@@ -491,7 +491,7 @@
         # set, we will use it as the label of the combo box.  Otherwise,
         # we'll fall back to the accessible name.
         #
-        label = self.getDisplayedLabel(obj)
+        label = self._script.getDisplayedLabel(obj)
         if not label:
             label = obj.name
 
@@ -698,14 +698,14 @@
                 unicodeText = displayedText.decode("UTF-8")
                 if unicodeText \
                     and (len(unicodeText) == 1) \
-                    and (unicodeText[0] == self.EMBEDDED_OBJECT_CHARACTER):
+                    and (unicodeText[0] == self._script.EMBEDDED_OBJECT_CHARACTER):
                     parent = parent.parent
                     continue
 
             # Finally, put in the text and label (if they exist)
             #
-            text = self.getDisplayedText(parent)
-            label = self.getDisplayedLabel(parent)
+            text = self._script.getDisplayedText(parent)
+            label = self._script.getDisplayedLabel(parent)
             if text and (text != label) and len(text):
                 utterances.append(text)
             if label and len(label):
