Small correction in [fixParagraphStyleAttributeInRange]

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@7765 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Fred Kiefer 2000-10-08 20:29:12 +00:00
parent 6d3aa3231b
commit a38bc02f22

View file

@ -606,25 +606,19 @@ documentAttributes: (NSDictionary**)dict
NSRange found;
unsigned end;
/*
* Extend loc to take in entire paragraph if necessary.
*/
// Extend loc to take in entire paragraph if necessary.
r = [str lineRangeForRange: NSMakeRange(loc, 1)];
end = NSMaxRange(r);
/*
* get the style in effect at the paragraph start.
*/
// get the style in effect at the paragraph start.
style = [self attribute: NSParagraphStyleAttributeName
atIndex: r.location
effectiveRange: &found];
atIndex: r.location
longestEffectiveRange: &found
inRange: r];
if (NSMaxRange(found) < end)
if (style != nil && NSMaxRange(found) < end)
{
/*
* Styles differ - add the old style to the remainder of the
* range.
*/
// Styles differ - add the old style to the remainder of the range.
found.location = NSMaxRange(found);
found.length = end - found.location;
[self addAttribute: NSParagraphStyleAttributeName