From 572c92a2d19830ab7a00932c68cd54bab4ec6913 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Peter=20V=C3=A1gner?= Date: Sat, 5 Feb 2011 11:35:38 +0100 Subject: [PATCH] Fixed retrieving line offsets in AkelPad when the wordwrap mode is turned on (thx to Kostadin Kolev for bringing it up) --- source/NVDAObjects/window/akelEdit.py | 18 +++++++++++++++--- user_docs/en/changes.t2t | 1 + 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/source/NVDAObjects/window/akelEdit.py b/source/NVDAObjects/window/akelEdit.py index d8f1d1c6e..e3a285897 100644 --- a/source/NVDAObjects/window/akelEdit.py +++ b/source/NVDAObjects/window/akelEdit.py @@ -4,7 +4,6 @@ #See the file COPYING for more details. import edit -import IAccessibleHandler import winUser import winKernel import ctypes @@ -19,8 +18,8 @@ AEM_RICHOFFSETTOINDEX =(winUser.WM_USER + 2113) #AEM_GETINDEX flags AEGI_LASTCHAR =2 -AEGI_NEXTBREAK =12 -AEGI_PREVBREAK =13 +AEGI_CARETCHAR =5 +AEGI_NEXTLINE =8 #Structures @@ -58,6 +57,19 @@ class AkelEditTextInfo(edit.EditTextInfo): winKernel.virtualFreeEx(processHandle,internalCiChar,0,winKernel.MEM_RELEASE) return ciChar.nLine + def _getLineOffsets(self,offset): + (start,end)=super(AkelEditTextInfo,self)._getLineOffsets(offset) + if end == self._getStoryLength(): + return (start,end) + ciChar=AECHARINDEX() + processHandle=self.obj.processHandle + internalCiChar=winKernel.virtualAllocEx(processHandle,None,ctypes.sizeof(ciChar),winKernel.MEM_COMMIT,winKernel.PAGE_READWRITE) + winUser.sendMessage(self.obj.windowHandle,AEM_GETINDEX,AEGI_CARETCHAR,internalCiChar) + winUser.sendMessage(self.obj.windowHandle,AEM_GETINDEX,AEGI_NEXTLINE,internalCiChar) + end=winUser.sendMessage(self.obj.windowHandle,AEM_INDEXTORICHOFFSET,0,internalCiChar)-1 + winKernel.virtualFreeEx(processHandle,internalCiChar,0,winKernel.MEM_RELEASE) + return (start,end) + def _getStoryLength(self): ciChar=AECHARINDEX() processHandle=self.obj.processHandle diff --git a/user_docs/en/changes.t2t b/user_docs/en/changes.t2t index 56f560824..debe375fe 100644 --- a/user_docs/en/changes.t2t +++ b/user_docs/en/changes.t2t @@ -65,6 +65,7 @@ Highlights of this release include reporting of colors for some controls; automa - NVDA now switches to the appropriate braille display driver when you revert to saved configuration. (#1346) - The Visual Studio 2008 Project Wizard is read correctly again. (#974) - NVDA no longer completely fails to work in applications which contain non-ASCII characters in their executable name. (#1352) +- NVDA no longer reads first character of the following line at the end of the current line when reading in the AkelEdit controls (AkelPad) and the word wrap mode is turned on. == Changes for Developers == -- 2.11.0