diff options
author | Bibiko <bibiko@eva.mpg.de> | 2011-01-11 19:24:52 +0000 |
---|---|---|
committer | Bibiko <bibiko@eva.mpg.de> | 2011-01-11 19:24:52 +0000 |
commit | 7d2238af04e18999b4dc83a92d82ac1944c0916d (patch) | |
tree | c01797e8873c99cc2d6b094b9d98f32f567c846b /Source/SPCustomQuery.m | |
parent | 15100feadc549801496c6d076931ba9b765ea069 (diff) | |
download | sequelpro-7d2238af04e18999b4dc83a92d82ac1944c0916d.tar.gz sequelpro-7d2238af04e18999b4dc83a92d82ac1944c0916d.tar.bz2 sequelpro-7d2238af04e18999b4dc83a92d82ac1944c0916d.zip |
• fixed several issues for validation and other stuff while editing of MySQL data tables if user re-ordered columns
Diffstat (limited to 'Source/SPCustomQuery.m')
-rw-r--r-- | Source/SPCustomQuery.m | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Source/SPCustomQuery.m b/Source/SPCustomQuery.m index e8420b7c..fa54790d 100644 --- a/Source/SPCustomQuery.m +++ b/Source/SPCustomQuery.m @@ -1634,7 +1634,7 @@ * -2 for other errors * and the used WHERE clause to identify */ -- (NSArray*)fieldEditStatusForRow:(NSInteger)rowIndex andColumn:(NSInteger)columnIndex +- (NSArray*)fieldEditStatusForRow:(NSInteger)rowIndex andColumn:(NSNumber*)columnIndex { NSDictionary *columnDefinition = nil; @@ -3679,8 +3679,9 @@ column = [customQueryView editedColumn]; // Retrieve the column defintion + NSNumber *colIdentifier = [NSArrayObjectAtIndex([customQueryView tableColumns], column) identifier]; for(id c in cqColumnDefinition) { - if([[c objectForKey:@"datacolumnindex"] isEqualToNumber:[NSNumber numberWithInteger:column]]) { + if([[c objectForKey:@"datacolumnindex"] isEqualToNumber:colIdentifier]) { columnDefinition = [NSDictionary dictionaryWithDictionary:c]; break; } @@ -3688,8 +3689,8 @@ if(!columnDefinition) return NO; - NSArray *editStatus = [self fieldEditStatusForRow:row andColumn:[NSArrayObjectAtIndex([customQueryView tableColumns], column) identifier]]; - NSInteger numberOfPossibleUpdateRows = [[editStatus objectAtIndex:0] integerValue]; + NSArray *editStatus = [self fieldEditStatusForRow:row andColumn:colIdentifier]; + NSInteger numberOfPossibleUpdateRows = [NSArrayObjectAtIndex(editStatus, 0) integerValue]; NSPoint pos = [[tableDocumentInstance parentWindow] convertBaseToScreen:[customQueryView convertPoint:[customQueryView frameOfCellAtColumn:column row:row].origin toView:nil]]; pos.y -= 20; switch(numberOfPossibleUpdateRows) { |