From 8564eb73422a9632deb42acce47c4ee780d968b5 Mon Sep 17 00:00:00 2001 From: Nicola Pero Date: Fri, 22 Mar 2002 11:46:08 +0000 Subject: [PATCH] Made a check for line range stricter ... apparently because of a bug elsewhere, the stricter check is needed to prevent a crash git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@13202 72102866-910b-0410-8b05-ffd578937521 --- Source/GSSimpleLayoutManager.m | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Source/GSSimpleLayoutManager.m b/Source/GSSimpleLayoutManager.m index 2f40b8462..aa66a0cb4 100644 --- a/Source/GSSimpleLayoutManager.m +++ b/Source/GSSimpleLayoutManager.m @@ -477,6 +477,9 @@ static NSCharacterSet *invSelectionWordGranularitySet; [[aTextContainer textView] sizeToFit]; [[aTextContainer textView] invalidateTextContainerOrigin]; + /* FIXME - it was reported that at this point lineRange is no longer + * correct ... looks like sizeToFit / invalidateTextContainerOrigin + * migth cause additional relayout. */ [self setNeedsDisplayForLineRange: lineRange inTextContainer: aTextContainer]; } @@ -740,7 +743,7 @@ forStartOfGlyphRange: (NSRange)glyphRange inTextContainer: (NSTextContainer *)aTextContainer { if ([_lineLayoutInformation count] - && redrawLineRange.location < [_lineLayoutInformation count] + && NSMaxRange (redrawLineRange) < [_lineLayoutInformation count] && redrawLineRange.length) { _GNULineLayoutInfo *firstInfo