fixed some c99-isms

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@31556 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Riccardo Mottola 2010-10-24 21:22:59 +00:00
parent 71783836f1
commit 7938a855d3
2 changed files with 15 additions and 5 deletions

View file

@ -1,3 +1,8 @@
2010-10-24 Riccardo Mottola
* Source/NSTextView.m
Fixed some c99-isms
2010-10-22 David Chisnall <theraven@gna.org>
* Source/NSTextView.m

View file

@ -3847,6 +3847,10 @@ Figure out how the additional layout stuff is supposed to work.
NSUInteger end = i + drawnRange.length;
while (i < end)
{
NSUInteger rectCount;
NSRectArray rects;
NSUInteger j;
// Find the next tooltip
id text = [_textStorage attribute: NSToolTipAttributeName
atIndex: i
@ -3858,13 +3862,11 @@ Figure out how the additional layout stuff is supposed to work.
continue;
}
// If there is one, find the rectangles it uses.
NSUInteger rectCount;
NSRectArray rects =
rects =
[_layoutManager rectArrayForCharacterRange: r
withinSelectedCharacterRange: NSMakeRange(0, 0)
inTextContainer: _textContainer
rectCount: &rectCount];
NSUInteger j;
// Add this object as the tooltip provider for each rectangle
for (j=0 ; j<rectCount ; j++)
{
@ -3886,8 +3888,11 @@ Figure out how the additional layout stuff is supposed to work.
FOR_IN(GSTrackingRect*, rect, _tracking_rects)
if (rect->tag == tag)
{
NSPoint origin;
NSUInteger startIndex;
// Origin is in window coordinate space
NSPoint origin = rect->rectangle.origin;
origin = rect->rectangle.origin;
// Point is an offset from this origin - translate it to the window's
// coordinate space
point.x += origin.x;
@ -3896,7 +3901,7 @@ Figure out how the additional layout stuff is supposed to work.
point = [self convertPoint: point
fromView: nil];
// Find out what the corresponding text is.
NSUInteger startIndex = [self _characterIndexForPoint: point
startIndex = [self _characterIndexForPoint: point
respectFraction: NO];
// Look up what the tooltip text should be.
return [_textStorage attribute: NSToolTipAttributeName