mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-06-01 21:31:56 +00:00
Avoid making calls to the layout manager with invalid arguments.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@15748 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
2c98ae0b50
commit
b9dbf335e1
1 changed files with 15 additions and 7 deletions
|
@ -2234,13 +2234,19 @@ This method is for user changes; see NSTextView_actions.m.
|
||||||
NSRange glyphRange;
|
NSRange glyphRange;
|
||||||
unsigned glyphIndex;
|
unsigned glyphIndex;
|
||||||
NSRect rect;
|
NSRect rect;
|
||||||
|
|
||||||
charRange = NSMakeRange (aRange.location, 0);
|
charRange = NSMakeRange (aRange.location, 1);
|
||||||
if (charRange.location == [[[_layoutManager textStorage] string] length])
|
if (charRange.location == [[[_layoutManager textStorage] string] length])
|
||||||
{
|
{
|
||||||
rect = NSZeroRect;
|
if (charRange.location == 0)
|
||||||
goto ugly_hack_done;
|
{
|
||||||
}
|
rect = NSZeroRect;
|
||||||
|
goto ugly_hack_done;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
charRange.location--;
|
||||||
|
}
|
||||||
|
|
||||||
glyphRange = [_layoutManager glyphRangeForCharacterRange: charRange
|
glyphRange = [_layoutManager glyphRangeForCharacterRange: charRange
|
||||||
actualCharacterRange: NULL];
|
actualCharacterRange: NULL];
|
||||||
glyphIndex = glyphRange.location;
|
glyphIndex = glyphRange.location;
|
||||||
|
@ -4052,6 +4058,8 @@ configuation! */
|
||||||
NSRange glyphRange;
|
NSRange glyphRange;
|
||||||
NSRect rect;
|
NSRect rect;
|
||||||
|
|
||||||
|
if (!aRange.length)
|
||||||
|
return NSZeroRect;
|
||||||
glyphRange = [_layoutManager glyphRangeForCharacterRange: aRange
|
glyphRange = [_layoutManager glyphRangeForCharacterRange: aRange
|
||||||
actualCharacterRange: NULL];
|
actualCharacterRange: NULL];
|
||||||
rect = [_layoutManager boundingRectForGlyphRange: glyphRange
|
rect = [_layoutManager boundingRectForGlyphRange: glyphRange
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue