aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2010-09-27 21:25:14 +0000
committerrowanbeentje <rowan@beent.je>2010-09-27 21:25:14 +0000
commitd08ee0d47eb4873edbdd2408145179b169fccffe (patch)
treea818d2b0aad9b5095fe478d3832a33b499e13268
parent4a132c2c7a1f65893b23fa3684727f475c867754 (diff)
downloadsequelpro-d08ee0d47eb4873edbdd2408145179b169fccffe.tar.gz
sequelpro-d08ee0d47eb4873edbdd2408145179b169fccffe.tar.bz2
sequelpro-d08ee0d47eb4873edbdd2408145179b169fccffe.zip
- Fix missing tableContentView references, which are required following the content filter changes. This addresses http://spbug.com/l/1648 .
- Clean up code a little
-rw-r--r--Source/SPTableContent.m44
1 files changed, 18 insertions, 26 deletions
diff --git a/Source/SPTableContent.m b/Source/SPTableContent.m
index 295dca4b..153718f8 100644
--- a/Source/SPTableContent.m
+++ b/Source/SPTableContent.m
@@ -1943,33 +1943,29 @@
- (NSArray *)currentDataResult
{
NSArray *tableColumns;
- NSEnumerator *enumerator;
- id tableColumn;
NSMutableArray *currentResult = [NSMutableArray array];
NSMutableArray *tempRow = [NSMutableArray array];
NSUInteger i;
- //load table if not already done
+ // Load table if not already done
if ( ![tablesListInstance contentLoaded] ) {
[self loadTable:[tablesListInstance tableName]];
}
tableColumns = [tableContentView tableColumns];
- enumerator = [tableColumns objectEnumerator];
- //set field names as first line
- while ( (tableColumn = [enumerator nextObject]) ) {
- [tempRow addObject:[[tableColumn headerCell] stringValue]];
+ // Set field names as first line
+ for (NSTableColumn *aTableColumn in tableColumns) {
+ [tempRow addObject:[[aTableColumn headerCell] stringValue]];
}
[currentResult addObject:[NSArray arrayWithArray:tempRow]];
- //add rows
- for ( i = 0 ; i < [self numberOfRowsInTableView:nil] ; i++) {
+ // Add rows
+ for ( i = 0 ; i < [self numberOfRowsInTableView:tableContentView] ; i++) {
[tempRow removeAllObjects];
- enumerator = [tableColumns objectEnumerator];
- while ( (tableColumn = [enumerator nextObject]) ) {
- id o = SPDataStorageObjectAtRowAndColumn(tableValues, i, [[tableColumn identifier] integerValue]);
- if([o isNSNull])
+ for (NSTableColumn *aTableColumn in tableColumns) {
+ id o = SPDataStorageObjectAtRowAndColumn(tableValues, i, [[aTableColumn identifier] integerValue]);
+ if ([o isNSNull])
[tempRow addObject:@"NULL"];
else if ([o isSPNotLoaded])
[tempRow addObject:NSLocalizedString(@"(not loaded)", @"value shown for hidden blob and text fields")];
@@ -1977,7 +1973,7 @@
[tempRow addObject:[o description]];
else {
NSImage *image = [[NSImage alloc] initWithData:o];
- if(image) {
+ if (image) {
NSInteger imageWidth = [image size].width;
if (imageWidth > 100) imageWidth = 100;
[tempRow addObject:[NSString stringWithFormat:
@@ -2002,32 +1998,28 @@
- (NSArray *)currentResult
{
NSArray *tableColumns;
- NSEnumerator *enumerator;
- id tableColumn;
NSMutableArray *currentResult = [NSMutableArray array];
NSMutableArray *tempRow = [NSMutableArray array];
NSUInteger i;
- //load table if not already done
+ // Load the table if not already loaded
if ( ![tablesListInstance contentLoaded] ) {
[self loadTable:[tablesListInstance tableName]];
}
tableColumns = [tableContentView tableColumns];
- enumerator = [tableColumns objectEnumerator];
- //set field names as first line
- while ( (tableColumn = [enumerator nextObject]) ) {
- [tempRow addObject:[[tableColumn headerCell] stringValue]];
+ // Add the field names as the first line
+ for (NSTableColumn *aTableColumn in tableColumns) {
+ [tempRow addObject:[[aTableColumn headerCell] stringValue]];
}
[currentResult addObject:[NSArray arrayWithArray:tempRow]];
- //add rows
- for ( i = 0 ; i < [self numberOfRowsInTableView:nil] ; i++) {
+ // Add the rows
+ for ( i = 0 ; i < [self numberOfRowsInTableView:tableContentView] ; i++) {
[tempRow removeAllObjects];
- enumerator = [tableColumns objectEnumerator];
- while ( (tableColumn = [enumerator nextObject]) ) {
- [tempRow addObject:[self tableView:nil objectValueForTableColumn:tableColumn row:i]];
+ for (NSTableColumn *aTableColumn in tableColumns) {
+ [tempRow addObject:[self tableView:tableContentView objectValueForTableColumn:aTableColumn row:i]];
}
[currentResult addObject:[NSArray arrayWithArray:tempRow]];
}