diff --git a/AppKit/CPTextView/CPFontPanel.j b/AppKit/CPTextView/CPFontPanel.j index c947da63e..91f7e6e1b 100755 --- a/AppKit/CPTextView/CPFontPanel.j +++ b/AppKit/CPTextView/CPFontPanel.j @@ -49,10 +49,10 @@ var kTypefaceIndex_Normal = 0, kTypefaceIndex_Italic = 1, kTypefaceIndex_Bold = 2, - kTypefaceIndex_BoldItalic = 3; + kTypefaceIndex_BoldItalic = 3, kToolbarHeight = 32, kBorderSpacing = 6, - kInnerSpacing = 2; + kInnerSpacing = 2, kNothingChanged = 0, kFontNameChanged = 1, kTypefaceChanged = 2, @@ -60,7 +60,7 @@ var kTypefaceIndex_Normal = 0, kTextColorChanged = 4, kBackgroundColorChanged = 5, kUnderlineChanged = 6, - kWeightChanged = 7; + kWeightChanged = 7, _sharedFontPanel; // FIXME Locale support @@ -76,9 +76,7 @@ var _availableTraits= [@"Normal", @"Italic", @"Bold", @"Bold Italic"], - (id)initWithFrame:(CGRect)rect { - self = [super initWithFrame:rect]; - - if (self) + if (self = [super initWithFrame:rect]) { _textStorage = [[CPTextStorage alloc] init]; _layoutManager = [[CPLayoutManager alloc] init]; diff --git a/AppKit/CPTextView/CPLayoutManager.j b/AppKit/CPTextView/CPLayoutManager.j index 59edba9eb..adb706e1e 100755 --- a/AppKit/CPTextView/CPLayoutManager.j +++ b/AppKit/CPTextView/CPLayoutManager.j @@ -81,7 +81,9 @@ _oncontextmenuhandler = function () { return false; }; } } - return ((-first - 1) >= 0) ? result : CPNotFound; + var result = -first - 1; + + return result >= 0 ? result : CPNotFound; } @end @@ -410,12 +412,10 @@ var _objectsInRange = function(aList, aRange) */ @implementation CPLayoutManager : CPObject { - Class _lineFragmentFactory @accessors(setter:setLineFragmentFactory:); - CPMutableArray _textContainers @accessors(getter=textContainers); - CPTextStorage _textStorage @accessors(property=textStorage); - CPTypesetter _typesetter @accessors(property=typesetter); - - id _delegate; + Class _lineFragmentFactory @accessors(setter=setLineFragmentFactory:); + CPMutableArray _textContainers @accessors(getter=textContainers); + CPTextStorage _textStorage @accessors(property=textStorage); + CPTypesetter _typesetter @accessors(property=typesetter); CPMutableArray _lineFragments; CPMutableArray _lineFragmentsForRescue; @@ -778,7 +778,7 @@ var _objectsInRange = function(aList, aRange) - (CPRange)glyphRangeForBoundingRect:(CGRect)aRect inTextContainer:(CPTextContainer)container { - var c = [_lineFragments count]; + var c = [_lineFragments count], range; for (var i = 0; i < c; i++) diff --git a/AppKit/CPTextView/CPParagraphStyle.j b/AppKit/CPTextView/CPParagraphStyle.j index 43f5f370f..78ec1530d 100755 --- a/AppKit/CPTextView/CPParagraphStyle.j +++ b/AppKit/CPTextView/CPParagraphStyle.j @@ -31,6 +31,8 @@ var _sharedDefaultParagraphStyle, CPLeftTabStopType = 0; +@global CPLeftTextAlignment + /* CPLeftTextAlignment = 0; CPCenterTextAlignment = 1; diff --git a/AppKit/CPTextView/CPTextContainer.j b/AppKit/CPTextView/CPTextContainer.j index 21b6d48e0..259a58d1f 100755 --- a/AppKit/CPTextView/CPTextContainer.j +++ b/AppKit/CPTextView/CPTextContainer.j @@ -145,7 +145,7 @@ CPLineMovesUp = 4; - (void)textViewFrameChanged:(CPNotification)aNotification { - var newSize = CGMakeSize([_textView frame].size.width, _size.height); + var newSize = CGSizeMake([_textView frame].size.width, _size.height); [self setContainerSize:newSize]; } diff --git a/AppKit/CPTextView/CPTextView.j b/AppKit/CPTextView/CPTextView.j index 8443f08fc..85dbefbf4 100755 --- a/AppKit/CPTextView/CPTextView.j +++ b/AppKit/CPTextView/CPTextView.j @@ -789,7 +789,7 @@ var kDelegateRespondsTo_textShouldBeginEditing - (void)moveDown:(id)sender { - if (!isSelectable) + if (!_isSelectable) return; var fraction = [], diff --git a/AppKit/CPTextView/_CPRTFProducer.j b/AppKit/CPTextView/_CPRTFProducer.j index a1b289e58..fc73ae830 100755 --- a/AppKit/CPTextView/_CPRTFProducer.j +++ b/AppKit/CPTextView/_CPRTFProducer.j @@ -65,8 +65,7 @@ function _points2twips(a) { return (a) * 20.0; } + (CPString)produceRTF:(CPAttributedString)aText documentAttributes:(CPDictionary)dict { - var mynew = [self new], - data; + var mynew = [self new]; return [mynew RTFDStringFromAttributedString:aText documentAttributes:dict]; } @@ -172,7 +171,7 @@ function _points2twips(a) { return (a) * 20.0; } - (CPString)documentAttributes { - if (!docDitc) + if (!docDict) return @""; var result,