Index: src/orca/scripts/StarOffice.py
===================================================================
--- src/orca/scripts/StarOffice.py	(revision 2824)
+++ src/orca/scripts/StarOffice.py	(working copy)
@@ -251,8 +251,9 @@
         table = self._script.getTable(obj)
         parent = obj.parent
 
-        if parent.__dict__.has_key("lastColumn") and \
-           parent.lastColumn != parent.table.getColumnAtIndex(obj.index):
+        if self._script.pointOfReference.has_key("lastColumn") and \
+              self._script.pointOfReference["lastColumn"] != \
+              parent.table.getColumnAtIndex(obj.index):
             if self._script.dynamicColumnHeaders.has_key(table):
                 row = self._script.dynamicColumnHeaders[table]
                 header = self._script.getDynamicRowHeaderCell(obj, row)
@@ -267,8 +268,9 @@
                     if text:
                         regions.append(braille.Region(" " + text + " "))
 
-        if parent.__dict__.has_key("lastRow") and \
-           parent.lastRow != parent.table.getRowAtIndex(obj.index):
+        if self._script.pointOfReference.has_key("lastRow") and \
+              self._script.pointOfReference['lastRow'] != \
+              parent.table.getRowAtIndex(obj.index):
             if self._script.dynamicRowHeaders.has_key(table):
                 column = self._script.dynamicRowHeaders[table]
                 header = self._script.getDynamicColumnHeaderCell(obj, column)
@@ -305,11 +307,13 @@
                 # the same row).
                 #
                 speakAll = True
-                if parent.__dict__.has_key("lastRow") and \
-                    parent.__dict__.has_key("lastColumn"):
-                    speakAll = (parent.lastRow != row) or \
+                if self._script.pointOfReference.has_key("lastRow") and \
+                    self._script.pointOfReference.has_key("lastColumn"):
+                    pointOfReference = self._script.pointOfReference
+                    speakAll = \
+                        (pointOfReference["lastRow"] != row) or \
                            ((row == 0 or row == parent.table.nRows-1) and \
-                            parent.lastColumn == column)
+                            pointOfReference["lastColumn"] == column)
 
                 if speakAll:
                     focusRowRegion = None
@@ -513,8 +517,8 @@
             table = self._script.getTable(obj)
             parent = obj.parent
 
-            if parent.__dict__.has_key("lastColumn") and \
-               parent.lastColumn != \
+            if self._script.pointOfReference.has_key("lastColumn") and \
+               self._script.pointOfReference["lastColumn"] != \
                parent.table.getColumnAtIndex(obj.index):
                 if self._script.dynamicColumnHeaders.has_key(table):
                     row = self._script.dynamicColumnHeaders[table]
@@ -530,8 +534,9 @@
                         if text:
                             utterances.append(text)
 
-            if parent.__dict__.has_key("lastRow") and \
-               parent.lastRow != parent.table.getRowAtIndex(obj.index):
+            if self._script.pointOfReference.has_key("lastRow") and \
+               self._script.pointOfReference["lastRow"] != \
+               parent.table.getRowAtIndex(obj.index):
                 if self._script.dynamicRowHeaders.has_key(table):
                     column = self._script.dynamicRowHeaders[table]
                     header = self._script.getDynamicColumnHeaderCell(obj,
@@ -560,11 +565,12 @@
                     # the same row).
                     #
                     speakAll = True
-                    if parent.__dict__.has_key("lastRow") and \
-                        parent.__dict__.has_key("lastColumn"):
-                        speakAll = (parent.lastRow != row) or \
+                    if self._script.pointOfReference.has_key("lastRow") and \
+                        self._script.pointOfReference.has_key("lastColumn"):
+                        pointOfReference = self._script.pointOfReference
+                        speakAll = (pointOfReference["lastRow"] != row) or \
                                ((row == 0 or row == parent.table.nRows-1) and \
-                                parent.lastColumn == column)
+                                pointOfReference["lastColumn"] == column)
 
                     if speakAll:
                         [startIndex, endIndex] = \
Index: src/orca/speechgenerator.py
===================================================================
--- src/orca/speechgenerator.py	(revision 2824)
+++ src/orca/speechgenerator.py	(working copy)
@@ -1403,11 +1403,12 @@
                 # the same row).
                 #
                 speakAll = True
-                if parent.__dict__.has_key("lastRow") and \
-                    parent.__dict__.has_key("lastColumn"):
-                    speakAll = (parent.lastRow != row) or \
-                           ((row == 0 or row == parent.table.nRows-1) and \
-                            parent.lastColumn == column)
+                if self._script.pointOfReference.has_key("lastRow") and \
+                    self._script.pointOfReference.has_key("lastColumn"):
+                    pointOfReference = self._script.pointOfReference
+                    speakAll = (pointOfReference["lastRow"] != row) or \
+                        ((row == 0 or row == parent.table.nRows-1) and \
+                           pointOfReference["lastColumn"] == column)
 
                 if speakAll:
                     for i in range(0, parent.table.nColumns):
Index: src/orca/default.py
===================================================================
--- src/orca/default.py	(revision 2824)
+++ src/orca/default.py	(working copy)
@@ -2141,6 +2141,19 @@
         else:
             newParent = None
 
+        # Clear the point of reference.
+        # If the point of reference is a cell, we want to keep the 
+        # table-related points of reference.
+        if oldParent == newParent and \
+              getattr(newParent, 'role', None) == rolenames.ROLE_TABLE:
+          oldPointOfReference = self.pointOfReference
+          self.pointOfReference = {}
+          for key, value in oldPointOfReference.iteritems():
+            if key in ('lastRow', 'lastColumn'):
+              self.pointOfReference[key] = value
+        else:
+          self.pointOfReference = {}
+
         if newLocusOfFocus:
             self.updateBraille(newLocusOfFocus)
 
@@ -2296,9 +2309,9 @@
                 if newParent and newParent.table:
                     table = newParent.table
                     column = table.getColumnAtIndex(newLocusOfFocus.index)
-                    newParent.lastColumn = column
+                    self.pointOfReference['lastColumn'] = column
                     row = table.getRowAtIndex(newLocusOfFocus.index)
-                    newParent.lastRow = row
+                    self.pointOfReference['lastRow'] = row
         else:
             orca_state.noFocusTimeStamp = time.time()
 
@@ -2605,7 +2618,7 @@
         mods = orca_state.lastInputEvent.modifiers
         isControlKey = mods & (1 << atspi.Accessibility.MODIFIER_CONTROL)
         isShiftKey = mods & (1 << atspi.Accessibility.MODIFIER_SHIFT)
-        hasLastPos = event.source.__dict__.has_key("lastCursorPosition")
+        hasLastPos = self.pointOfReference.has_key("lastCursorPosition")
 
         if (string == "Up") or (string == "Down"):
             # If the user has typed Shift-Up or Shift-Down, then we want
@@ -2614,7 +2627,8 @@
             # currently positioned.
             #
             if hasLastPos and isShiftKey and not isControlKey:
-                self.sayPhrase(event.source, event.source.lastCursorPosition,
+                self.sayPhrase(event.source, 
+                               self.pointOfReference["lastCursorPosition"],
                                event.source.text.caretOffset)
             else:
                 self.sayLine(event.source)
@@ -2627,7 +2641,8 @@
             # the character at the text cursor position.
             #
             if hasLastPos and isShiftKey and isControlKey:
-                self.sayPhrase(event.source, event.source.lastCursorPosition,
+                self.sayPhrase(event.source, 
+                               self.pointOfReference["lastCursorPosition"],
                                event.source.text.caretOffset)
             elif isControlKey:
                 self.sayWord(event.source)
@@ -2642,7 +2657,8 @@
             # position otherwise we speak the current line.
             #
             if hasLastPos and isShiftKey and isControlKey:
-                self.sayPhrase(event.source, event.source.lastCursorPosition,
+                self.sayPhrase(event.source, 
+                               self.pointOfReference["lastCursorPosition"],
                                event.source.text.caretOffset)
             elif isControlKey:
                 self.sayCharacter(event.source)
@@ -2656,7 +2672,8 @@
             # the current line.
             #
             if hasLastPos and isShiftKey and isControlKey:
-                self.sayPhrase(event.source, event.source.lastCursorPosition,
+                self.sayPhrase(event.source, 
+                               self.pointOfReference["lastCursorPosition"],
                                event.source.text.caretOffset)
             else:
                 self.sayLine(event.source)
@@ -2669,7 +2686,8 @@
             # to the right of the current text cursor position.
             #
             if hasLastPos and isShiftKey and not isControlKey:
-                self.sayPhrase(event.source, event.source.lastCursorPosition,
+                self.sayPhrase(event.source, 
+                               self.pointOfReference["lastCursorPosition"],
                                event.source.text.caretOffset)
             elif isControlKey:
                 self.sayLine(event.source)
@@ -6040,10 +6058,12 @@
             #
             speech.speak(Q_("text|selected"), None, False)
         else:
-            if obj.__dict__.has_key("lastSelections"):
-                for i in range(0, len(obj.lastSelections)):
-                    startSelOffset = obj.lastSelections[0][0]
-                    endSelOffset = obj.lastSelections[0][1]
+            if self.pointOfReference.has_key("lastSelections"):
+                for i in xrange(len(self.pointOfReference["lastSelections"])):
+                    startSelOffset = \
+                        self.pointOfReference["lastSelections"][0][0]
+                    endSelOffset = \
+                        self.pointOfReference["lastSelections"][0][1]
                     if (startOffset >= startSelOffset) \
                         and (endOffset <= endSelOffset):
                         # Translators: when the user unselects
@@ -6058,10 +6078,11 @@
         # Save away the current text cursor position and list of text
         # selections for next time.
         #
-        obj.lastCursorPosition = obj.text.caretOffset
-        obj.lastSelections = []
+        self.pointOfReference["lastCursorPosition"] = obj.text.caretOffset
+        self.pointOfReference["lastSelections"] = []
         for i in range(0, obj.text.getNSelections()):
-            obj.lastSelections.append(obj.text.getSelection(i))
+            self.pointOfReference["lastSelections"].append(
+              obj.text.getSelection(i))
 
     def getURI(self, obj):
         """Return the URI for a given link object.
Index: src/orca/script.py
===================================================================
--- src/orca/script.py	(revision 2824)
+++ src/orca/script.py	(working copy)
@@ -77,6 +77,7 @@
         self.presentIfInactive = True
 
         self.inputEventHandlers = {}
+        self.pointOfReference = {}
         self.setupInputEventHandlers()
         self.keyBindings = self.getKeyBindings()
         self.brailleBindings = self.getBrailleBindings()
Index: src/orca/braillegenerator.py
===================================================================
--- src/orca/braillegenerator.py	(revision 2824)
+++ src/orca/braillegenerator.py	(working copy)
@@ -1292,11 +1292,12 @@
             # the same row).
             #
             speakAll = True
-            if parent.__dict__.has_key("lastRow") and \
-                parent.__dict__.has_key("lastColumn"):
-                speakAll = (parent.lastRow != row) or \
+            if self._script.pointOfReference.has_key("lastRow") and \
+                self._script.pointOfReference.has_key("lastColumn"):
+                pointOfReference = self._script.pointOfReference
+                speakAll = (pointOfReference["lastRow"] != row) or \
                        ((row == 0 or row == parent.table.nRows-1) and \
-                        parent.lastColumn == column)
+                        pointOfReference["lastColumn"] == column)
 
             if speakAll:
                 focusRowRegion = None
