mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-29 19:07:38 +00:00
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:
parent
13588f337a
commit
8aef6e88e3
1 changed files with 14 additions and 22 deletions
|
@ -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.
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue