Added missing method [isValidGlyphIndex:].

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@17749 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Fred Kiefer 2003-09-29 21:25:46 +00:00
parent e786dfcf87
commit 3480b30e56
2 changed files with 17 additions and 0 deletions

View file

@ -186,6 +186,9 @@ to NO. */
- (NSGlyph) glyphAtIndex: (unsigned int)glyphIndex
isValidIndex: (BOOL *)isValidIndex;
/* Returns if the glyph at glyphIndex is valid or not */
- (BOOL) isValidGlyphIndex: (unsigned int)glyphIndex;
/* Copies displayed glyphs to glyphArray for glyphRange. Returns the number
of glyphs actually copied to the array. NSRangeException of the range is
invalid (extends beyond the end of glyphs). */

View file

@ -719,6 +719,20 @@ not completely accurate).
return r->glyphs[glyphIndex].g;
}
- (BOOL) isValidGlyphIndex: (unsigned int)glyphIndex
{
if (glyphIndex == (unsigned int)-1)
return NO;
if (glyphs->glyph_length <= glyphIndex)
{
return NO;
}
else
{
return YES;
}
}
- (unsigned int) getGlyphs: (NSGlyph *)glyphArray
range: (NSRange)glyphRange