Changeset 2315

Show
Ignore:
Timestamp:
07/29/08 00:04:46 (4 months ago)
Author:
mdcurran
Message:

textHandler.findStartOfWord and textHandler.findEndOfWord: if the offset given is greater or equal to the length of the text, just return that offset, or in end's case, that offset+1. Previously it was moving the offset back to the last offset in the text in order for it to successfully search for words. However if the offset is really past the text, then it shouldn't look at all. This fixes a lot of double speaking of words in Open Office when moving by word, and also fixes a few exceptions.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/source/textHandler.py

    r2176 r2315  
    419419""" 
    420420        if offset>=len(text): 
    421                 offset=len(text)-1 
     421                return offset 
    422422        while offset>0 and text[offset].isspace(): 
    423423                offset-=1 
     
    441441""" 
    442442        if offset>=len(text): 
    443                 offset=len(text)-1 
     443                return offset+1 
    444444        if text[offset].isalnum(): 
    445445                while offset<len(text) and text[offset].isalnum():