* Source/GSLayoutManager.m

(-glyphRangeForCharacterRange:actualCharacterRange:): Try to
handle attachments at the end of the file more graceful.
This commit is contained in:
fredkiefer 2018-01-14 18:17:05 +01:00
parent 85ba90244b
commit d31ae5f49b
2 changed files with 9 additions and 18 deletions

View file

@ -1,3 +1,9 @@
2018-01-14 Fred Kiefer <FredKiefer@gmx.de>
* Source/GSLayoutManager.m
(-glyphRangeForCharacterRange:actualCharacterRange:): Try to
handle attachments at the end of the file more graceful.
2018-01-07 Fred Kiefer <FredKiefer@gmx.de>
* Source/NSView.m (-_rebuildCoordinates): Use simple path only

View file

@ -1127,21 +1127,6 @@ Fills in all glyph holes up to last. only looking at levels below level
unsigned int cpos, pos;
unsigned int i, target;
/* TODO: should this really be valid?
This is causing all kinds of problems when border glyph ranges are passed
to other functions. Better to keep the layout manager clean of all this and
let NSTextView deal with it.
*/
#if 1
if (charRange.length == 0 && charRange.location == [[_textStorage string] length])
{
if (actualCharRange)
*actualCharRange = NSMakeRange([[_textStorage string] length], 0);
return NSMakeRange([self numberOfGlyphs], 0);
}
#endif
if (charRange.length == 0 && charRange.location == 0)
{
if (actualCharRange)
@ -1152,9 +1137,9 @@ Fills in all glyph holes up to last. only looking at levels below level
[self _generateGlyphsUpToCharacter: pos];
if (glyphs->char_length <= pos)
{
[NSException raise: NSRangeException
format: @"%s character range out of range", __PRETTY_FUNCTION__];
return NSMakeRange(0, 0);
if (actualCharRange)
*actualCharRange = NSMakeRange([[_textStorage string] length], 0);
return NSMakeRange([self numberOfGlyphs], 0);
}
target = charRange.location;