From fb01ceb2a93835ccb8a93831a0c39bfda173307b Mon Sep 17 00:00:00 2001 From: Aparajita Fishman Date: Thu, 21 Feb 2013 07:39:57 -0500 Subject: [PATCH] Formatting --- AppKit/CPTableView.j | 11 ++++++----- Tests/Manual/TableTest/OldTest/AppController.j | 4 ++++ 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/AppKit/CPTableView.j b/AppKit/CPTableView.j index 145222864..fb55411f2 100644 --- a/AppKit/CPTableView.j +++ b/AppKit/CPTableView.j @@ -2350,16 +2350,17 @@ NOT YET IMPLEMENTED autosaveName = [self autosaveName], tableColumns = [userDefaults objectForKey:[self _columnsKeyForAutosaveName:autosaveName]]; - if([tableColumns count] != [[self tableColumns] count]) + if ([tableColumns count] != [[self tableColumns] count]) return; - + for (var i = 0; i < [tableColumns count]; i++) { var metaData = [tableColumns objectAtIndex:i], columnIdentifier = [metaData objectForKey:@"identifier"], column = [self columnWithIdentifier:columnIdentifier], tableColumn = [self tableColumnWithIdentifier:columnIdentifier]; - if(tableColumn && column != CPNotFound) + + if (tableColumn && column != CPNotFound) { [self _moveColumn:column toColumn:i]; [tableColumn setWidth:[metaData objectForKey:@"width"]]; @@ -2887,7 +2888,7 @@ Your delegate can implement this method to avoid subclassing the tableview to ad [self _setObjectValueForTableColumn:tableColumn row:row forView:dataView]; [view addSubview:dataView]; [_draggingViews addObject:dataView]; - + row = [theDraggedRows indexGreaterThanIndex:row]; } } @@ -4551,7 +4552,7 @@ Your delegate can implement this method to avoid subclassing the tableview to ad { [self _enqueueReusableDataView:dataView]; }]; - + [_draggingViews removeAllObjects]; } diff --git a/Tests/Manual/TableTest/OldTest/AppController.j b/Tests/Manual/TableTest/OldTest/AppController.j index 16bd92616..1ca284229 100644 --- a/Tests/Manual/TableTest/OldTest/AppController.j +++ b/Tests/Manual/TableTest/OldTest/AppController.j @@ -54,6 +54,7 @@ tableTestDragType = @"CPTableViewTestDragType"; var iconView = [[CPImageView alloc] initWithFrame:CGRectMake(16, 16, 0, 0)]; [iconView setImageScaling:CPImageScaleNone]; + var iconColumn = [[CPTableColumn alloc] initWithIdentifier:"icons"]; [iconColumn setWidth:32.0]; [iconColumn setMinWidth:32.0]; @@ -63,6 +64,7 @@ tableTestDragType = @"CPTableViewTestDragType"; var desc = [CPSortDescriptor sortDescriptorWithKey:@"self" ascending:YES]; + for (var i = 1; i <= 5; i++) { var column = [[CPTableColumn alloc] initWithIdentifier:String(i)]; @@ -79,6 +81,7 @@ tableTestDragType = @"CPTableViewTestDragType"; if (i === 2) randomColumn = column; } + [tableView setAutosaveTableColumns:YES]; [tableView setAutosaveName:@"TableTest"]; @@ -201,6 +204,7 @@ tableTestDragType = @"CPTableViewTestDragType"; [tableView2 addTableColumn:checkBoxColumn]; var desc = [CPSortDescriptor sortDescriptorWithKey:@"self" ascending:YES]; + for (var i = 1; i <= 3; i++) { var column = [[CPTableColumn alloc] initWithIdentifier:String(i)];