From: James Teh Date: Fri, 27 Jan 2012 00:16:05 +0000 (+1000) Subject: Dialog NVDAObject behavior: When fetching text, don't add a space when the text of... X-Git-Tag: jpdev130418~1116 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=a9fde99732f37a8c7f869acd27dd8e5e8a691e5e;p=nvdajp%2Fnvdajp.git Dialog NVDAObject behavior: When fetching text, don't add a space when the text of an object is empty. Fixes spurious announcement of property pages and dialogs in some cases when there is no text, such as the property page just below the top level frame in recent Firefox builds. --- diff --git a/source/NVDAObjects/behaviors.py b/source/NVDAObjects/behaviors.py index 2e5364a34..47b1f2bbd 100755 --- a/source/NVDAObjects/behaviors.py +++ b/source/NVDAObjects/behaviors.py @@ -76,7 +76,9 @@ class Dialog(NVDAObject): continue #For particular objects, we want to descend in to them and get their children's message text if childRole in (controlTypes.ROLE_PROPERTYPAGE,controlTypes.ROLE_PANE,controlTypes.ROLE_PANEL,controlTypes.ROLE_WINDOW,controlTypes.ROLE_GROUPING,controlTypes.ROLE_PARAGRAPH,controlTypes.ROLE_SECTION,controlTypes.ROLE_TEXTFRAME,controlTypes.ROLE_UNKNOWN): - textList.append(cls.getDialogText(child)) + childText=cls.getDialogText(child) + if childText: + textList.append(childText) continue # We only want text from certain controls. if not ( @@ -100,7 +102,8 @@ class Dialog(NVDAObject): childText=child.makeTextInfo(textInfos.POSITION_ALL).text if not childText or childText.isspace() and child.TextInfo!=NVDAObjectTextInfo: childText=child.basicText - textList.append(childText) + if childText: + textList.append(childText) return " ".join(textList) def _get_description(self):