From 1ff1b7dd89dfbea772964f347dd43755b5d7d738 Mon Sep 17 00:00:00 2001 From: Bibiko Date: Mon, 4 Jan 2010 15:17:48 +0000 Subject: =?UTF-8?q?=E2=80=A2=20replaced=20the=20(10.4)=20deprecated=20[NST?= =?UTF-8?q?ableView=20tableView:writeRows:toPasteboard:]=20method=20by=20[?= =?UTF-8?q?NSTableView=20tableView:writeRowsWithIndexes:toPasteboard:]=20?= =?UTF-8?q?=E2=80=A2=C2=A0some=20code=20cosmetics?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Source/TableSource.m | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) (limited to 'Source/TableSource.m') 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; } + } /* -- cgit v1.2.3