From a9fde99732f37a8c7f869acd27dd8e5e8a691e5e Mon Sep 17 00:00:00 2001 From: James Teh Date: Fri, 27 Jan 2012 10:16:05 +1000 Subject: [PATCH] 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. --- source/NVDAObjects/behaviors.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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): -- 2.11.0