From d2b3c10eac24884398333f66270752c100c1b00c Mon Sep 17 00:00:00 2001 From: Michael Curran Date: Mon, 24 Sep 2012 13:43:27 +1000 Subject: [PATCH] msimn appModule: fix errors when trying to type with an input method in the to/cc/bcc fields in Outlook Express. --- source/appModules/msimn.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/source/appModules/msimn.py b/source/appModules/msimn.py index b436084c1..cc8894a43 100644 --- a/source/appModules/msimn.py +++ b/source/appModules/msimn.py @@ -11,7 +11,8 @@ import textInfos import api import appModuleHandler from keyboardHandler import KeyboardInputGesture -from NVDAObjects.IAccessible import sysListView32 +from NVDAObjects.window import Window +from NVDAObjects.IAccessible import IAccessible, sysListView32 import watchdog #Labels for the header fields of an email, by control ID @@ -49,13 +50,14 @@ envelopeNames={ class AppModule(appModuleHandler.AppModule): def event_NVDAObject_init(self,obj): + if not isinstance(obj,Window): return controlID=obj.windowControlID windowHandle=obj.windowHandle parentWindow=winUser.getAncestor(windowHandle,winUser.GA_PARENT) parentClassName=winUser.getClassName(parentWindow) #If this object is an email header field, and we have a custom label for it, #Then set the object's name to the label - if parentClassName=="OE_Envelope" and obj.IAccessibleChildID==0 and envelopeNames.has_key(controlID): + if parentClassName=="OE_Envelope" and isinstance(obj,IAccessible) and obj.IAccessibleChildID==0 and envelopeNames.has_key(controlID): obj.name=envelopeNames[controlID] obj.useITextDocumentSupport=True obj.editValueUnit=textInfos.UNIT_STORY -- 2.11.0