mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-30 12:50: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;
|
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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue