=== added file 'source/appModules/winword.py'
--- source/appModules/winword.py	1970-01-01 00:00:00 +0000
+++ source/appModules/winword.py	2013-03-11 06:59:28 +0000
@@ -0,0 +1,192 @@
+#appModules/winword.py
+#A part of NonVisual Desktop Access (NVDA)
+#Copyright (C) 2006-2012 NVDA Contributors
+#This file is covered by the GNU General Public License.
+#See the file COPYING for more details.
+
+import appModuleHandler
+import speech
+import tones
+import keyboardHandler
+from keyboardHandler import KeyboardInputGesture
+import mouseHandler
+import eventHandler
+import controlTypes
+import api
+import textInfos
+import sayAllHandler
+from NVDAObjects import NVDAObject, NVDAObjectTextInfo
+import globalVars
+from logHandler import log
+from synthDriverHandler import *
+import gui
+import wx
+import config
+import winUser
+import winKernel
+import treeInterceptorHandler
+import scriptHandler
+import ui
+import inputCore
+import virtualBuffers
+import characterProcessing
+from baseObject import ScriptableObject
+import itertools
+import colors
+import synthDriverHandler
+from synthDriverHandler import *
+import re
+import queueHandler
+import speechDictHandler
+import languageHandler
+import displayModel
+from NVDAObjects.IAccessible import sysListView32
+from NVDAObjects import IAccessible
+from NVDAObjects.window.winword import WordDocument 
+from displayModel import EditableTextDisplayModelTextInfo
+from NVDAObjects.window import DisplayModelEditableText
+
+speechMode_off=0
+speechMode_beeps=1
+speechMode_talk=2
+#: How speech should be handled; one of speechMode_off, speechMode_beeps or speechMode_talk.
+speechMode=speechMode_talk
+speechMode_beeps_ms=15
+beenCanceled=True
+isPaused=False
+curWordChars=[]
+from controlTypes import REASON_FOCUS, REASON_FOCUSENTERED, REASON_MOUSE, REASON_QUERY, REASON_CHANGE, REASON_MESSAGE, REASON_SAYALL, REASON_CARET, REASON_ONLYCACHE
+
+#: The string used to separate distinct chunks of text when multiple chunks should be spoken without pauses.
+CHUNK_SEPARATOR = "  "
+
+oldTreeLevel=None
+oldTableID=None
+oldRowNumber=None
+oldColumnNumber=None
+
+class AppModule(appModuleHandler.AppModule):
+
+	def script_bold(self,gesture):
+		formatConfig={
+			"detectFormatAfterCursor":False,
+			"reportFontName":False,"reportFontSize":False,"reportFontAttributes":True,"reportColor":False,
+			"reportStyle":False,"reportAlignment":False,"reportSpellingErrors":False,
+			"reportPage":False,"reportLineNumber":False,"reportTables":False,
+			"reportLinks":False,"reportHeadings":False,"reportLists":False,
+			"reportBlockQuotes":False,"reportComments":False,
+		}		
+		textList=[]
+		info=api.getReviewPosition()
+		info.expand(textInfos.UNIT_CHARACTER)
+		formatField=textInfos.FormatField()
+		for field in info.getTextWithFields(formatConfig):
+			if isinstance(field,textInfos.FieldCommand) and isinstance(field.field,textInfos.FormatField):
+				formatField.update(field.field)
+		text=speech.getFormatFieldSpeechBold(formatField,formatConfig=formatConfig,) if formatField else None
+		if text:
+			#textList.append(text)
+			speech.speakText("bold off")
+		else:
+			speech.speakText("bold on")
+		return KeyboardInputGesture.fromName("control+b").send()
+		
+	def script_italic(self,gesture):
+		formatConfig={
+			"detectFormatAfterCursor":False,
+			"reportFontName":False,"reportFontSize":False,"reportFontAttributes":True,"reportColor":False,
+			"reportStyle":False,"reportAlignment":False,"reportSpellingErrors":False,
+			"reportPage":False,"reportLineNumber":False,"reportTables":False,
+			"reportLinks":False,"reportHeadings":False,"reportLists":False,
+			"reportBlockQuotes":False,"reportComments":False,
+		}
+		textList=[]
+		info=api.getReviewPosition()
+		info.expand(textInfos.UNIT_CHARACTER)
+		formatField=textInfos.FormatField()
+		for field in info.getTextWithFields(formatConfig):
+			if isinstance(field,textInfos.FieldCommand) and isinstance(field.field,textInfos.FormatField):
+				formatField.update(field.field)
+		text=speech.getFormatFieldSpeechItalic(formatField,formatConfig=formatConfig) if formatField else None
+		if text:
+			#textList.append(text)
+			speech.speakText("italic off")
+		else:
+			speech.speakText("italic on")
+		return KeyboardInputGesture.fromName("control+i").send()
+		
+	def script_underline(self,gesture):
+		formatConfig={
+			"detectFormatAfterCursor":False,
+			"reportFontName":False,"reportFontSize":False,"reportFontAttributes":True,"reportColor":False,
+			"reportStyle":False,"reportAlignment":False,"reportSpellingErrors":False,
+			"reportPage":False,"reportLineNumber":False,"reportTables":False,
+			"reportLinks":False,"reportHeadings":False,"reportLists":False,
+			"reportBlockQuotes":False,"reportComments":False,
+		}
+		textList=[]
+		info=api.getReviewPosition()
+		info.expand(textInfos.UNIT_CHARACTER)
+		formatField=textInfos.FormatField()
+		for field in info.getTextWithFields(formatConfig):
+			if isinstance(field,textInfos.FieldCommand) and isinstance(field.field,textInfos.FormatField):
+				formatField.update(field.field)
+		text=speech.getFormatFieldSpeechUnderline(formatField,formatConfig=formatConfig) if formatField else None
+		if text:
+			#textList.append(text)
+			speech.speakText("underline off")
+		else:
+			speech.speakText("underline on")
+		return KeyboardInputGesture.fromName("control+u").send()
+		
+	def script_center(self,gesture):
+		gesture.send()
+		formatConfig={
+			"detectFormatAfterCursor":False,
+			"reportFontName":False,"reportFontSize":False,"reportFontAttributes":False,"reportColor":False,
+			"reportStyle":False,"reportAlignment":True,"reportSpellingErrors":False,
+			"reportPage":False,"reportLineNumber":False,"reportTables":False,
+			"reportLinks":False,"reportHeadings":False,"reportLists":False,
+			"reportBlockQuotes":False,"reportComments":False,
+		}
+		textList=[]
+		info=api.getReviewPosition()
+
+		# First, fetch indentation.
+		line=info.copy()
+		line.expand(textInfos.UNIT_LINE)
+		indentation,content=speech.splitTextIndentation(line.text)
+		if indentation:
+			textList.append(speech.getIndentationSpeech(indentation))
+		
+		info.expand(textInfos.UNIT_CHARACTER)
+		formatField=textInfos.FormatField()
+		for field in info.getTextWithFields(formatConfig):
+			if isinstance(field,textInfos.FieldCommand) and isinstance(field.field,textInfos.FormatField):
+				formatField.update(field.field)
+		text=speech.getFormatFieldSpeech(formatField,formatConfig=formatConfig) if formatField else None
+		if text:
+			textList.append(text)
+
+		if not textList:
+			# Translators: Reported when trying to obtain formatting information (such as font name, indentation and so on) but there is no formatting information for the text under cursor.
+			#ui.message(_("No formatting information"))
+			return
+
+		ui.message(" ".join(textList))
+	script_center.__doc__ = _("Reports formatting info for the current review cursor position within a document")
+	
+	def script_new(self,gesture):
+		gesture.send()
+		speech.speakText("new line")
+
+	__gestures = {
+		"kb:control+b": "bold",
+		"kb:control+i": "italic",
+		"kb:control+u": "underline",
+		"kb:control+e": "center",
+		"kb:control+l": "center",
+		"kb:control+r": "center",
+		"kb:control+j": "center",
+        "kb:enter": "new",
+    }
\ No newline at end of file


--- source/speech.py	2013-02-14 08:49:17 +0000
+++ source/speech.py	2013-03-08 09:38:11 +0000
@@ -649,6 +649,9 @@
 
 	#Fetch the text for format field attributes that have changed between what was previously cached, and this textInfo's initialFormatField.
 	text=getFormatFieldSpeech(newFormatField,formatFieldAttributesCache,formatConfig,unit=unit,extraDetail=extraDetail)
+	text=getFormatFieldSpeechBold(newFormatField,formatFieldAttributesCache,formatConfig,unit=unit,extraDetail=extraDetail)
+	text=getFormatFieldSpeechItalic(newFormatField,formatFieldAttributesCache,formatConfig,unit=unit,extraDetail=extraDetail)
+	text=getFormatFieldSpeechUnderline(newFormatField,formatFieldAttributesCache,formatConfig,unit=unit,extraDetail=extraDetail)
 	if text:
 		speechSequence.append(text)
 	if autoLanguageSwitching:
@@ -703,6 +706,9 @@
 					commonFieldCount=len(newControlFieldStack)
 			elif command.command=="formatChange":
 				fieldText=getFormatFieldSpeech(command.field,formatFieldAttributesCache,formatConfig,unit=unit,extraDetail=extraDetail)
+				fieldText=getFormatFieldSpeechBold(command.field,formatFieldAttributesCache,formatConfig,unit=unit,extraDetail=extraDetail)
+				fieldText=getFormatFieldSpeechItalic(command.field,formatFieldAttributesCache,formatConfig,unit=unit,extraDetail=extraDetail)
+				fieldText=getFormatFieldSpeechUnderline(command.field,formatFieldAttributesCache,formatConfig,unit=unit,extraDetail=extraDetail)
 				if fieldText:
 					inTextChunk=False
 				if autoLanguageSwitching:
@@ -1056,7 +1062,7 @@
 			# Translators: Indicates the line number of the text.
 			# %s will be replaced with the line number.
 			text=_("line %s")%lineNumber
-			textList.append(text)
+			textList.append(text)	
 	if  formatConfig["reportFontAttributes"]:
 		bold=attrs.get("bold")
 		oldBold=attrsCache.get("bold") if attrsCache is not None else None
@@ -1065,7 +1071,7 @@
 			text=(_("bold") if bold
 				# Translators: Reported when text is not bolded.
 				else _("no bold"))
-			textList.append(text)
+			textList.append(text)		
 		italic=attrs.get("italic")
 		oldItalic=attrsCache.get("italic") if attrsCache is not None else None
 		if (italic or oldItalic is not None) and italic!=oldItalic:
@@ -1106,7 +1112,8 @@
 				# Translators: Reported for text which is at the baseline position;
 				# i.e. not superscript or subscript.
 				text=_("baseline")
-			textList.append(text)
+			textList.append(text)				
+	
 	if formatConfig["reportAlignment"]:
 		textAlign=attrs.get("text-align")
 		oldTextAlign=attrsCache.get("text-align") if attrsCache is not None else None
@@ -1164,6 +1171,72 @@
 		attrsCache.clear()
 		attrsCache.update(attrs)
 	return CHUNK_SEPARATOR.join(textList)
+	
+def getFormatFieldSpeechBold(attrs,attrsCache=None,formatConfig=None,unit=None,extraDetail=False):
+	if not formatConfig:
+		formatConfig=config.conf["documentFormatting"]
+	textList=[]
+	if  formatConfig["reportFontAttributes"]:
+		bold=attrs.get("bold")
+		oldBold=attrsCache.get("bold") if attrsCache is not None else None
+		if (bold or oldBold is not None) and bold!=oldBold:
+			# Translators: Reported when text is bolded.
+			text=(_("bold on") if bold
+				# Translators: Reported when text is not bolded.
+				else _("no bold"))
+			textList.append(text)			
+	if unit in (textInfos.UNIT_LINE,textInfos.UNIT_SENTENCE,textInfos.UNIT_PARAGRAPH,textInfos.UNIT_READINGCHUNK):
+		linePrefix=attrs.get("line-prefix")
+		if linePrefix:
+			textList.append(linePrefix)
+	if attrsCache is not None:
+		attrsCache.clear()
+		attrsCache.update(attrs)
+	return CHUNK_SEPARATOR.join(textList)
+	
+def getFormatFieldSpeechItalic(attrs,attrsCache=None,formatConfig=None,unit=None,extraDetail=False):
+	if not formatConfig:
+		formatConfig=config.conf["documentFormatting"]
+	textList=[]
+	if  formatConfig["reportFontAttributes"]:
+		italic=attrs.get("italic")
+		oldItalic=attrsCache.get("italic") if attrsCache is not None else None
+		if (italic or oldItalic is not None) and italic!=oldItalic:
+			# Translators: Reported when text is italicized.
+			text=(_("italic on") if italic
+				# Translators: Reported when text is not italicized.
+				else _("no italic"))
+			textList.append(text)			
+	if unit in (textInfos.UNIT_LINE,textInfos.UNIT_SENTENCE,textInfos.UNIT_PARAGRAPH,textInfos.UNIT_READINGCHUNK):
+		linePrefix=attrs.get("line-prefix")
+		if linePrefix:
+			textList.append(linePrefix)
+	if attrsCache is not None:
+		attrsCache.clear()
+		attrsCache.update(attrs)
+	return CHUNK_SEPARATOR.join(textList)
+	
+def getFormatFieldSpeechUnderline(attrs,attrsCache=None,formatConfig=None,unit=None,extraDetail=False):
+	if not formatConfig:
+		formatConfig=config.conf["documentFormatting"]
+	textList=[]
+	if  formatConfig["reportFontAttributes"]:
+		underline=attrs.get("underline")
+		oldUnderline=attrsCache.get("underline") if attrsCache is not None else None
+		if (underline or oldUnderline is not None) and underline!=oldUnderline:
+			# Translators: Reported when text is underlined.
+			text=(_("underline on") if underline
+				# Translators: Reported when text is not underlined.
+				else _("not underlined"))
+			textList.append(text)			
+	if unit in (textInfos.UNIT_LINE,textInfos.UNIT_SENTENCE,textInfos.UNIT_PARAGRAPH,textInfos.UNIT_READINGCHUNK):
+		linePrefix=attrs.get("line-prefix")
+		if linePrefix:
+			textList.append(linePrefix)
+	if attrsCache is not None:
+		attrsCache.clear()
+		attrsCache.update(attrs)
+	return CHUNK_SEPARATOR.join(textList)
 
 def getTableInfoSpeech(tableInfo,oldTableInfo,extraDetail=False):
 	if tableInfo is None and oldTableInfo is None:
