Indentation changes

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@12413 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Nicola Pero 2002-02-06 01:06:03 +00:00
parent 701315fa80
commit 5198e15983

View file

@ -496,25 +496,23 @@ static NSCharacterSet *invSelectionWordGranularitySet;
inTextContainer: aTextContainer]; inTextContainer: aTextContainer];
} }
/* FIXME: According to the doc, the following method should be able to - (void)drawBackgroundForGlyphRange: (NSRange)glyphRange
* draw in any view after the focus has been locked on it. */ atPoint: (NSPoint)containerOrigin
- (void)drawBackgroundForGlyphRange:(NSRange)glyphRange
atPoint:(NSPoint)containerOrigin
{ {
NSTextContainer *aTextContainer = [self textContainerForGlyphAtIndex: glyphRange.location NSTextContainer *aTextContainer;
effectiveRange: NULL];
NSRect rect = [self boundingRectForGlyphRange: glyphRange aTextContainer = [self textContainerForGlyphAtIndex: glyphRange.location
inTextContainer: aTextContainer]; effectiveRange: NULL];
/* FIXME: Which means that the following <which assumes we are
drawing in a text view> can't be correct */
// clear area under text
[[[aTextContainer textView] backgroundColor] set]; [[[aTextContainer textView] backgroundColor] set];
NSRectFill(rect);
NSRectFill ([self boundingRectForGlyphRange: glyphRange
inTextContainer: aTextContainer]);
} }
- (void)drawGlyphsForGlyphRange:(NSRange)glyphRange - (void)drawGlyphsForGlyphRange: (NSRange)glyphRange
atPoint:(NSPoint)containerOrigin atPoint: (NSPoint)containerOrigin
{ {
NSRange newRange; NSRange newRange;
NSRange selectedRange = [[self firstTextView] selectedRange]; NSRange selectedRange = [[self firstTextView] selectedRange];
@ -563,7 +561,8 @@ forStartOfGlyphRange: (NSRange)glyphRange
- (NSSize) _sizeOfRange: (NSRange)aRange - (NSSize) _sizeOfRange: (NSRange)aRange
{ {
if (aRange.length == 0 || _textStorage == nil if (aRange.length == 0
|| _textStorage == nil
|| NSMaxRange(aRange) > [_textStorage length]) || NSMaxRange(aRange) > [_textStorage length])
{ {
return NSZeroSize; return NSZeroSize;
@ -935,9 +934,10 @@ scanRange(NSScanner *scanner, NSCharacterSet* aSet)
unsigned position; // Position in NSString. unsigned position; // Position in NSString.
NSRect remainingRect = NSZeroRect; NSRect remainingRect = NSZeroRect;
// Determine the range of the next paragraph of text (in 'para') and set /* Determine the range of the next paragraph of text (in 'para')
// 'paraPos' to point after the terminating newline character (if any). and set 'paraPos' to point after the terminating newline
para = NSMakeRange(paraPos, length - paraPos); character (if any). */
para = NSMakeRange (paraPos, length - paraPos);
eol = [allText rangeOfCharacterFromSet: newlines eol = [allText rangeOfCharacterFromSet: newlines
options: NSLiteralSearch options: NSLiteralSearch
range: para]; range: para];
@ -954,6 +954,7 @@ scanRange(NSScanner *scanner, NSCharacterSet* aSet)
position = para.location; position = para.location;
paragraph = [allText substringWithRange: para]; paragraph = [allText substringWithRange: para];
lScanner = [NSScanner scannerWithString: paragraph]; lScanner = [NSScanner scannerWithString: paragraph];
[lScanner setCharactersToBeSkipped: nil]; [lScanner setCharactersToBeSkipped: nil];