mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 20:01:11 +00:00
Fix error in deetermining range of paragraph style - was only working for
text containing a single style. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@6269 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
776b7ca6df
commit
12941a20dc
2 changed files with 27 additions and 14 deletions
|
@ -1,3 +1,8 @@
|
|||
Sat Mar 11 06:32:00 2000 Richard Frith-Macdonald <richard@brainstorm.co.uk>
|
||||
|
||||
* Source/NSStringDrawing.m: Fix error in handling extent of
|
||||
paragraph styles.
|
||||
|
||||
Sat Mar 11 05:54:00 2000 Richard Frith-Macdonald <richard@brainstorm.co.uk>
|
||||
|
||||
* Source/NSPanel.m: Completely reformatted and added some fixes for
|
||||
|
|
|
@ -1153,6 +1153,7 @@ setupLine(GSTextLine *line, NSAttributedString *str, NSRange range,
|
|||
NSString *allText = [self string];
|
||||
unsigned length = [allText length];
|
||||
unsigned paraPos = 0;
|
||||
NSRange styleRange;
|
||||
NSParagraphStyle *style = nil;
|
||||
GSTextLine current;
|
||||
|
||||
|
@ -1184,15 +1185,18 @@ setupLine(GSTextLine *line, NSAttributedString *str, NSRange range,
|
|||
paraPos = NSMaxRange(eol);
|
||||
position = para.location;
|
||||
|
||||
style = (NSParagraphStyle*)[self
|
||||
attribute: NSParagraphStyleAttributeName
|
||||
atIndex: position
|
||||
effectiveRange: 0];
|
||||
if (style == nil)
|
||||
style = defStyle;
|
||||
|
||||
do
|
||||
{
|
||||
if (style == nil || NSMaxRange(styleRange) > position)
|
||||
{
|
||||
style = (NSParagraphStyle*)[self
|
||||
attribute: NSParagraphStyleAttributeName
|
||||
atIndex: position
|
||||
effectiveRange: &styleRange];
|
||||
if (style == nil)
|
||||
style = defStyle;
|
||||
}
|
||||
|
||||
/*
|
||||
* Assemble drawing information for the entire line.
|
||||
*/
|
||||
|
@ -1257,6 +1261,7 @@ setupLine(GSTextLine *line, NSAttributedString *str, NSRange range,
|
|||
NSRange line; // Range of current line.
|
||||
NSRange eol; // Range of newline character.
|
||||
unsigned position; // Position in NSString.
|
||||
BOOL firstLine = YES;
|
||||
|
||||
/*
|
||||
* Determine the range of the next paragraph of text (in 'para') and set
|
||||
|
@ -1274,15 +1279,18 @@ setupLine(GSTextLine *line, NSAttributedString *str, NSRange range,
|
|||
paraPos = NSMaxRange(eol);
|
||||
position = para.location;
|
||||
|
||||
style = (NSParagraphStyle*)[self
|
||||
attribute: NSParagraphStyleAttributeName
|
||||
atIndex: position
|
||||
effectiveRange: 0];
|
||||
if (style == nil)
|
||||
style = defStyle;
|
||||
|
||||
do
|
||||
{
|
||||
if (firstLine == YES)
|
||||
{
|
||||
style = (NSParagraphStyle*)[self
|
||||
attribute: NSParagraphStyleAttributeName
|
||||
atIndex: position
|
||||
effectiveRange: 0];
|
||||
if (style == nil)
|
||||
style = defStyle;
|
||||
}
|
||||
|
||||
/*
|
||||
* Assemble drawing information for the entire line.
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue