Indentation tidied

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@10027 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
nico 2001-05-28 22:20:59 +00:00
parent 4957e6afc3
commit c6cb74166b

View file

@ -928,9 +928,13 @@ scanRange(NSScanner *scanner, NSCharacterSet* aSet)
range: para]; range: para];
if (eol.length == 0) if (eol.length == 0)
{
eol.location = length; eol.location = length;
}
else else
{
para.length = eol.location - para.location; para.length = eol.location - para.location;
}
paraPos = NSMaxRange(eol); paraPos = NSMaxRange(eol);
position = para.location; position = para.location;
@ -954,18 +958,24 @@ scanRange(NSScanner *scanner, NSCharacterSet* aSet)
unsigned scannerPosition = localLineStartIndex; unsigned scannerPosition = localLineStartIndex;
if (NSIsEmptyRect(remainingRect)) if (NSIsEmptyRect(remainingRect))
{
fragmentRect = NSMakeRect (0, drawingPoint.y, HUGE, HUGE); fragmentRect = NSMakeRect (0, drawingPoint.y, HUGE, HUGE);
}
else else
{
fragmentRect = remainingRect; fragmentRect = remainingRect;
}
fragmentRect = [aTextContainer lineFragmentRectForProposedRect: fragmentRect fragmentRect = [aTextContainer
lineFragmentRectForProposedRect: fragmentRect
sweepDirection: NSLineSweepRight sweepDirection: NSLineSweepRight
movementDirection: NSLineMoveDown movementDirection: NSLineMoveDown
remainingRect: &remainingRect]; remainingRect: &remainingRect];
if (NSIsEmptyRect(fragmentRect)) if (NSIsEmptyRect(fragmentRect))
{ {
// No more space in the text container, give up doing the layout // No more space in the text container, give up doing the layout
return NSMakeRange(aLine, MAX(1, [_lineLayoutInformation count] - aLine)); int a = MAX (1, [_lineLayoutInformation count] - aLine);
return NSMakeRange(aLine, a);
} }
width = fragmentRect.size.width - 2 * padding; width = fragmentRect.size.width - 2 * padding;
@ -990,11 +1000,15 @@ scanRange(NSScanner *scanner, NSCharacterSet* aSet)
= scanRange(lScanner, selectionWordGranularitySet); = scanRange(lScanner, selectionWordGranularitySet);
if (leadingSpacesRange.length) if (leadingSpacesRange.length)
{
currentStringRange = NSUnionRange(leadingSpacesRange, currentStringRange = NSUnionRange(leadingSpacesRange,
currentStringRange); currentStringRange);
}
if (trailingSpacesRange.length) if (trailingSpacesRange.length)
{
currentStringRange = NSUnionRange(trailingSpacesRange, currentStringRange = NSUnionRange(trailingSpacesRange,
currentStringRange); currentStringRange);
}
// evaluate size of current word // evaluate size of current word
advanceSize = [self _sizeOfRange: advanceSize = [self _sizeOfRange:
@ -1031,7 +1045,9 @@ scanRange(NSScanner *scanner, NSCharacterSet* aSet)
} }
} }
else else
{
isBuckled = NO; isBuckled = NO;
}
// line to long // line to long
if (usedLineRect.size.width + advanceSize.width > width || if (usedLineRect.size.width + advanceSize.width > width ||
@ -1062,17 +1078,21 @@ scanRange(NSScanner *scanner, NSCharacterSet* aSet)
scannerPosition += eol.length; scannerPosition += eol.length;
usedLineRect.size.width += 1; usedLineRect.size.width += 1;
// FIXME: This should use the real font size!! // FIXME: This should use the real font size!!
if (!usedLineRect.size.height) if (usedLineRect.size.height == 0)
{
usedLineRect.size.height = 12; usedLineRect.size.height = 12;
} }
} }
}
lineGlyphRange = NSMakeRange (startingLineCharIndex, lineGlyphRange = NSMakeRange (startingLineCharIndex,
scannerPosition - localLineStartIndex); scannerPosition - localLineStartIndex);
// Adjust the height of the line fragment rect, as this will the to big // Adjust the height of the line fragment rect, as this will
// the to big
fragmentRect.size.height = usedLineRect.size.height; fragmentRect.size.height = usedLineRect.size.height;
// This range is to small, as there are more lines that fit into the container // This range is to small, as there are more lines that fit
// into the container
[self setTextContainer: aTextContainer [self setTextContainer: aTextContainer
forGlyphRange: lineGlyphRange]; forGlyphRange: lineGlyphRange];
@ -1080,7 +1100,8 @@ scanRange(NSScanner *scanner, NSCharacterSet* aSet)
forGlyphRange: lineGlyphRange forGlyphRange: lineGlyphRange
usedRect: usedLineRect]; usedRect: usedLineRect];
// This range is too big, as there are different runs in the glyph range // This range is too big, as there are different runs in the
// glyph range
[self setLocation: NSMakePoint(0.0, 0.0) [self setLocation: NSMakePoint(0.0, 0.0)
forStartOfGlyphRange: lineGlyphRange]; forStartOfGlyphRange: lineGlyphRange];
@ -1095,9 +1116,9 @@ scanRange(NSScanner *scanner, NSCharacterSet* aSet)
{ {
float yDisplacement = 0; float yDisplacement = 0;
// is it possible to simply patch layout changes // is it possible to simply patch layout changes into
// into layout array instead of doing a time // layout array instead of doing a time consuming re -
// consuming re - layout of the whole doc? // layout of the whole doc?
if ([self _relocLayoutArray: ghostArray if ([self _relocLayoutArray: ghostArray
offset: insertionDelta offset: insertionDelta
floatTrift: &yDisplacement]) floatTrift: &yDisplacement])
@ -1106,7 +1127,9 @@ scanRange(NSScanner *scanner, NSCharacterSet* aSet)
// y displacement: redisplay all remaining lines // y displacement: redisplay all remaining lines
if (yDisplacement) if (yDisplacement)
{
erg = [_lineLayoutInformation count] - aLine; erg = [_lineLayoutInformation count] - aLine;
}
else else
{ {
// return 2: redisplay only this and previous line // return 2: redisplay only this and previous line