[Nvda-dev] commit r2918 - in trunk/source: NVDAObjects textInfos

NVDA Subversion svn at nvda-project.org
Mon May 11 04:01:18 UTC 2009


Author: nvda
Date: Mon May 11 04:01:15 2009
New Revision: 2918

Log:
Reimplemented base code for _getLineOffsets in OffsetsTextInfo. Like _getWordOffsets, this uses the text in the document to find the offsets. Its preferable that this method not get used much at all (subclasses should try not to call super heeps, but at least for now this should make NVDA act like it used to, in regards to controls with broken line offsets. However, not having access to one of these, please let me know if the problem is fixed (specifically thebat email client). also removed _getLineOffsets from NVDAObjectTextInfo, as offsetsTextInfo now handles this.

Modified:
   trunk/source/NVDAObjects/__init__.py
   trunk/source/textInfos/offsets.py

Modified: trunk/source/NVDAObjects/__init__.py
==============================================================================
--- trunk/source/NVDAObjects/__init__.py	(original)
+++ trunk/source/NVDAObjects/__init__.py	Mon May 11 04:01:15 2009
@@ -36,12 +36,6 @@
 		text=self._getStoryText()
 		return text[start:end]
 
-	def _getLineOffsets(self,offset):
-		storyText=self._getStoryText()
-		start=textInfos.offsets.findStartOfLine(storyText,offset)
-		end=textInfos.offsets.findEndOfLine(storyText,offset)
-		return [start,end]
-
 class DynamicNVDAObjectType(baseObject.ScriptableObject.__class__):
 	_dynamicClassCache={}
 

Modified: trunk/source/textInfos/offsets.py
==============================================================================
--- trunk/source/textInfos/offsets.py	(original)
+++ trunk/source/textInfos/offsets.py	Mon May 11 04:01:15 2009
@@ -146,6 +146,9 @@
 	def _getStoryLength(self):
 		raise NotImplementedError
 
+	def _getStoryText(self):
+		raise NotImplementedError
+
 	def _getTextRange(self,start,end):
 		raise NotImplementedError
 
@@ -174,7 +177,10 @@
 		raise NotImplementedError
 
 	def _getLineOffsets(self,offset):
-		raise NotImplementedError
+		text=self._getStoryText()
+		start=findStartOfLine(text,offset)
+		end=findEndOfLine(text,offset)
+		return [start,end]
 
 	def _getParagraphOffsets(self,offset):
 		raise NotImplementedError



More information about the Nvda-dev mailing list