@@ -437,7 +437,7 @@ - (BOOL)_focusOnFieldInSubtree:(NSDictionary *)dict
437437 return NO ;
438438}
439439
440- - (void )updateFiltersFrom : (SPTableContent *)tableContent
440+ - (void )setColumns : ( NSArray *)dataColumns ;
441441{
442442 [self willChangeValueForKey: @" model" ]; // manual KVO is needed for filter rule editor to notice change
443443 [model removeAllObjects ];
@@ -446,22 +446,22 @@ - (void)updateFiltersFrom:(SPTableContent *)tableContent
446446 [columns removeAllObjects ];
447447
448448 // without a table there is nothing to filter
449- if (![tableContent selectedTable ]) return ;
450-
451- // sort column names if enabled
452- NSArray *columnDefinitions = [tableContent dataColumnDefinitions ];
453- if ([[NSUserDefaults standardUserDefaults ] boolForKey: SPAlphabeticalTableSorting]) {
454- NSSortDescriptor *sortDescriptor = [NSSortDescriptor sortDescriptorWithKey: @" name" ascending: YES ];
455- columnDefinitions = [columnDefinitions sortedArrayUsingDescriptors: @[sortDescriptor]];
456- }
449+ if (dataColumns) {
450+ // sort column names if enabled
451+ NSArray *columnDefinitions = dataColumns;
452+ if ([[NSUserDefaults standardUserDefaults ] boolForKey: SPAlphabeticalTableSorting]) {
453+ NSSortDescriptor *sortDescriptor = [NSSortDescriptor sortDescriptorWithKey: @" name" ascending: YES ];
454+ columnDefinitions = [columnDefinitions sortedArrayUsingDescriptors: @[sortDescriptor]];
455+ }
457456
458- // get the columns
459- for (NSDictionary *colDef in columnDefinitions) {
460- ColumnNode *node = [[ColumnNode alloc ] init ];
461- [node setName: [colDef objectForKey: @" name" ]];
462- [node setTypegrouping: [colDef objectForKey: @" typegrouping" ]];
463- [columns addObject: node];
464- [node release ];
457+ // get the columns
458+ for (NSDictionary *colDef in columnDefinitions) {
459+ ColumnNode *node = [[ColumnNode alloc ] init ];
460+ [node setName: [colDef objectForKey: @" name" ]];
461+ [node setTypegrouping: [colDef objectForKey: @" typegrouping" ]];
462+ [columns addObject: node];
463+ [node release ];
464+ }
465465 }
466466
467467 // make the rule editor reload the criteria
0 commit comments