diff options
author | Bibiko <bibiko@eva.mpg.de> | 2010-01-04 15:17:48 +0000 |
---|---|---|
committer | Bibiko <bibiko@eva.mpg.de> | 2010-01-04 15:17:48 +0000 |
commit | 1ff1b7dd89dfbea772964f347dd43755b5d7d738 (patch) | |
tree | dafd7bf91368077fe07ff49f259b03c386260e15 /Source/TableSource.m | |
parent | 313c5bc247548319dc1f93c9ece04ea4326d37e8 (diff) | |
download | sequelpro-1ff1b7dd89dfbea772964f347dd43755b5d7d738.tar.gz sequelpro-1ff1b7dd89dfbea772964f347dd43755b5d7d738.tar.bz2 sequelpro-1ff1b7dd89dfbea772964f347dd43755b5d7d738.zip |
• replaced the (10.4) deprecated [NSTableView tableView:writeRows:toPasteboard:] method by [NSTableView tableView:writeRowsWithIndexes:toPasteboard:]
• some code cosmetics
Diffstat (limited to 'Source/TableSource.m')
-rw-r--r-- | Source/TableSource.m | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/Source/TableSource.m b/Source/TableSource.m index bf431326..9d1c6814 100644 --- a/Source/TableSource.m +++ b/Source/TableSource.m @@ -1082,29 +1082,23 @@ returns a dictionary containing enum/set field names as key and possible values /* Begin a drag and drop operation from the table - copy a single dragged row to the drag pasteboard. */ -- (BOOL)tableView:(NSTableView *)tableView writeRows:(NSArray*)rows toPasteboard:(NSPasteboard*)pboard +- (BOOL)tableView:(NSTableView *)aTableView writeRowsWithIndexes:(NSIndexSet *)rows toPasteboard:(NSPasteboard*)pboard { - //make sure that the drag operation is started from the right table view - if (tableView!=tableSourceView) return NO; - - - int originalRow; - NSArray *pboardTypes; + + //make sure that the drag operation is started from the right table view + if (aTableView != tableSourceView) return NO; // Check whether a save of the current field row is required. if ( ![self saveRowOnDeselect] ) return NO; - if ( ([rows count] == 1) && (tableView == tableSourceView) ) { - pboardTypes=[NSArray arrayWithObjects:@"SequelProPasteboard", nil]; - originalRow = [[rows objectAtIndex:0] intValue]; - - [pboard declareTypes:pboardTypes owner:nil]; - [pboard setString:[[NSNumber numberWithInt:originalRow] stringValue] forType:@"SequelProPasteboard"]; - + if ([rows count] == 1) { + [pboard declareTypes:[NSArray arrayWithObject:@"SequelProPasteboard"] owner:nil]; + [pboard setString:[[NSNumber numberWithInt:[rows firstIndex]] stringValue] forType:@"SequelProPasteboard"]; return YES; } else { return NO; } + } /* |