Skip to content

Commit

Permalink
* nvda/latex_access.py: Took some code from globalCommands.py which f…
Browse files Browse the repository at this point in the history
…ixes the problem of NotImplementedErrors in certain edit controls. There is still no fix for the repetitive speech problem however.
  • Loading branch information
njsch committed Mar 12, 2011
1 parent 4dbf075 commit 97fde46
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions nvda/latex_access.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,15 @@ def script_toggleMaths (self, Gesture):

def GetLine (self):
"""Retrieves the line of text that the current navigator object is focussed on, then returns it."""
info = api.getFocusObject().makeTextInfo(textInfos.POSITION_CARET)
info.expand(textInfos.UNIT_LINE)
obj = api.getFocusObject()
treeInterceptor = obj.treeInterceptor
if hasattr (treeInterceptor, 'TextInfo') and not treeInterceptor.passThrough:
obj = treeInterceptor
try:
info = obj.makeTextInfo (textInfos.POSITION_CARET)
except (NotImplementedError, RuntimeError):
info = obj.makeTextInfo (textInfos.POSITION_FIRST)
info.expand (textInfos.UNIT_LINE)
currentLine = info.text
return currentLine

Expand Down

0 comments on commit 97fde46

Please sign in to comment.