From fb9c2b46ff92771245fdb6a62e0d46647462f0a3 Mon Sep 17 00:00:00 2001
From: Vardhan <vardhanvarma@gmail.com>
Date: Mon, 14 Oct 2013 03:49:40 -0700
Subject: [PATCH 01/13] Adding excel constants in msoffice_constants.py

---
 source/NVDAObjects/window/msoffice_constants.py | 105 ++++++++++++++++++++++++
 1 file changed, 105 insertions(+)
 create mode 100644 source/NVDAObjects/window/msoffice_constants.py

diff --git a/source/NVDAObjects/window/msoffice_constants.py b/source/NVDAObjects/window/msoffice_constants.py
new file mode 100644
index 0000000..457473f
--- /dev/null
+++ b/source/NVDAObjects/window/msoffice_constants.py
@@ -0,0 +1,105 @@
+# office_constants.py
+# Usage : from office_constants import *
+# xlFooBar.get( an_integer )
+# returns text to be spoken
+# Translators: full of small phrases. 
+
+
+class xlConstant(object):
+	@classmethod
+	def get(cls,x):
+		try:
+			return cls._map[x]
+		except:
+			return str(x)
+
+class xlBordersIndex(xlConstant):
+	xlDiagonalDown                =5
+	xlDiagonalUp                  =6
+	xlEdgeBottom                  =9
+	xlEdgeLeft                    =7
+	xlEdgeRight                   =10
+	xlEdgeTop                     =8
+	xlInsideHorizontal            =12
+	xlInsideVertical              =11
+	_map = {
+		xlDiagonalDown                :_("diagonal down"),
+		xlDiagonalUp                  :_("diagonal up"),
+		xlEdgeBottom                  :_("edge bottom"),
+		xlEdgeLeft                    :_("edge left"),
+		xlEdgeRight                   :_("edge right"),
+		xlEdgeTop                     :_("edge top"),
+		xlInsideHorizontal            :_("inside horizontal"),
+		xlInsideVertical              :_("inside vertical"),
+	}
+	_list = [ xlEdgeBottom, xlEdgeLeft, xlEdgeRight,xlEdgeTop ]
+
+class xlHAlign(xlConstant):
+	xlHAlignCenter                =-4108
+	xlHAlignCenterAcrossSelection =7
+	xlHAlignDistributed           =-4117
+	xlHAlignFill                  =5
+	xlHAlignGeneral               =1
+	xlHAlignJustify               =-4130
+	xlHAlignLeft                  =-4131
+	xlHAlignRight                 =-4152
+
+	_map = {
+		xlHAlignCenter                :_("center"),
+		xlHAlignCenterAcrossSelection :_("center across selection"),
+		xlHAlignDistributed           :_("distributed"),
+		xlHAlignFill                  :_("fill"),
+		xlHAlignGeneral               :_("general"),
+		xlHAlignJustify               :_("justify "),
+		xlHAlignLeft                  :_("left"),
+		xlHAlignRight                 :_("right "),
+	}
+
+class xlVAlign(xlConstant):
+	xlVAlignBottom                =-4107
+	xlVAlignCenter                =-4108
+	xlVAlignDistributed           =-4117
+	xlVAlignJustify               =-4130
+	xlVAlignTop                   =-4160
+
+	_map = {
+		xlVAlignBottom                :_("bottom"),
+		xlVAlignCenter                :_("center"),
+		xlVAlignDistributed           :_("distributed"),
+		xlVAlignJustify               :_("justify"),
+		xlVAlignTop                   :_("top"),
+	}
+
+class xlBordersWeight(xlConstant):
+	xlHairline                    =1
+	xlMedium                      =-4138
+	xlThick                       =4
+	xlThin                        =2
+	_map = {
+		xlHairline                    :_("hair line"),
+		xlMedium                      :_("medium "),
+		xlThick                       :_("thick"),
+		xlThin                        :_("thin"),
+	}
+	
+class xlLineStyle(xlConstant):
+	xlContinuous                  =1
+	xlDash                        =-4115
+	xlDashDot                     =4
+	xlDashDotDot                  =5
+	xlDot                         =-4118
+	xlDouble                      =-4119
+	xlLineStyleNone               =-4142
+	xlSlantDashDot                =13
+
+	_map = {
+		xlContinuous                  :_("continous"),
+		xlDash                        :_("dash"),
+		xlDashDot                     :_("dash dot"),
+		xlDashDotDot                  :_("dash dot dot"),
+		xlDot                         :_("dot"),
+		xlDouble                      :_("double"),
+		xlLineStyleNone               :_("none"),
+		xlSlantDashDot                :_("slant dash dot"),
+	}
+	
-- 
1.9.0.msysgit.0


From 9fbfca021acc2cee3007c5bb0e9910ef547512be Mon Sep 17 00:00:00 2001
From: Vardhan <vardhanvarma@gmail.com>
Date: Mon, 14 Oct 2013 04:53:08 -0700
Subject: [PATCH 02/13] script state coutnter for cells,

generic way for scripts in ExcelCell to keep a state counter
and provide different actions on succesive key presses.
Reset to zeroth state if user moves to different cell
---
 source/NVDAObjects/window/excel.py | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/source/NVDAObjects/window/excel.py b/source/NVDAObjects/window/excel.py
index a87bae6..1a89424 100755
--- a/source/NVDAObjects/window/excel.py
+++ b/source/NVDAObjects/window/excel.py
@@ -304,6 +304,25 @@ class ExcelCell(ExcelBase):
 		if previous:
 			return ExcelCell(windowHandle=self.windowHandle,excelWindowObject=self.excelWindowObject,excelCellObject=previous)
 
+	lastCell = ""
+	script_states = { }
+
+	def resetStatesIfCellChanged(self):
+		""" resets all states if user has moved to a different cell """
+		if self.lastCell != self.excelCellObject.Address(False,False,1,False):
+			self.lastCell = self.excelCellObject.Address(False,False,1,False)
+			self.script_states = { }
+
+	def nextState(self, script_name, highest_value):
+		""" Usage: st = self.nextState('foo',2), goes 0/1/2/0/1/2.. on succesive calls """
+		try:
+			val = self.script_states[script_name]
+			val = val + 1 if val < highest_value else 0
+		except:
+			val = 0
+		self.script_states[script_name] = val
+		return val
+
 	__gestures = {
 		"kb:NVDA+shift+c": "setColumnHeaderRow",
 		"kb:NVDA+shift+r": "setRowHeaderColumn",
-- 
1.9.0.msysgit.0


From 314493203aae63a2f4c08dd66f7d0eca09a78e26 Mon Sep 17 00:00:00 2001
From: Vardhan <vardhanvarma@gmail.com>
Date: Mon, 14 Oct 2013 03:49:40 -0700
Subject: [PATCH 03/13] Adding excel constants in msoffice_constants.py

---
 source/NVDAObjects/window/msoffice_constants.py | 105 ++++++++++++++++++++++++
 1 file changed, 105 insertions(+)
 create mode 100644 source/NVDAObjects/window/msoffice_constants.py

diff --git a/source/NVDAObjects/window/msoffice_constants.py b/source/NVDAObjects/window/msoffice_constants.py
new file mode 100644
index 0000000..457473f
--- /dev/null
+++ b/source/NVDAObjects/window/msoffice_constants.py
@@ -0,0 +1,105 @@
+# office_constants.py
+# Usage : from office_constants import *
+# xlFooBar.get( an_integer )
+# returns text to be spoken
+# Translators: full of small phrases. 
+
+
+class xlConstant(object):
+	@classmethod
+	def get(cls,x):
+		try:
+			return cls._map[x]
+		except:
+			return str(x)
+
+class xlBordersIndex(xlConstant):
+	xlDiagonalDown                =5
+	xlDiagonalUp                  =6
+	xlEdgeBottom                  =9
+	xlEdgeLeft                    =7
+	xlEdgeRight                   =10
+	xlEdgeTop                     =8
+	xlInsideHorizontal            =12
+	xlInsideVertical              =11
+	_map = {
+		xlDiagonalDown                :_("diagonal down"),
+		xlDiagonalUp                  :_("diagonal up"),
+		xlEdgeBottom                  :_("edge bottom"),
+		xlEdgeLeft                    :_("edge left"),
+		xlEdgeRight                   :_("edge right"),
+		xlEdgeTop                     :_("edge top"),
+		xlInsideHorizontal            :_("inside horizontal"),
+		xlInsideVertical              :_("inside vertical"),
+	}
+	_list = [ xlEdgeBottom, xlEdgeLeft, xlEdgeRight,xlEdgeTop ]
+
+class xlHAlign(xlConstant):
+	xlHAlignCenter                =-4108
+	xlHAlignCenterAcrossSelection =7
+	xlHAlignDistributed           =-4117
+	xlHAlignFill                  =5
+	xlHAlignGeneral               =1
+	xlHAlignJustify               =-4130
+	xlHAlignLeft                  =-4131
+	xlHAlignRight                 =-4152
+
+	_map = {
+		xlHAlignCenter                :_("center"),
+		xlHAlignCenterAcrossSelection :_("center across selection"),
+		xlHAlignDistributed           :_("distributed"),
+		xlHAlignFill                  :_("fill"),
+		xlHAlignGeneral               :_("general"),
+		xlHAlignJustify               :_("justify "),
+		xlHAlignLeft                  :_("left"),
+		xlHAlignRight                 :_("right "),
+	}
+
+class xlVAlign(xlConstant):
+	xlVAlignBottom                =-4107
+	xlVAlignCenter                =-4108
+	xlVAlignDistributed           =-4117
+	xlVAlignJustify               =-4130
+	xlVAlignTop                   =-4160
+
+	_map = {
+		xlVAlignBottom                :_("bottom"),
+		xlVAlignCenter                :_("center"),
+		xlVAlignDistributed           :_("distributed"),
+		xlVAlignJustify               :_("justify"),
+		xlVAlignTop                   :_("top"),
+	}
+
+class xlBordersWeight(xlConstant):
+	xlHairline                    =1
+	xlMedium                      =-4138
+	xlThick                       =4
+	xlThin                        =2
+	_map = {
+		xlHairline                    :_("hair line"),
+		xlMedium                      :_("medium "),
+		xlThick                       :_("thick"),
+		xlThin                        :_("thin"),
+	}
+	
+class xlLineStyle(xlConstant):
+	xlContinuous                  =1
+	xlDash                        =-4115
+	xlDashDot                     =4
+	xlDashDotDot                  =5
+	xlDot                         =-4118
+	xlDouble                      =-4119
+	xlLineStyleNone               =-4142
+	xlSlantDashDot                =13
+
+	_map = {
+		xlContinuous                  :_("continous"),
+		xlDash                        :_("dash"),
+		xlDashDot                     :_("dash dot"),
+		xlDashDotDot                  :_("dash dot dot"),
+		xlDot                         :_("dot"),
+		xlDouble                      :_("double"),
+		xlLineStyleNone               :_("none"),
+		xlSlantDashDot                :_("slant dash dot"),
+	}
+	
-- 
1.9.0.msysgit.0


From 3172841f68d166aafdd9c1e4bceeaed42470f578 Mon Sep 17 00:00:00 2001
From: Vardhan <vardhanvarma@gmail.com>
Date: Mon, 14 Oct 2013 04:53:08 -0700
Subject: [PATCH 04/13] script state coutnter for cells,

generic way for scripts in ExcelCell to keep a state counter
and provide different actions on succesive key presses.
Reset to zeroth state if user moves to different cell
---
 source/NVDAObjects/window/excel.py | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/source/NVDAObjects/window/excel.py b/source/NVDAObjects/window/excel.py
index 6b0120a..fc74c6b 100755
--- a/source/NVDAObjects/window/excel.py
+++ b/source/NVDAObjects/window/excel.py
@@ -358,6 +358,25 @@ class ExcelCell(ExcelBase):
 		if previous:
 			return ExcelCell(windowHandle=self.windowHandle,excelWindowObject=self.excelWindowObject,excelCellObject=previous)
 
+	lastCell = ""
+	script_states = { }
+
+	def resetStatesIfCellChanged(self):
+		""" resets all states if user has moved to a different cell """
+		if self.lastCell != self.excelCellObject.Address(False,False,1,False):
+			self.lastCell = self.excelCellObject.Address(False,False,1,False)
+			self.script_states = { }
+
+	def nextState(self, script_name, highest_value):
+		""" Usage: st = self.nextState('foo',2), goes 0/1/2/0/1/2.. on succesive calls """
+		try:
+			val = self.script_states[script_name]
+			val = val + 1 if val < highest_value else 0
+		except:
+			val = 0
+		self.script_states[script_name] = val
+		return val
+
 	__gestures = {
 		"kb:NVDA+shift+c": "setColumnHeaderRow",
 		"kb:NVDA+shift+r": "setRowHeaderColumn",
-- 
1.9.0.msysgit.0


From bfed83dd7bcc6d5a05c8331ac38cf6920d388ea0 Mon Sep 17 00:00:00 2001
From: Vardhan <vardhanvarma@gmail.com>
Date: Thu, 21 Nov 2013 02:04:05 -0800
Subject: [PATCH 05/13] adding xlCellType

---
 source/NVDAObjects/window/msoffice_constants.py | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/source/NVDAObjects/window/msoffice_constants.py b/source/NVDAObjects/window/msoffice_constants.py
index 457473f..09e7aa8 100644
--- a/source/NVDAObjects/window/msoffice_constants.py
+++ b/source/NVDAObjects/window/msoffice_constants.py
@@ -103,3 +103,27 @@ class xlLineStyle(xlConstant):
 		xlSlantDashDot                :_("slant dash dot"),
 	}
 	
+class xlCellType(xlConstant):
+	xlCellTypeAllFormatConditions =-4172      # from enum XlCellType
+	xlCellTypeAllValidation       =-4174      # from enum XlCellType
+	xlCellTypeBlanks              =4          # from enum XlCellType
+	xlCellTypeComments            =-4144      # from enum XlCellType
+	xlCellTypeConstants           =2          # from enum XlCellType
+	xlCellTypeFormulas            =-4123      # from enum XlCellType
+	xlCellTypeLastCell            =11         # from enum XlCellType
+	xlCellTypeSameFormatConditions=-4173      # from enum XlCellType
+	xlCellTypeSameValidation      =-4175      # from enum XlCellType
+	xlCellTypeVisible             =12         # from enum XlCellType
+
+	_map = { 
+		xlCellTypeAllFormatConditions :_("any format"),
+		xlCellTypeAllValidation       :_("validatio"),
+		xlCellTypeBlanks              :_("empty cells"),
+		xlCellTypeComments            :_("comments"),
+		xlCellTypeConstants           :_("constants"),
+		xlCellTypeFormulas            :_("formulat"),
+		xlCellTypeLastCell            :_("last cell"),
+		xlCellTypeSameFormatConditions:_("same format conditions"),
+		xlCellTypeSameValidation      :_("same validation"),
+		xlCellTypeVisible             :_("visible"),
+	}
-- 
1.9.0.msysgit.0


From aa2f85c8b23a5311c57a39f0b5fbd1a2f9bb829b Mon Sep 17 00:00:00 2001
From: Vardhan <vardhanvarma@gmail.com>
Date: Wed, 27 Nov 2013 23:58:06 -0800
Subject: [PATCH 06/13] NVDA+f7 showing cells with comment and formula

---
 source/NVDAObjects/window/excel.py | 112 ++++++++++++++++++++++++++++++++++++-
 1 file changed, 111 insertions(+), 1 deletion(-)

diff --git a/source/NVDAObjects/window/excel.py b/source/NVDAObjects/window/excel.py
index fc74c6b..e42591f 100755
--- a/source/NVDAObjects/window/excel.py
+++ b/source/NVDAObjects/window/excel.py
@@ -25,6 +25,7 @@ from . import Window
 from .. import NVDAObjectTextInfo
 import scriptHandler
 
+from msoffice_constants import  xlCellType
 xlA1 = 1
 xlRC = 2
 
@@ -104,6 +105,18 @@ class ExcelWorksheet(ExcelBase):
 		self.fireFocusOnSelection()
 	script_changeSelection.canPropagate=True
 
+        def script_cellSelectionPopup(self, gesture):
+		# We need this to be a modal dialog, but it mustn't block this script.
+                def run():
+                        gui.mainFrame.prePopup()
+                        d = CellsListDialog(self.excelWorksheetObject.Cells)
+                        d.ShowModal()
+                        d.Destroy()
+                        gui.mainFrame.postPopup()
+                wx.CallAfter(run)
+                
+	script_cellSelectionPopup.canPropagate=True
+
 	__changeSelectionGestures = (
 		"kb:tab",
 		"kb:shift+tab",
@@ -138,7 +151,10 @@ class ExcelWorksheet(ExcelBase):
 		"kb:control+a",
 		"kb:control+v",
 	)
-
+	__gestures={
+		"kb:NVDA+f7":"cellSelectionPopup",
+        }
+                
 class ExcelCellTextInfo(NVDAObjectTextInfo):
 
 	def _getFormatFieldAndOffsets(self,offset,formatConfig,calculateOffsets=True):
@@ -520,3 +536,97 @@ class ExcelMergedCell(ExcelCell):
 
 	def _get_cellCoordsText(self):
 		return self.getCellAddress(self.excelCellObject.mergeArea)
+
+class CellsListDialog(wx.Dialog):
+        
+        ## View modes, flat, tree etc.
+        modeRegionColCell = 0
+        modeRegionRowCell = 1
+        modeRegionCell = 2
+        modeCell = 3
+        modes = { #modeCell : _("Cells (Flat)"),
+                  modeRegionCell : _("Area / Cell"),
+                  #modeRegionRowCell : _("Area / Row / Cell"),
+                  #modeRegionColCell : _("Area / Col / Cell"),
+        }
+        types = { 
+                xlCellType.xlCellTypeComments : xlCellType.get(xlCellType.xlCellTypeComments),
+                xlCellType.xlCellTypeFormulas : xlCellType.get(  xlCellType.xlCellTypeFormulas  ),
+        }
+        
+
+        def populate(self,evt):
+                type = self.typeCombo.GetClientData(self.typeCombo.GetSelection())
+                mode = self.viewCombo.GetClientData(self.viewCombo.GetSelection())
+                self.tree.DeleteChildren(self.treeRoot)
+                if type == xlCellType.xlCellTypeComments :
+                        fn = lambda x: x.Comment.Text()
+                elif type == xlCellType.xlCellTypeFormulas :
+                        fn = lambda x: x.Formula
+                else:
+                        fn = lambda x: x.Text
+                try:
+                        wholerange = self.cells.SpecialCells(type)
+                        areacount = wholerange.Areas.Count
+                        thisarea = 0
+                        for range in wholerange.Areas:
+                                thisarea += 1
+                                ## Make Node for Range
+                                first=range.Item(1).Address(False,False,1,False)
+                                last=range.Cells.Item(range.Cells.Count).Address(False,False,1,False)
+                                text ="Area from {first} to {last}".format(first=first,last=last)
+                                this = self.tree.AppendItem(self.treeRoot,text)
+                                for cell in range.Cells:
+                                        text= cell.address(False,False,1,False) + " " + fn(cell)
+                                        self.tree.AppendItem(this,text)
+                except (COMError):
+                        self.tree.AppendItem(self.treeRoot,_("No matching cells"))
+                
+	def __init__(self, cells):
+
+		# Translators: The title of the browse mode Elements List dialog.
+                self.cells = cells
+		super(CellsListDialog, self).__init__(gui.mainFrame, wx.ID_ANY, _("Cell List"))
+		mainSizer = wx.BoxSizer(wx.VERTICAL)
+                
+		typeSizer=wx.BoxSizer(wx.HORIZONTAL)                
+		typeLabel=wx.StaticText(self,-1,label=_("Cells to &show:"))
+                self.typeCombo = wx.Choice(self,wx.ID_ANY)
+                for x in self.types.keys():
+                        self.typeCombo.Append(self.types[x],x)
+                self.typeCombo.SetSelection(0)
+                self.typeCombo.Bind(wx.EVT_CHOICE,self.populate)
+                typeSizer.Add(typeLabel)
+                typeSizer.Add(self.typeCombo)
+                mainSizer.Add(typeSizer)
+
+		viewSizer=wx.BoxSizer(wx.HORIZONTAL)                
+		viewLabel=wx.StaticText(self,-1,label=_("Viewing &mode"))
+                self.viewCombo = wx.Choice(self,wx.ID_ANY)
+                for x in self.modes.keys():
+                        self.viewCombo.Append(self.modes[x],x)
+                self.viewCombo.SetSelection(0)
+                self.viewCombo.Bind(wx.EVT_CHOICE,self.populate)
+                viewSizer.Add(viewLabel)
+                viewSizer.Add(self.viewCombo)
+                mainSizer.Add(viewSizer)
+
+		self.tree = wx.TreeCtrl(self, wx.ID_ANY, style=wx.TR_HAS_BUTTONS | wx.TR_HIDE_ROOT | wx.TR_SINGLE)
+		#self.tree.Bind(wx.EVT_SET_FOCUS, self.onTreeSetFocus)
+		#self.tree.Bind(wx.EVT_CHAR, self.onTreeChar)
+		self.treeRoot = self.tree.AddRoot("root")
+		mainSizer.Add(self.tree,proportion=7,flag=wx.EXPAND)
+
+		sizer = wx.BoxSizer(wx.HORIZONTAL)
+		sizer.Add(wx.Button(self, wx.ID_CANCEL))
+		mainSizer.Add(sizer,proportion=1)
+
+		mainSizer.Fit(self)
+		self.SetSizer(mainSizer)
+
+		self.treeRoot = self.tree.AddRoot("Root")
+		
+		#self.range = range
+		#self.tree.ExpandAll()
+		#self.tree.SetFocus()
+
-- 
1.9.0.msysgit.0


From 9047183565aadc7d7717e54e9777882353838e80 Mon Sep 17 00:00:00 2001
From: Vardhan <vardhanvarma@gmail.com>
Date: Tue, 3 Dec 2013 09:44:33 -0800
Subject: [PATCH 07/13] fixed some spellings

---
 source/NVDAObjects/window/msoffice_constants.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/source/NVDAObjects/window/msoffice_constants.py b/source/NVDAObjects/window/msoffice_constants.py
index 09e7aa8..06668e8 100644
--- a/source/NVDAObjects/window/msoffice_constants.py
+++ b/source/NVDAObjects/window/msoffice_constants.py
@@ -118,10 +118,10 @@ class xlCellType(xlConstant):
 	_map = { 
 		xlCellTypeAllFormatConditions :_("any format"),
 		xlCellTypeAllValidation       :_("validatio"),
-		xlCellTypeBlanks              :_("empty cells"),
-		xlCellTypeComments            :_("comments"),
-		xlCellTypeConstants           :_("constants"),
-		xlCellTypeFormulas            :_("formulat"),
+		xlCellTypeBlanks              :_("empty cell"),
+		xlCellTypeComments            :_("comment"),
+		xlCellTypeConstants           :_("constant"),
+		xlCellTypeFormulas            :_("formula"),
 		xlCellTypeLastCell            :_("last cell"),
 		xlCellTypeSameFormatConditions:_("same format conditions"),
 		xlCellTypeSameValidation      :_("same validation"),
-- 
1.9.0.msysgit.0


From 7cf1b29176b970cc8a5fa30fc7309da7e65b9209 Mon Sep 17 00:00:00 2001
From: Vardhan <vardhanvarma@gmail.com>
Date: Tue, 3 Dec 2013 10:41:54 -0800
Subject: [PATCH 08/13] Enter will close dialog and select area/cell

---
 source/NVDAObjects/window/excel.py | 30 +++++++++++++++++++++---------
 1 file changed, 21 insertions(+), 9 deletions(-)

diff --git a/source/NVDAObjects/window/excel.py b/source/NVDAObjects/window/excel.py
index 01b5fd8..94eac4e 100755
--- a/source/NVDAObjects/window/excel.py
+++ b/source/NVDAObjects/window/excel.py
@@ -598,20 +598,32 @@ class CellsListDialog(wx.Dialog):
                 try:
                         wholerange = self.cells.SpecialCells(type)
                         areacount = wholerange.Areas.Count
-                        thisarea = 0
                         for range in wholerange.Areas:
-                                thisarea += 1
                                 ## Make Node for Range
                                 first=range.Item(1).Address(False,False,1,False)
                                 last=range.Cells.Item(range.Cells.Count).Address(False,False,1,False)
                                 text ="Area from {first} to {last}".format(first=first,last=last)
-                                this = self.tree.AppendItem(self.treeRoot,text)
+                                this = self.tree.AppendItem(self.treeRoot,text,data=wx.TreeItemData(range))
                                 for cell in range.Cells:
-                                        text= cell.address(False,False,1,False) + " " + fn(cell)
-                                        self.tree.AppendItem(this,text)
+                                        addr = cell.address(False,False,1,False)
+                                        text= addr + " " + fn(cell)
+                                        self.tree.AppendItem(this,text,data=wx.TreeItemData(cell))
                 except (COMError):
                         self.tree.AppendItem(self.treeRoot,_("No matching cells"))
                 
+        def onTreeChar(self,evt):
+                if evt.GetKeyCode() == wx.WXK_RETURN:
+                        range = self.tree.GetPyData(self.tree.GetSelection())
+                        range.Select()
+                        self.Close()
+                        #first=range.Item(1).Address(False,False,1,False)
+                        #last=range.Cells.Item(range.Cells.Count).Address(False,False,1,False)
+                        #text ="Area from {first} to {last}".format(first=first,last=last)
+                        #self.tree.AppendItem(self.treeRoot,text)
+                        
+                        pass
+                evt.Skip()
+
 	def __init__(self, cells):
 
 		# Translators: The title of the browse mode Elements List dialog.
@@ -644,19 +656,19 @@ class CellsListDialog(wx.Dialog):
 		self.tree = wx.TreeCtrl(self, wx.ID_ANY, style=wx.TR_HAS_BUTTONS | wx.TR_HIDE_ROOT | wx.TR_SINGLE)
 		#self.tree.Bind(wx.EVT_SET_FOCUS, self.onTreeSetFocus)
 		#self.tree.Bind(wx.EVT_CHAR, self.onTreeChar)
+		self.tree.Bind(wx.EVT_CHAR, self.onTreeChar)
 		self.treeRoot = self.tree.AddRoot("root")
 		mainSizer.Add(self.tree,proportion=7,flag=wx.EXPAND)
 
 		sizer = wx.BoxSizer(wx.HORIZONTAL)
 		sizer.Add(wx.Button(self, wx.ID_CANCEL))
+		#sizer.Add(wx.Button(self, wx.ID_OK))
 		mainSizer.Add(sizer,proportion=1)
 
 		mainSizer.Fit(self)
 		self.SetSizer(mainSizer)
 
 		self.treeRoot = self.tree.AddRoot("Root")
-		
-		#self.range = range
-		#self.tree.ExpandAll()
-		#self.tree.SetFocus()
+		self.populate(None)
+		self.tree.SetFocus()
 
-- 
1.9.0.msysgit.0


From 779cf7081f386195fae295389957cba0a1493399 Mon Sep 17 00:00:00 2001
From: Vardhan <vardhanvarma@gmail.com>
Date: Wed, 22 Jan 2014 11:10:10 +0530
Subject: [PATCH 09/13] Viewing modes added to Cell List Dilog

---
 source/NVDAObjects/window/excel.py | 210 ++++++++++++++++++++-----------------
 1 file changed, 116 insertions(+), 94 deletions(-)

diff --git a/source/NVDAObjects/window/excel.py b/source/NVDAObjects/window/excel.py
index 94eac4e..b5cf971 100755
--- a/source/NVDAObjects/window/excel.py
+++ b/source/NVDAObjects/window/excel.py
@@ -149,16 +149,16 @@ class ExcelWorksheet(ExcelBase):
 			eventHandler.executeEvent('gainFocus',newSelection)
 	script_changeSelection.canPropagate=True
 
-        def script_cellSelectionPopup(self, gesture):
+	def script_cellSelectionPopup(self, gesture):
 		# We need this to be a modal dialog, but it mustn't block this script.
-                def run():
-                        gui.mainFrame.prePopup()
-                        d = CellsListDialog(self.excelWorksheetObject.Cells)
-                        d.ShowModal()
-                        d.Destroy()
-                        gui.mainFrame.postPopup()
-                wx.CallAfter(run)
-                
+		def run():
+			gui.mainFrame.prePopup()
+			d = CellsListDialog(self.excelWorksheetObject.Cells)
+			d.ShowModal()
+			d.Destroy()
+			gui.mainFrame.postPopup()
+		wx.CallAfter(run)
+
 	script_cellSelectionPopup.canPropagate=True
 
 	__changeSelectionGestures = (
@@ -197,8 +197,8 @@ class ExcelWorksheet(ExcelBase):
 	)
 	__gestures={
 		"kb:NVDA+f7":"cellSelectionPopup",
-        }
-                
+	}
+
 class ExcelCellTextInfo(NVDAObjectTextInfo):
 
 	def _getFormatFieldAndOffsets(self,offset,formatConfig,calculateOffsets=True):
@@ -568,98 +568,120 @@ class ExcelMergedCell(ExcelCell):
 		return self.getCellAddress(self.excelCellObject.mergeArea)
 
 class CellsListDialog(wx.Dialog):
-        
-        ## View modes, flat, tree etc.
-        modeRegionColCell = 0
-        modeRegionRowCell = 1
-        modeRegionCell = 2
-        modeCell = 3
-        modes = { #modeCell : _("Cells (Flat)"),
-                  modeRegionCell : _("Area / Cell"),
-                  #modeRegionRowCell : _("Area / Row / Cell"),
-                  #modeRegionColCell : _("Area / Col / Cell"),
-        }
-        types = { 
-                xlCellType.xlCellTypeComments : xlCellType.get(xlCellType.xlCellTypeComments),
-                xlCellType.xlCellTypeFormulas : xlCellType.get(  xlCellType.xlCellTypeFormulas  ),
-        }
-        
-
-        def populate(self,evt):
-                type = self.typeCombo.GetClientData(self.typeCombo.GetSelection())
-                mode = self.viewCombo.GetClientData(self.viewCombo.GetSelection())
-                self.tree.DeleteChildren(self.treeRoot)
-                if type == xlCellType.xlCellTypeComments :
-                        fn = lambda x: x.Comment.Text()
-                elif type == xlCellType.xlCellTypeFormulas :
-                        fn = lambda x: x.Formula
-                else:
-                        fn = lambda x: x.Text
-                try:
-                        wholerange = self.cells.SpecialCells(type)
-                        areacount = wholerange.Areas.Count
-                        for range in wholerange.Areas:
-                                ## Make Node for Range
-                                first=range.Item(1).Address(False,False,1,False)
-                                last=range.Cells.Item(range.Cells.Count).Address(False,False,1,False)
-                                text ="Area from {first} to {last}".format(first=first,last=last)
-                                this = self.tree.AppendItem(self.treeRoot,text,data=wx.TreeItemData(range))
-                                for cell in range.Cells:
-                                        addr = cell.address(False,False,1,False)
-                                        text= addr + " " + fn(cell)
-                                        self.tree.AppendItem(this,text,data=wx.TreeItemData(cell))
-                except (COMError):
-                        self.tree.AppendItem(self.treeRoot,_("No matching cells"))
-                
-        def onTreeChar(self,evt):
-                if evt.GetKeyCode() == wx.WXK_RETURN:
-                        range = self.tree.GetPyData(self.tree.GetSelection())
-                        range.Select()
-                        self.Close()
-                        #first=range.Item(1).Address(False,False,1,False)
-                        #last=range.Cells.Item(range.Cells.Count).Address(False,False,1,False)
-                        #text ="Area from {first} to {last}".format(first=first,last=last)
-                        #self.tree.AppendItem(self.treeRoot,text)
-                        
-                        pass
-                evt.Skip()
 
-	def __init__(self, cells):
+	types = { 
+		xlCellType.xlCellTypeComments : xlCellType.get(xlCellType.xlCellTypeComments),
+		xlCellType.xlCellTypeFormulas : xlCellType.get(  xlCellType.xlCellTypeFormulas  ),
+	}
+
+
+	def populate_area(self, fnText, fnNext, refCells, treeBranch):
+		for area in refCells.Areas:
+			first= area.Cells.Item(1).Address(False, False, 1, False)
+			last = area.Cells.Item( area.Cells.Count).Address( False, False, 1,False)
+			text ="Area: {first} to {last}".format(first=first,last=last)
+			entry = self.tree.AppendItem(treeBranch, text,data=wx.TreeItemData(area))
+			if len(fnNext) > 0 :
+				fnNext[0](fnText, fnNext[1:], area, entry)
+
+	def populate_col(self, fnText, fnNext, refCells, treeBranch):
+		for area in refCells.Columns:
+			first= area.Cells.Item(1).Address(False, False, 1, False)
+			last = area.Cells.Item( area.Cells.Count).Address( False, False, 1,False)
+			text ="Column: {first} to {last}".format(first=first,last=last)
+			entry = self.tree.AppendItem(treeBranch, text,data=wx.TreeItemData(area))
+			if len(fnNext) > 0:
+				fnNext[0](fnText, fnNext[1:], area, entry)
+
+	def populate_row(self, fnText, fnNext, refCells, treeBranch):
+		for area in refCells.Rows:
+			first= area.Cells.Item(1).Address(False, False, 1, False)
+			last = area.Cells.Item( area.Cells.Count).Address( False, False, 1,False)
+			text ="Row: {first} to {last}".format(first=first,last=last)
+			entry = self.tree.AppendItem(treeBranch, text,data=wx.TreeItemData(area))
+			if len(fnNext) > 0:
+				fnNext[0](fnText, fnNext[1:], area, entry)
+
+	def populate_cell(self, fnText, fnNext, refCells, treeBranch):
+		for cell in refCells.Cells:
+			text = cell.Address(False, False, 1, False) + " - " + fnText(cell)
+			entry = self.tree.AppendItem(treeBranch, text,data=wx.TreeItemData(cell))
+
+
+
+	def populate(self,evt):
+		type = self.typeCombo.GetClientData(self.typeCombo.GetSelection())
+		fns = self.viewCombo.GetClientData(self.viewCombo.GetSelection())
+		self.tree.DeleteChildren(self.treeRoot)
+		if type == xlCellType.xlCellTypeComments :
+			fn = lambda x: x.Comment.Text()
+		elif type == xlCellType.xlCellTypeFormulas :
+			fn = lambda x: x.Formula
+		else:
+			fn = lambda x: x.Text
+		try:
+			wholerange = self.cells.SpecialCells(type)
+                        fns[0](fn, fns[1:],wholerange,self.treeRoot)
+		except (COMError):
+			self.tree.AppendItem(self.treeRoot,_("No matching cells"))
+
+	def onTreeChar(self,evt):
+		if evt.GetKeyCode() == wx.WXK_RETURN:
+			range = self.tree.GetPyData(self.tree.GetSelection())
+			range.Select()
+			self.Close()
+		evt.Skip()
 
-		# Translators: The title of the browse mode Elements List dialog.
-                self.cells = cells
+	def __init__(self, cells):
+		self.cells = cells
 		super(CellsListDialog, self).__init__(gui.mainFrame, wx.ID_ANY, _("Cell List"))
 		mainSizer = wx.BoxSizer(wx.VERTICAL)
-                
+		# Cell Types to show
 		typeSizer=wx.BoxSizer(wx.HORIZONTAL)                
 		typeLabel=wx.StaticText(self,-1,label=_("Cells to &show:"))
-                self.typeCombo = wx.Choice(self,wx.ID_ANY)
-                for x in self.types.keys():
-                        self.typeCombo.Append(self.types[x],x)
-                self.typeCombo.SetSelection(0)
-                self.typeCombo.Bind(wx.EVT_CHOICE,self.populate)
-                typeSizer.Add(typeLabel)
-                typeSizer.Add(self.typeCombo)
-                mainSizer.Add(typeSizer)
-
+		self.typeCombo = wx.Choice(self,wx.ID_ANY)
+		for x in self.types.keys():
+			self.typeCombo.Append(self.types[x],x)
+		self.typeCombo.SetSelection(0)
+		self.typeCombo.Bind(wx.EVT_CHOICE,self.populate)
+		typeSizer.Add(typeLabel)
+		typeSizer.Add(self.typeCombo)
+		mainSizer.Add(typeSizer)
+		# Viewing Mode
 		viewSizer=wx.BoxSizer(wx.HORIZONTAL)                
 		viewLabel=wx.StaticText(self,-1,label=_("Viewing &mode"))
-                self.viewCombo = wx.Choice(self,wx.ID_ANY)
-                for x in self.modes.keys():
-                        self.viewCombo.Append(self.modes[x],x)
-                self.viewCombo.SetSelection(0)
-                self.viewCombo.Bind(wx.EVT_CHOICE,self.populate)
-                viewSizer.Add(viewLabel)
-                viewSizer.Add(self.viewCombo)
-                mainSizer.Add(viewSizer)
-
-		self.tree = wx.TreeCtrl(self, wx.ID_ANY, style=wx.TR_HAS_BUTTONS | wx.TR_HIDE_ROOT | wx.TR_SINGLE)
-		#self.tree.Bind(wx.EVT_SET_FOCUS, self.onTreeSetFocus)
-		#self.tree.Bind(wx.EVT_CHAR, self.onTreeChar)
+		self.viewCombo = wx.Choice(self,wx.ID_ANY)
+
+		modes = [
+			(_("Cells (Flat)"), [ self.populate_cell ] ),
+			(_("Row/Cells"), [ self.populate_row, self.populate_cell ] ),
+			(_("Col/Cells"), [ self.populate_col, self.populate_cell ] ),
+			(_("Area/Cells"), [ self.populate_area, self.populate_cell ] ),
+			(_("Area/Rows"), [ self.populate_area, self.populate_row, self.populate_cell ] ),
+			(_("Area/Cols"), [ self.populate_area, self.populate_col, self.populate_cell ] ),
+		]
+
+		for x in modes:
+			self.viewCombo.Append(x[0],x[1])
+		self.viewCombo.SetSelection(0)
+		self.viewCombo.Bind(wx.EVT_CHOICE,self.populate)
+		viewSizer.Add(viewLabel)
+		viewSizer.Add(self.viewCombo)
+		mainSizer.Add(viewSizer)
+		# Filter By
+		viewSizer=wx.BoxSizer(wx.HORIZONTAL)                
+		viewLabel=wx.StaticText(self,-1,label=_("Filter &text"))
+		self.filterText = wx.TextCtrl(self,wx.ID_ANY)
+		#self.viewCombo.Bind(wx.EVT_CHOICE,self.populate)
+		viewSizer.Add(viewLabel)
+		viewSizer.Add(self.filterText)
+		mainSizer.Add(viewSizer)
+		# Tree
+		self.tree = wx.TreeCtrl(self, wx.ID_ANY, style=wx.TR_HAS_BUTTONS | wx.TR_HIDE_ROOT | wx.TR_LINES_AT_ROOT| wx.TR_SINGLE)
 		self.tree.Bind(wx.EVT_CHAR, self.onTreeChar)
-		self.treeRoot = self.tree.AddRoot("root")
-		mainSizer.Add(self.tree,proportion=7,flag=wx.EXPAND)
 
+		mainSizer.Add(self.tree,proportion=7,flag=wx.EXPAND)
+		# Buttons
 		sizer = wx.BoxSizer(wx.HORIZONTAL)
 		sizer.Add(wx.Button(self, wx.ID_CANCEL))
 		#sizer.Add(wx.Button(self, wx.ID_OK))
@@ -670,5 +692,5 @@ class CellsListDialog(wx.Dialog):
 
 		self.treeRoot = self.tree.AddRoot("Root")
 		self.populate(None)
-		self.tree.SetFocus()
+		#self.tree.SetFocus()
 
-- 
1.9.0.msysgit.0


From f02af8a4efdcd287cd4dd2e2ad46c3185d52e584 Mon Sep 17 00:00:00 2001
From: Vardhan <vardhanvarma@gmail.com>
Date: Wed, 22 Jan 2014 18:13:46 +0530
Subject: [PATCH 10/13] Complete

---
 source/NVDAObjects/window/excel.py              | 50 ++++++++++++++-----------
 source/NVDAObjects/window/msoffice_constants.py |  6 +++
 2 files changed, 34 insertions(+), 22 deletions(-)

diff --git a/source/NVDAObjects/window/excel.py b/source/NVDAObjects/window/excel.py
index b5cf971..04d04f5 100755
--- a/source/NVDAObjects/window/excel.py
+++ b/source/NVDAObjects/window/excel.py
@@ -604,27 +604,24 @@ class CellsListDialog(wx.Dialog):
 
 	def populate_cell(self, fnText, fnNext, refCells, treeBranch):
 		for cell in refCells.Cells:
-			text = cell.Address(False, False, 1, False) + " - " + fnText(cell)
+			text = cell.Address(False, False, 1, False) + ":" + fnText(cell)
 			entry = self.tree.AppendItem(treeBranch, text,data=wx.TreeItemData(cell))
 
 
-
 	def populate(self,evt):
-		type = self.typeCombo.GetClientData(self.typeCombo.GetSelection())
-		fns = self.viewCombo.GetClientData(self.viewCombo.GetSelection())
+		fnlist = self.viewCombo.GetClientData(self.viewCombo.GetSelection())
+		typefns = self.typeCombo.GetClientData(self.typeCombo.GetSelection())
+                get_func = typefns[0]
+                text_func = typefns[1]
+                self.tree.Freeze()
 		self.tree.DeleteChildren(self.treeRoot)
-		if type == xlCellType.xlCellTypeComments :
-			fn = lambda x: x.Comment.Text()
-		elif type == xlCellType.xlCellTypeFormulas :
-			fn = lambda x: x.Formula
-		else:
-			fn = lambda x: x.Text
 		try:
-			wholerange = self.cells.SpecialCells(type)
-                        fns[0](fn, fns[1:],wholerange,self.treeRoot)
+			wholerange = get_func(self.cells)                        
+                        fnlist[0](text_func, fnlist[1:],wholerange,self.treeRoot)
 		except (COMError):
 			self.tree.AppendItem(self.treeRoot,_("No matching cells"))
-
+                self.tree.Thaw()
+                
 	def onTreeChar(self,evt):
 		if evt.GetKeyCode() == wx.WXK_RETURN:
 			range = self.tree.GetPyData(self.tree.GetSelection())
@@ -637,11 +634,20 @@ class CellsListDialog(wx.Dialog):
 		super(CellsListDialog, self).__init__(gui.mainFrame, wx.ID_ANY, _("Cell List"))
 		mainSizer = wx.BoxSizer(wx.VERTICAL)
 		# Cell Types to show
+                types = [
+                        (  _("With comments"),
+                           [ (lambda x: x.SpecialCells(xlCellType.xlCellTypeComments)),
+                             (lambda x: x.Comment.Text() ) ] ),
+                        ( _("With formula"),
+                          [ (lambda x: x.SpecialCells(xlCellType.xlCellTypeFormulas)),
+                            (lambda x: x.Formula ) ] ),
+                ]
+                
 		typeSizer=wx.BoxSizer(wx.HORIZONTAL)                
 		typeLabel=wx.StaticText(self,-1,label=_("Cells to &show:"))
 		self.typeCombo = wx.Choice(self,wx.ID_ANY)
-		for x in self.types.keys():
-			self.typeCombo.Append(self.types[x],x)
+		for x in types:
+			self.typeCombo.Append(x[0],x[1])
 		self.typeCombo.SetSelection(0)
 		self.typeCombo.Bind(wx.EVT_CHOICE,self.populate)
 		typeSizer.Add(typeLabel)
@@ -653,7 +659,7 @@ class CellsListDialog(wx.Dialog):
 		self.viewCombo = wx.Choice(self,wx.ID_ANY)
 
 		modes = [
-			(_("Cells (Flat)"), [ self.populate_cell ] ),
+                        (_("Cells (Flat)"), [ self.populate_cell ] ),
 			(_("Row/Cells"), [ self.populate_row, self.populate_cell ] ),
 			(_("Col/Cells"), [ self.populate_col, self.populate_cell ] ),
 			(_("Area/Cells"), [ self.populate_area, self.populate_cell ] ),
@@ -669,13 +675,13 @@ class CellsListDialog(wx.Dialog):
 		viewSizer.Add(self.viewCombo)
 		mainSizer.Add(viewSizer)
 		# Filter By
-		viewSizer=wx.BoxSizer(wx.HORIZONTAL)                
-		viewLabel=wx.StaticText(self,-1,label=_("Filter &text"))
-		self.filterText = wx.TextCtrl(self,wx.ID_ANY)
+		#viewSizer=wx.BoxSizer(wx.HORIZONTAL)                
+		#viewLabel=wx.StaticText(self,-1,label=_("Filter &text"))
+		#self.filterText = wx.TextCtrl(self,wx.ID_ANY)
 		#self.viewCombo.Bind(wx.EVT_CHOICE,self.populate)
-		viewSizer.Add(viewLabel)
-		viewSizer.Add(self.filterText)
-		mainSizer.Add(viewSizer)
+		#viewSizer.Add(viewLabel)
+		#viewSizer.Add(self.filterText)
+		#mainSizer.Add(viewSizer)
 		# Tree
 		self.tree = wx.TreeCtrl(self, wx.ID_ANY, style=wx.TR_HAS_BUTTONS | wx.TR_HIDE_ROOT | wx.TR_LINES_AT_ROOT| wx.TR_SINGLE)
 		self.tree.Bind(wx.EVT_CHAR, self.onTreeChar)
diff --git a/source/NVDAObjects/window/msoffice_constants.py b/source/NVDAObjects/window/msoffice_constants.py
index 06668e8..792c96b 100644
--- a/source/NVDAObjects/window/msoffice_constants.py
+++ b/source/NVDAObjects/window/msoffice_constants.py
@@ -115,6 +115,12 @@ class xlCellType(xlConstant):
 	xlCellTypeSameValidation      =-4175      # from enum XlCellType
 	xlCellTypeVisible             =12         # from enum XlCellType
 
+        ## These are actually from xlSpecialCellsValue
+	xlErrors                      = 16
+	xlLogical                     = 4
+	xlNumbers                     = 1
+	xlTextValues                  = 2
+
 	_map = { 
 		xlCellTypeAllFormatConditions :_("any format"),
 		xlCellTypeAllValidation       :_("validatio"),
-- 
1.9.0.msysgit.0


From f95566bef7c7ccd308c301c79cec589b807dad0e Mon Sep 17 00:00:00 2001
From: Vardhan <vardhanvarma@gmail.com>
Date: Wed, 22 Jan 2014 19:28:38 +0530
Subject: [PATCH 11/13] Adding xlSpecialCellsValue constant in xlCellType

---
 source/NVDAObjects/window/msoffice_constants.py | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/source/NVDAObjects/window/msoffice_constants.py b/source/NVDAObjects/window/msoffice_constants.py
index 06668e8..792c96b 100644
--- a/source/NVDAObjects/window/msoffice_constants.py
+++ b/source/NVDAObjects/window/msoffice_constants.py
@@ -115,6 +115,12 @@ class xlCellType(xlConstant):
 	xlCellTypeSameValidation      =-4175      # from enum XlCellType
 	xlCellTypeVisible             =12         # from enum XlCellType
 
+        ## These are actually from xlSpecialCellsValue
+	xlErrors                      = 16
+	xlLogical                     = 4
+	xlNumbers                     = 1
+	xlTextValues                  = 2
+
 	_map = { 
 		xlCellTypeAllFormatConditions :_("any format"),
 		xlCellTypeAllValidation       :_("validatio"),
-- 
1.9.0.msysgit.0


From 1c21112260fa1d2944fed0d66343b6f9f1c3448f Mon Sep 17 00:00:00 2001
From: Vardhan <vardhanvarma@gmail.com>
Date: Sat, 26 Apr 2014 08:26:37 +0530
Subject: [PATCH 12/13] cleanup for submit

---
 source/NVDAObjects/window/excel.py              | 19 -------------------
 source/NVDAObjects/window/msoffice_constants.py |  9 +++++----
 2 files changed, 5 insertions(+), 23 deletions(-)

diff --git a/source/NVDAObjects/window/excel.py b/source/NVDAObjects/window/excel.py
index 5f24612..2d8040a 100755
--- a/source/NVDAObjects/window/excel.py
+++ b/source/NVDAObjects/window/excel.py
@@ -388,25 +388,6 @@ class ExcelCell(ExcelBase):
 		if previous:
 			return ExcelCell(windowHandle=self.windowHandle,excelWindowObject=self.excelWindowObject,excelCellObject=previous)
 
-	lastCell = ""
-	script_states = { }
-
-	def resetStatesIfCellChanged(self):
-		""" resets all states if user has moved to a different cell """
-		if self.lastCell != self.excelCellObject.Address(False,False,1,False):
-			self.lastCell = self.excelCellObject.Address(False,False,1,False)
-			self.script_states = { }
-
-	def nextState(self, script_name, highest_value):
-		""" Usage: st = self.nextState('foo',2), goes 0/1/2/0/1/2.. on succesive calls """
-		try:
-			val = self.script_states[script_name]
-			val = val + 1 if val < highest_value else 0
-		except:
-			val = 0
-		self.script_states[script_name] = val
-		return val
-
 	__gestures = {
 		"kb:NVDA+shift+c": "setColumnHeaderRow",
 		"kb:NVDA+shift+r": "setRowHeaderColumn",
diff --git a/source/NVDAObjects/window/msoffice_constants.py b/source/NVDAObjects/window/msoffice_constants.py
index 792c96b..b12d630 100644
--- a/source/NVDAObjects/window/msoffice_constants.py
+++ b/source/NVDAObjects/window/msoffice_constants.py
@@ -1,10 +1,11 @@
-# office_constants.py
+# msoffice_constants.py
+# an enumreation of MS Office constants, with the speakable string.
 # Usage : from office_constants import *
 # xlFooBar.get( an_integer )
-# returns text to be spoken
-# Translators: full of small phrases. 
+# Translators: full of small phrases, not all are spoken out currently.
 
 
+# Base class, returns official string
 class xlConstant(object):
 	@classmethod
 	def get(cls,x):
@@ -123,7 +124,7 @@ class xlCellType(xlConstant):
 
 	_map = { 
 		xlCellTypeAllFormatConditions :_("any format"),
-		xlCellTypeAllValidation       :_("validatio"),
+		xlCellTypeAllValidation       :_("validation"),
 		xlCellTypeBlanks              :_("empty cell"),
 		xlCellTypeComments            :_("comment"),
 		xlCellTypeConstants           :_("constant"),
-- 
1.9.0.msysgit.0


From 0429a7ceb064977c4482debf46405f49f2950acd Mon Sep 17 00:00:00 2001
From: Vardhan <vardhanvarma@gmail.com>
Date: Sat, 26 Apr 2014 08:35:47 +0530
Subject: [PATCH 13/13] Updating docs to include NVDA+f7

---
 user_docs/en/changes.t2t   | 2 +-
 user_docs/en/userGuide.t2t | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/user_docs/en/changes.t2t b/user_docs/en/changes.t2t
index 9f88ce8..e857fcb 100644
--- a/user_docs/en/changes.t2t
+++ b/user_docs/en/changes.t2t
@@ -11,7 +11,7 @@
 - In accessible Java applications, keyboard shortcuts are now announced for controls that have them. (#3881)
 - In browse mode, labels on landmarks are now reported. They are also included in the Elements List dialog. (#1195)
 - In browse mode, labelled regions are now treated as landmarks. (#3741)
-
+- In MS Excel, NVDA+f7 opens the Cell List dialog, which quickly shows the cells with formula and omment, and allows to go to to selected cell(s)
 
 == Bug Fixes ==
 - The standard Windows System menu is no longer accidentally silenced in Java applications (#3882)
diff --git a/user_docs/en/userGuide.t2t b/user_docs/en/userGuide.t2t
index c8358c3..33065f9 100644
--- a/user_docs/en/userGuide.t2t
+++ b/user_docs/en/userGuide.t2t
@@ -530,6 +530,7 @@ NVDA provides its own extra commands for some applications to make certain tasks
 || Name | Key | Description |
 | Set column headers | NVDA+shift+c | Pressing this once tells NVDA this is the row that contains column headers, which should be automatically announced when moving between columns below this row. Pressing twice will clear the setting. | 
 | Set row headers | NVDA+shift+r | Pressing this once tells NVDA this is the column that contains row headers, which should be automatically announced when moving between rows after  this column. Pressing twice will clear the setting. | 
+| Cell List dialog | NVDA+f7 | opens the Cell List dialog showing cells with comments and formula. Allows cell list to be viewed in Row first or Column first order. Pressing Enter will close the dialog and selcted cell(s) will be selected in the sheet. | 
 %kc:endInclude
 
 ++ Microsoft PowerPoint ++
-- 
1.9.0.msysgit.0

