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; NSRange found;
unsigned end; 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)]; r = [str lineRangeForRange: NSMakeRange(loc, 1)];
end = NSMaxRange(r); 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 style = [self attribute: NSParagraphStyleAttributeName
atIndex: r.location atIndex: r.location
effectiveRange: &found]; 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.location = NSMaxRange(found);
found.length = end - found.location; found.length = end - found.location;
[self addAttribute: NSParagraphStyleAttributeName [self addAttribute: NSParagraphStyleAttributeName