OSDN Git Service

Fix crash in Adobe Reader X after leaving the untagged document options and before...
authorMichael Curran <mick@kulgan.net>
Wed, 2 Feb 2011 08:12:15 +0000 (18:12 +1000)
committerMichael Curran <mick@kulgan.net>
Wed, 2 Feb 2011 08:12:15 +0000 (18:12 +1000)
source/NVDAObjects/IAccessible/adobeAcrobat.py

index 8115b40..ba45a96 100644 (file)
@@ -1,3 +1,4 @@
+import api\r
 import controlTypes\r
 import eventHandler\r
 import winUser\r
@@ -128,6 +129,14 @@ class AcrobatTextInfo(NVDAObjectTextInfo):
 class AcrobatTextNode(EditableText, AcrobatNode):\r
        TextInfo = AcrobatTextInfo\r
 \r
+       def _get_parent(self):\r
+               #hack: This code should be taken out once the crash is fixed in Adobe Reader X.\r
+               #If going parent on a root text node after saying ok to the accessibility options (untagged) and before the processing document dialog appears, Reader X will crash.\r
+               if self.event_childID==0:\r
+                       return api.getDesktopObject()\r
+               else:\r
+                       return super(AcrobatTextNode,self).parent\r
+\r
 class AcrobatSDIWindowClient(IAccessible):\r
 \r
        def __init__(self, **kwargs):\r