[Nvda-dev] commit r2727 - in trunk: . source/NVDAObjects/IAccessible
NVDA Subversion
svn at nvda-project.org
Mon Feb 16 10:17:28 UTC 2009
Author: nvda
Date: Mon Feb 16 10:17:27 2009
New Revision: 2727
Log:
Improve IAccessible NVDAObject's _correctRelationForWindow method so that it reuses some info it collects, such as the windowHandle, and it also instanciates the APIClass found, rather than instanciating Window, which will call findBestAPIClass again.
Modified:
trunk/ (props changed)
trunk/source/NVDAObjects/IAccessible/__init__.py
Modified: trunk/source/NVDAObjects/IAccessible/__init__.py
==============================================================================
--- trunk/source/NVDAObjects/IAccessible/__init__.py (original)
+++ trunk/source/NVDAObjects/IAccessible/__init__.py Mon Feb 16 10:17:27 2009
@@ -581,8 +581,13 @@
return None
def _correctRelationForWindow(self,obj):
- if obj and obj.windowHandle!=self.windowHandle and Window.findBestAPIClass(windowHandle=obj.windowHandle)!=IAccessible:
- return Window(windowHandle=obj.windowHandle)
+ if not obj:
+ return None
+ windowHandle=obj.windowHandle
+ if windowHandle!=self.windowHandle:
+ APIClass=Window.findBestAPIClass(windowHandle=windowHandle)
+ if not issubclass(APIClass,IAccessible):
+ return APIClass(windowHandle=windowHandle)
return obj
def _get_parent(self):
More information about the Nvda-dev
mailing list