Fixed: capp_lint

This commit is contained in:
Alexandre Wilhelm authored and daboe01 committed 2014-07-12 13:58:38 +02:00
1 parent f2db18820a
commit 393113c3e3
5 files changed
+19 -30

No files matched your search

+1 -1
View File
@@ -679,7 +679,7 @@ var _objectsInRange = function(aList, aRange)
oldLength = CPMaxRange([_lineFragmentsForRescue lastObject]._range),
newLength = [[_textStorage string].length];
if(ABS(newLength - oldLength) > 1)
if (ABS(newLength - oldLength) > 1)
return NO;
if (![oldLineFragment isVisuallyIdenticalToFragment: newLineFragment])
+3 -2
View File
@@ -139,9 +139,10 @@ CPLineMovesUp = 4;
}
}
- (void) textViewFrameChanged:(CPNotification)aNotification
- (void)textViewFrameChanged:(CPNotification)aNotification
{
var newSize=CPMakeSize([_textView frame].size.width, _size.height);
var newSize = CGMakeSize([_textView frame].size.width, _size.height);
[self setContainerSize:newSize];
}
+5 -24
View File
@@ -39,8 +39,11 @@ CPTextStorageDidProcessEditingNotification = @"CPTextStorageDidProcessEditingNot
@ingroup appkit
@class CPTextStorage
*/
@implementation CPTextStorage : CPAttributedString
@implementation CPTextStorage : CPMutableAttributedString
{
CPColor _foregroundColor @accessors(property=foregroundColor);
CPFont _font @accessors(property=font);
CPMutableArray _layoutManagers;
id _delegate;
@@ -48,9 +51,6 @@ CPTextStorageDidProcessEditingNotification = @"CPTextStorageDidProcessEditingNot
unsigned _editedMask;
CPRange _editedRange;
int _editCount; // {begin,end}Editing counter
CPFont _font;
CPColor _foregroundColor;
}
- (id)initWithString:(CPString)aString attributes:(CPDictionary)attributes
@@ -255,30 +255,11 @@ CPTextStorageDidProcessEditingNotification = @"CPTextStorageDidProcessEditingNot
[self endEditing];
}
- (void)setFont:(CPFont)aFont
{
_font = aFont;
}
- (CPFont)font
{
return _font;
}
- (void)setForegroundColor:(CPColor)color
{
_foregroundColor = color;
}
- (CPColor)foregroundColor
{
return _foregroundColor;
}
- (CPAttributedString)attributedSubstringFromRange:(CPRange)aRange
{
if (!aRange.length)
return [CPAttributedString new];
return [super attributedSubstringFromRange:aRange];
}
@end
+2 -2
View File
@@ -297,7 +297,7 @@ var kDelegateRespondsTo_textShouldBeginEditing
BOOL _drawCaret;
CPTimer _caretTimer;
CPTimer _scollingTimer;
CPRect _caretRect;
CGRect _caretRect;
CPFont _font;
CPColor _textColor;
@@ -1271,7 +1271,7 @@ var kDelegateRespondsTo_textShouldBeginEditing
changedRange = _selectionRange;
if (_previousSelectionGranularity > 0 &&
changedRange.location > 0 && [self _isCharacterAtIndex:changedRange.location-1 granularity:_previousSelectionGranularity] &&
changedRange.location > 0 && [self _isCharacterAtIndex:(changedRange.location - 1) granularity:_previousSelectionGranularity] &&
changedRange.location < [[self string] length] && [self _isCharacterAtIndex:CPMaxRange(changedRange) granularity:_previousSelectionGranularity])
changedRange.length++;
[self _deleteForRange:changedRange];
+8 -1
View File
@@ -351,25 +351,32 @@ var _sharedSimpleTypesetter = nil;
lineOrigin.x += rangeWidth;
isTabStop = NO;
}
if (isNewline)
{
if ([_currentParagraph minimumLineHeight])
_lineHeight = MAX(_lineHeight, [_currentParagraph minimumLineHeight]);
if ([_currentParagraph maximumLineHeight])
_lineHeight = MIN(_lineHeight, [_currentParagraph maximumLineHeight]);
lineOrigin.y += _lineHeight;
if ([_currentParagraph lineSpacing])
lineOrigin.y += [_currentParagraph lineSpacing];
if (lineOrigin.y > [_currentTextContainer containerSize].height)
{
_indexOfCurrentContainer++;
_indexOfCurrentContainer=MAX(_indexOfCurrentContainer, [[_layoutManager textContainers] count] - 1);
_indexOfCurrentContainer = MAX(_indexOfCurrentContainer, [[_layoutManager textContainers] count] - 1);
_currentTextContainer = [[_layoutManager textContainers] objectAtIndex: _indexOfCurrentContainer];
}
lineOrigin.x = 0;
numLines++;
isNewline = NO;
}
_lineWidth = 0;
advancements = [];
currentAnchor = 0;