Index: src/orca/scripts/gedit.py
===================================================================
--- src/orca/scripts/gedit.py	(revision 3537)
+++ src/orca/scripts/gedit.py	(working copy)
@@ -27,6 +27,8 @@
 
 import pyatspi
 
+import orca.braille as braille
+import orca.braillegenerator as braillegenerator
 import orca.debug as debug
 import orca.default as default
 import orca.orca as orca
@@ -77,6 +79,49 @@
 
         return utterances
 
+class BrailleGenerator(braillegenerator.BrailleGenerator):
+    """Overrides _getBrailleRegionsForText so that we can tack on another
+    label in the page number text area of Print Preview.  See bug #133275.
+    """
+
+    def __init__(self, script):
+        braillegenerator.BrailleGenerator.__init__(self, script)
+
+    def _getBrailleRegionsForText(self, obj):
+        """Get the braille for a text component.
+
+        Arguments:
+        - obj: the text component
+
+        Returns a list where the first element is a list of Regions to display
+        and the second element is the Region which should get focus.
+        """
+
+        rolesList = [pyatspi.ROLE_TEXT,
+                     pyatspi.ROLE_FILLER,
+                     pyatspi.ROLE_PANEL,
+                     pyatspi.ROLE_TOOL_BAR,
+                     pyatspi.ROLE_FILLER,
+                     pyatspi.ROLE_FILLER,
+                     pyatspi.ROLE_PAGE_TAB,
+                     pyatspi.ROLE_PAGE_TAB_LIST]
+
+        if not self._script.isDesiredFocusedItem(obj, rolesList):
+            return braillegenerator.BrailleGenerator.\
+                       _getBrailleRegionsForText(self, obj)
+
+        regions = []
+
+        textRegion = braille.Text(obj)
+
+        regions.append(textRegion)
+
+        # We do not want the role at the end of text areas.
+
+        self._debugGenerator("GEdit._getBrailleRegionsForText", obj)
+
+        return [regions, textRegion]
+
 class Script(default.Script):
 
     def __init__(self, app):
@@ -110,6 +155,11 @@
         """
         return SpeechGenerator(self)
 
+    def getBrailleGenerator(self):
+        """Returns the braille generator for this script.
+        """
+        return BrailleGenerator(self)
+
     def getListeners(self):
         """Sets up the AT-SPI event listeners for this script.
         """
@@ -443,6 +493,33 @@
         default.Script.locusOfFocusChanged(self, event,
                                            oldLocusOfFocus, newLocusOfFocus)
 
+        # If we are doing a Print Preview and we are focused on the
+        # page number text area, also speak the "of n" labels to the
+        # right of this area. See bug #133275 for more details.
+        #
+        rolesList = [pyatspi.ROLE_TEXT,
+                     pyatspi.ROLE_FILLER,
+                     pyatspi.ROLE_PANEL,
+                     pyatspi.ROLE_TOOL_BAR,
+                     pyatspi.ROLE_FILLER,
+                     pyatspi.ROLE_FILLER,
+                     pyatspi.ROLE_PAGE_TAB,
+                     pyatspi.ROLE_PAGE_TAB_LIST]
+        if self.isDesiredFocusedItem(event.source, rolesList):
+            debug.println(self.debugLevel,
+                          "gedit.onStateChanged - print preview - page #.")
+            line = braille.getShowingLine()
+            parent = event.source.parent
+            label1 = self.getDisplayedText(parent[1])
+            label2 = self.getDisplayedText(parent[2])
+
+            utterances = [ label1, label2 ]
+            line.addRegion(braille.Region(" " + label1))
+            line.addRegion(braille.Region(" " + label2))
+
+            speech.speakUtterances(utterances)
+            braille.refresh()
+
     # This method tries to detect and handle the following cases:
     # 1) check spelling dialog.
     # 2) find dialog - phrase not found.
