mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-29 19:27:40 +00:00
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:
parent
6d3aa3231b
commit
a38bc02f22
1 changed files with 7 additions and 13 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue