diff --git a/AppKit/CPComboBox.j b/AppKit/CPComboBox.j index 839d21141..317de9d1e 100644 --- a/AppKit/CPComboBox.j +++ b/AppKit/CPComboBox.j @@ -74,7 +74,7 @@ var CPComboBoxTextSubview = @"text", BOOL _usesDataSource; CGSize _intercellSpacing; CPArray _items; - id _dataSource; + id _dataSource; CPInteger _implementedDelegateComboBoxMethods; CPString _selectedStringValue; float _itemHeight; diff --git a/AppKit/CPControl.j b/AppKit/CPControl.j index cb7be84e3..91198dbef 100644 --- a/AppKit/CPControl.j +++ b/AppKit/CPControl.j @@ -240,7 +240,7 @@ var CPControlBlackColor = [CPColor blackColor]; */ - (ThemeState)_controlSizeThemeState { - switch(_controlSize) + switch (_controlSize) { case CPSmallControlSize: return CPThemeStateControlSizeSmall; diff --git a/AppKit/CPKeyValueBinding.j b/AppKit/CPKeyValueBinding.j index 662280d16..c104eba86 100644 --- a/AppKit/CPKeyValueBinding.j +++ b/AppKit/CPKeyValueBinding.j @@ -182,7 +182,7 @@ var CPBindingOperationAnd = 0, allBindings = [bindingsForObject allKeys], count = [allBindings count]; - while(count--) + while (count--) { if ([[anObject class] isBindingExclusive:allBindings[count]]) return NO; diff --git a/AppKit/CPRadio.j b/AppKit/CPRadio.j index bb845aef3..5b40fa8ed 100644 --- a/AppKit/CPRadio.j +++ b/AppKit/CPRadio.j @@ -269,9 +269,9 @@ var CPRadioRadioGroupKey = @"CPRadioRadioGroupKey"; - (BOOL)selectRadioWithTag:(int)tag { var index = [_radios indexOfObjectPassingTest:function(radio) - { - return [radio tag] === tag; - }]; + { + return [radio tag] === tag; + }]; if (index !== CPNotFound) { diff --git a/AppKit/CPRuleEditor/CPPredicateEditorRowTemplate.j b/AppKit/CPRuleEditor/CPPredicateEditorRowTemplate.j index a774f6bb3..0ce2e2f0e 100644 --- a/AppKit/CPRuleEditor/CPPredicateEditorRowTemplate.j +++ b/AppKit/CPRuleEditor/CPPredicateEditorRowTemplate.j @@ -487,9 +487,9 @@ CPTransformableAttributeType = 1800; - (id)copy { - var views = [CPArray array]; + var views = [CPArray array], + copy = [[[self class] alloc] init]; - var copy = [[[self class] alloc] init]; [copy _setTemplateType:_templateType]; [copy _setOptions:_predicateOptions]; [copy _setModifier:_predicateModifier]; diff --git a/AppKit/CPSearchField.j b/AppKit/CPSearchField.j index a6c11d8c6..e6c12bfb4 100644 --- a/AppKit/CPSearchField.j +++ b/AppKit/CPSearchField.j @@ -34,9 +34,8 @@ CPSearchFieldRecentsMenuItemTag = 1001; CPSearchFieldClearRecentsMenuItemTag = 1002; CPSearchFieldNoRecentsMenuItemTag = 1003; -var CPAutosavedRecentsChangedNotification = @"CPAutosavedRecentsChangedNotification"; - -var RECENT_SEARCH_PREFIX = @" "; +var CPAutosavedRecentsChangedNotification = @"CPAutosavedRecentsChangedNotification", + RECENT_SEARCH_PREFIX = @" "; /*! @ingroup appkit diff --git a/AppKit/CPSegmentedControl.j b/AppKit/CPSegmentedControl.j index fb6c9bc28..f9d6a2ef9 100644 --- a/AppKit/CPSegmentedControl.j +++ b/AppKit/CPSegmentedControl.j @@ -504,7 +504,7 @@ CPSegmentSwitchTrackingMomentary = 2; */ - (void)drawSegmentBezel:(int)aSegment highlight:(BOOL)shouldHighlight { - if(aSegment < _themeStates.length) + if (aSegment < _themeStates.length) { if (shouldHighlight) _themeStates[aSegment] = _themeStates[aSegment].and(CPThemeStateHighlighted); diff --git a/AppKit/CPTableHeaderView.j b/AppKit/CPTableHeaderView.j index 8badaef34..36d6d1ef1 100644 --- a/AppKit/CPTableHeaderView.j +++ b/AppKit/CPTableHeaderView.j @@ -68,7 +68,7 @@ _textField = [[_CPImageAndTextView alloc] initWithFrame: CGRectMake(5.0, 0.0, CGRectGetWidth([self bounds]) - 10.0, CGRectGetHeight([self bounds]))]; - [_textField setAutoresizingMask:CPViewWidthSizable|CPViewHeightSizable]; + [_textField setAutoresizingMask:CPViewWidthSizable | CPViewHeightSizable]; [_textField setLineBreakMode:CPLineBreakByTruncatingTail]; [_textField setTextColor:[CPColor colorWithRed:51.0 / 255.0 green:51.0 / 255.0 blue:51.0 / 255.0 alpha:1.0]]; @@ -196,7 +196,7 @@ maxX = CGRectGetMaxX(bounds) - 0.5; CGContextSetLineWidth(context, 1); - CGContextSetStrokeColor(context, [CPColor colorWithWhite:192.0/255.0 alpha:1.0]); + CGContextSetStrokeColor(context, [CPColor colorWithWhite:192.0 / 255.0 alpha:1.0]); CGContextBeginPath(context); diff --git a/AppKit/CPTableView.j b/AppKit/CPTableView.j index 85bae61ba..8ea492abb 100644 --- a/AppKit/CPTableView.j +++ b/AppKit/CPTableView.j @@ -2100,26 +2100,26 @@ NOT YET IMPLEMENTED found = NO, max_rec = 100; - while (max_rec--) + while (max_rec--) + { + if (!cellView || cellView === contentView) { - if (!cellView || cellView === contentView) + found = NO; + break; + } + else + { + var superview = [cellView superview]; + + if ([superview isKindOfClass:[CPTableView class]]) { - found = NO; + found = YES; break; } - else - { - var superview = [cellView superview]; - if ([superview isKindOfClass:[CPTableView class]]) - { - found = YES; - break; - } - - cellView = superview; - } + cellView = superview; } + } if (found) { @@ -5091,7 +5091,7 @@ Your delegate can implement this method to avoid subclassing the tableview to ad _editingColumn = column; _editingRow = row; - [aView addObserver:self forKeyPath:@"objectValue" options:CPKeyValueObservingOptionOld|CPKeyValueObservingOptionNew context:"editing"]; + [aView addObserver:self forKeyPath:@"objectValue" options:CPKeyValueObservingOptionOld | CPKeyValueObservingOptionNew context:"editing"]; } return aView; diff --git a/AppKit/CPTextField.j b/AppKit/CPTextField.j index daa206411..ef68cfe5e 100644 --- a/AppKit/CPTextField.j +++ b/AppKit/CPTextField.j @@ -2002,7 +2002,7 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder"); { previousContentViewBoundsOrigin = CGPointMakeCopy([[scrollView contentView] boundsOrigin]); - if(![[self superview] scrollRectToVisible:[self frame]]) + if (![[self superview] scrollRectToVisible:[self frame]]) previousContentViewBoundsOrigin = nil; } @@ -2139,7 +2139,8 @@ var CPTextFieldIsEditableKey = "CPTextFieldIsEditableKey", newValue = [self valueForBinding:aBinding], value = [destination valueForKeyPath:keyPath]; - if (CPIsControllerMarker(value) && newValue === nil) return; + if (CPIsControllerMarker(value) && newValue === nil) + return; newValue = [self reverseTransformValue:newValue withOptions:options]; diff --git a/AppKit/CPWindow/CPWindow.j b/AppKit/CPWindow/CPWindow.j index 37e15e33a..f34e923a5 100644 --- a/AppKit/CPWindow/CPWindow.j +++ b/AppKit/CPWindow/CPWindow.j @@ -63,7 +63,7 @@ @optional - (BOOL)windowShouldClose:(CPWindow)aWindow; -- (CPSize)windowWillResize:(CPWindow)sender toSize:(CPSize)aSize; +- (CGSize)windowWillResize:(CPWindow)sender toSize:(CGSize)aSize; - (CPUndoManager)windowWillReturnUndoManager:(CPWindow)window; - (void)windowDidBecomeKey:(CPNotification)aNotification; - (void)windowDidBecomeMain:(CPNotification)aNotification; @@ -80,7 +80,7 @@ @end -var CPWindowDelegate_windowShouldClose_ = 1 << 1 +var CPWindowDelegate_windowShouldClose_ = 1 << 1, CPWindowDelegate_windowWillReturnUndoManager_ = 1 << 2, CPWindowDelegate_windowWillClose_ = 1 << 3, CPWindowDelegate_windowWillResize_toSize_ = 1 << 4; @@ -2780,7 +2780,7 @@ CPTexturedBackgroundWindowMask [[CPNotificationCenter defaultCenter] removeObserver:self name:CPWindowDidEndSheetNotification object:self]; var sheet = _sheetContext[@"nextSheet"], - modalDelegate =_sheetContext[@"nextModalDelegate"], + modalDelegate = _sheetContext[@"nextModalDelegate"], endSelector = _sheetContext[@"nextEndSelector"], contextInfo = _sheetContext[@"nextContextInfo"]; @@ -3521,7 +3521,7 @@ var keyViewComparator = function(lhs, rhs, context) @ignore Call the delegate windowWillResize:toSize: */ -- (CPSize)_sendDelegateWindowWillResizeToSize:(CPSize)aSize +- (CGSize)_sendDelegateWindowWillResizeToSize:(CGSize)aSize { if (!(_implementedDelegateMethods & CPWindowDelegate_windowWillResize_toSize_)) return aSize; diff --git a/Foundation/CPArray/_CPJavaScriptArray.j b/Foundation/CPArray/_CPJavaScriptArray.j index 5589e75b0..0246790dd 100644 --- a/Foundation/CPArray/_CPJavaScriptArray.j +++ b/Foundation/CPArray/_CPJavaScriptArray.j @@ -196,7 +196,8 @@ var concat = Array.prototype.concat, } else - for (; index < count; ++index) { + for (; index < count; ++index) + { var receiver = self[index]; receiver == nil ? nil : receiver.isa.objj_msgSend0(receiver, aSelector); } diff --git a/Foundation/CPDecimalNumber.j b/Foundation/CPDecimalNumber.j index cc97c2177..f6d88a1fa 100644 --- a/Foundation/CPDecimalNumber.j +++ b/Foundation/CPDecimalNumber.j @@ -26,9 +26,8 @@ @import "CPString.j" // The default global behavior class, created lazily -var CPDefaultDcmHandler = nil; - -var CPDecimalNumberUIDs = new CFMutableDictionary(); +var CPDefaultDcmHandler = nil, + CPDecimalNumberUIDs = new CFMutableDictionary(); /*! @class CPDecimalNumberHandler diff --git a/Foundation/CPTimeZone.j b/Foundation/CPTimeZone.j index 4b4ba6c1b..d5e652234 100644 --- a/Foundation/CPTimeZone.j +++ b/Foundation/CPTimeZone.j @@ -266,7 +266,7 @@ var abbreviationDictionary, @"MST" : [@"Mountain Standard Time", @"MST", @"Mountain Daylight Time", @"MDT", @"Mountain Time", @"MT"], @"PHT" : [@"Philippine Standard Time", @"GMT+08:00", @"Philippine Summer Time", @"GMT+08:00", @"Philippine Standard Time", @"Philippines Time"], @"WET" : [@"Western European Standard Time", @"GMT", @"Western European Summer Time", @"GMT+01:00", @"Western European Time", @"Portugal Time (Lisbon)"] - }; + }; var date = [CPDate date], abbreviation = String(String(date).split("(")[1]).split(")")[0];