Moved constant invocation of the method -[NSParagraphStyle

attribute:atIndex:effectiveRange:]   outside  of  loops   and  removed
firstLine variable in -drawAtPoint: and in -size.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@6261 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Pascal J. Bourguignon 2000-03-10 18:19:16 +00:00
parent 13588f337a
commit 8aef6e88e3

View file

@ -1167,7 +1167,6 @@ 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
@ -1185,18 +1184,15 @@ 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.
*/
@ -1261,7 +1257,6 @@ 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
@ -1279,18 +1274,15 @@ 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.
*/