mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-06-01 01:01:21 +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
264ec9a7e3
commit
b19b760d82
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 line; // Range of current line.
|
||||||
NSRange eol; // Range of newline character.
|
NSRange eol; // Range of newline character.
|
||||||
unsigned position; // Position in NSString.
|
unsigned position; // Position in NSString.
|
||||||
BOOL firstLine = YES;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Determine the range of the next paragraph of text (in 'para') and set
|
* 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);
|
paraPos = NSMaxRange(eol);
|
||||||
position = para.location;
|
position = para.location;
|
||||||
|
|
||||||
|
style = (NSParagraphStyle*)[self
|
||||||
|
attribute: NSParagraphStyleAttributeName
|
||||||
|
atIndex: position
|
||||||
|
effectiveRange: 0];
|
||||||
|
if (style == nil)
|
||||||
|
style = defStyle;
|
||||||
|
|
||||||
do
|
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.
|
* 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 line; // Range of current line.
|
||||||
NSRange eol; // Range of newline character.
|
NSRange eol; // Range of newline character.
|
||||||
unsigned position; // Position in NSString.
|
unsigned position; // Position in NSString.
|
||||||
BOOL firstLine = YES;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Determine the range of the next paragraph of text (in 'para') and set
|
* 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);
|
paraPos = NSMaxRange(eol);
|
||||||
position = para.location;
|
position = para.location;
|
||||||
|
|
||||||
|
style = (NSParagraphStyle*)[self
|
||||||
|
attribute: NSParagraphStyleAttributeName
|
||||||
|
atIndex: position
|
||||||
|
effectiveRange: 0];
|
||||||
|
if (style == nil)
|
||||||
|
style = defStyle;
|
||||||
|
|
||||||
do
|
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.
|
* Assemble drawing information for the entire line.
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue