Fix two incorrect comparisons in NSLayoutManager which were causing

range exceptions when moving the cursor up in the first line and down
in the last line of a NSTextView, respectively.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@34375 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Wolfgang Lux 2012-01-01 11:29:20 +00:00
parent 4eac748b62
commit 95c5829fa5
2 changed files with 8 additions and 1 deletions

View file

@ -1,3 +1,10 @@
2012-01-01 Wolfgang Lux <wolfgang.lux@gmail.com>
* Source/NSLayoutManager.m (-characterIndexMoving:...): Fix two
incorrect comparisons which were causing range exceptions when
moving the cursor up in the first line and down in the last line
of a NSTextView, respectively.
2011-12-31 Eric Wasylishen <ewasylishen@gmail.com>
* Source/NSPrintOperation.m (_print): Fix read of uninitialized

View file

@ -1012,7 +1012,7 @@ has the same y origin and height as the line frag rect it is in.
const int delta = (direction == GSInsertionPointMoveUp) ? -1 : 1;
/* First scan forward or backwards until we end up on a new line */
for (new = from; (direction == GSInsertionPointMoveUp) ? (new >= 0) : (new <= length); new += delta)
for (new = from; (direction == GSInsertionPointMoveUp) ? (new > 0) : (new < length); new += delta)
{
new_rect = [self _insertionPointRectForCharacterIndex: new
textContainer: &new_tc];