Index: ChangeLog
===================================================================
--- ChangeLog	(revision 2118)
+++ ChangeLog	(working copy)
@@ -98,6 +98,21 @@
           def getDisplayedText(obj):
           def getTextLineAtCaret(obj):
 
+        * src/orca/scripts/Thunderbird.py:
+          src/orca/scripts/acroread.py:
+          src/orca/scripts/gnome-search-tool.py:
+          src/orca/util.py:
+          src/orca/speechgenerator.py:
+          src/orca/default.py:
+          src/orca/where_am_I.py:
+          src/orca/braillegenerator.py:
+          Another partial fix for bug #395548.
+
+          Moved:
+          def getFrame(obj):
+          def getTopLevel(obj):
+          def getTopLevelName(obj):
+
 2007-03-05  Rich Burridge <rich.burridge@sun.com>
 
         * src/orca/debug.py:
Index: src/orca/scripts/Thunderbird.py
===================================================================
--- src/orca/scripts/Thunderbird.py	(revision 2118)
+++ src/orca/scripts/Thunderbird.py	(working copy)
@@ -169,7 +169,7 @@
         """
         obj = event.source
         parent = obj.parent
-        top = util.getTopLevel(obj)
+        top = self.getTopLevel(obj)
         consume = False
 
         self._debug("onFocus: name='%s', role='%s'" % (obj.name, obj.role))
Index: src/orca/scripts/acroread.py
===================================================================
--- src/orca/scripts/acroread.py	(revision 2118)
+++ src/orca/scripts/acroread.py	(working copy)
@@ -208,7 +208,7 @@
             obj = obj.parent
         if util.isDesiredFocusedItem(obj, rolesList):
             inFindToolbar = True
-            findToolbarName = util.getFrame(obj).name
+            findToolbarName = self.getFrame(obj).name
     except:
         pass
 
Index: src/orca/scripts/gnome-search-tool.py
===================================================================
--- src/orca/scripts/gnome-search-tool.py	(revision 2111)
+++ src/orca/scripts/gnome-search-tool.py	(working copy)
@@ -136,7 +136,7 @@
             # list of files found, then get it now.
             #
             if not self.fileTable:
-                frame = util.getTopLevel(event.source)
+                frame = self.getTopLevel(event.source)
                 allTables = self.findByRole(frame, rolenames.ROLE_TABLE)
                 self.fileTable = allTables[0]
 
Index: src/orca/util.py
===================================================================
--- src/orca/util.py	(revision 2118)
+++ src/orca/util.py	(working copy)
@@ -668,65 +668,3 @@
 
     return (character in string.whitespace) \
            or (character in '!*+,-./:;<=>?@[\]^_{|}')
-
-def getFrame(obj):
-    """Returns the frame containing this object, or None if this object
-    is not inside a frame.
-
-    Arguments:
-    - obj: the Accessible object
-    """
-
-    debug.println(debug.LEVEL_FINEST,
-                  "Finding frame for source.name="
-                  + obj.accessibleNameToString())
-
-    while obj \
-          and (obj != obj.parent) \
-          and (obj.role != rolenames.ROLE_FRAME):
-        obj = obj.parent
-        debug.println(debug.LEVEL_FINEST, "--> obj.name="
-                      + obj.accessibleNameToString())
-
-    if obj and (obj.role == rolenames.ROLE_FRAME):
-        pass
-    else:
-        obj = None
-
-    return obj
-
-def getTopLevel(obj):
-    """Returns the top-level object (frame, dialog ...) containing this
-    object, or None if this object is not inside a top-level object.
-
-    Arguments:
-    - obj: the Accessible object
-    """
-
-    debug.println(debug.LEVEL_FINEST,
-                  "Finding top-level object for source.name="
-                  + obj.accessibleNameToString())
-
-    while obj \
-          and obj.parent \
-          and (obj != obj.parent) \
-          and (obj.parent.role != rolenames.ROLE_APPLICATION):
-        obj = obj.parent
-        debug.println(debug.LEVEL_FINEST, "--> obj.name="
-                      + obj.accessibleNameToString())
-
-    if obj and obj.parent and (obj.parent.role == rolenames.ROLE_APPLICATION):
-        pass
-    else:
-        obj = None
-
-    return obj
-
-def getTopLevelName(obj):
-    """ Returns the name of the top-level object. See getTopLevel.
-    """
-    top = getTopLevel(obj)
-    if (not top) or (not top.name):
-        return ""
-    else:
-        return top.name
Index: src/orca/speechgenerator.py
===================================================================
--- src/orca/speechgenerator.py	(revision 2118)
+++ src/orca/speechgenerator.py	(working copy)
@@ -1372,7 +1372,7 @@
         """
 
         title = None
-        frame = util.getFrame(obj)
+        frame = self._script.getFrame(obj)
         if frame:
             title = frame.name
         if not title:
Index: src/orca/default.py
===================================================================
--- src/orca/default.py	(revision 2118)
+++ src/orca/default.py	(working copy)
@@ -1655,7 +1655,7 @@
                     if (newCol != oldCol) or (oldParent != newParent):
                         # Don't speak Thunderbird column headers, since
                         # it's not possible to navigate across a row.
-                        topName = util.getTopLevelName(newLocusOfFocus)
+                        topName = self.getTopLevelName(newLocusOfFocus)
                         if not topName.endswith(" - Thunderbird"):
                             desc = newParent.table.getColumnDescription(newCol)
                             if desc and len(desc):
@@ -2377,7 +2377,7 @@
         if event.type == "object:state-changed:focused":
             iconified = False
             try:
-                window = util.getTopLevel(event.source)
+                window = self.getTopLevel(event.source)
                 iconified = window.state.count( \
                                      atspi.Accessibility.STATE_ICONIFIED)
             except:
@@ -3581,6 +3581,69 @@
 
         return displayedText
 
+    def getFrame(self, obj):
+        """Returns the frame containing this object, or None if this object
+        is not inside a frame.
+
+        Arguments:
+        - obj: the Accessible object
+        """
+
+        debug.println(debug.LEVEL_FINEST,
+                      "Finding frame for source.name="
+                      + obj.accessibleNameToString())
+
+        while obj \
+              and (obj != obj.parent) \
+              and (obj.role != rolenames.ROLE_FRAME):
+            obj = obj.parent
+            debug.println(debug.LEVEL_FINEST, "--> obj.name="
+                          + obj.accessibleNameToString())
+
+        if obj and (obj.role == rolenames.ROLE_FRAME):
+            pass
+        else:
+            obj = None
+
+        return obj
+
+    def getTopLevel(self, obj):
+        """Returns the top-level object (frame, dialog ...) containing this
+        object, or None if this object is not inside a top-level object.
+
+        Arguments:
+        - obj: the Accessible object
+        """
+
+        debug.println(debug.LEVEL_FINEST,
+                      "Finding top-level object for source.name="
+                      + obj.accessibleNameToString())
+
+        while obj \
+              and obj.parent \
+              and (obj != obj.parent) \
+              and (obj.parent.role != rolenames.ROLE_APPLICATION):
+            obj = obj.parent
+            debug.println(debug.LEVEL_FINEST, "--> obj.name="
+                          + obj.accessibleNameToString())
+
+        if obj and obj.parent and \
+           (obj.parent.role == rolenames.ROLE_APPLICATION):
+            pass
+        else:
+            obj = None
+
+        return obj
+
+    def getTopLevelName(self, obj):
+        """ Returns the name of the top-level object. See getTopLevel.
+        """
+        top = self.getTopLevel(obj)
+        if (not top) or (not top.name):
+            return ""
+        else:
+            return top.name
+
     def getTextLineAtCaret(self, obj):
         """Gets the line of text where the caret is.
 
Index: src/orca/where_am_I.py
===================================================================
--- src/orca/where_am_I.py	(revision 2118)
+++ src/orca/where_am_I.py	(working copy)
@@ -94,7 +94,7 @@
     if orcaKey:
         # Handle the Orca modifier key being pressed.
         if _getAppName() == "soffice.bin":
-            top = util.getTopLevel(obj)
+            top = orca_state.activeScript.getTopLevel(obj)
             if top and top.name.endswith(" Calc"):
                 _handleCalcOrcaKey(obj, doubleClick)
             else:
@@ -613,7 +613,7 @@
     they are being edited.
     """
     if _getAppName() == "soffice.bin":
-        top = util.getTopLevel(obj)
+        top = orca_state.activeScript.getTopLevel(obj)
         if top and top.name.endswith(" Calc"):
             _speakCalc(obj, doubleClick)
 
Index: src/orca/braillegenerator.py
===================================================================
--- src/orca/braillegenerator.py	(revision 2118)
+++ src/orca/braillegenerator.py	(working copy)
@@ -1199,7 +1199,7 @@
         self._debugGenerator("_getBrailleRegionsForTerminal", obj)
 
         title = None
-        frame = util.getFrame(obj)
+        frame = self._script.getFrame(obj)
         if frame:
             title = frame.name
         if not title:
