From 05affe86aafe4bfc9561e9c850187aa3844da5d1 Mon Sep 17 00:00:00 2001 From: Bibiko Date: Mon, 11 Jan 2010 22:00:46 +0000 Subject: =?UTF-8?q?=E2=80=A2=20fixed=20issue=20for=20"Copy=20as=20SQL=20IN?= =?UTF-8?q?SERT"=20after=20filtering=20-=20accessing=20table=20data=20from?= =?UTF-8?q?=20[dataSource:tableView:objectValueForTableColumn:row]=20direc?= =?UTF-8?q?tly=20-=20maybe=20related=20to=20issue=20506?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Source/CMCopyTable.m | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'Source') diff --git a/Source/CMCopyTable.m b/Source/CMCopyTable.m index 20b0e7f2..6fd83cee 100644 --- a/Source/CMCopyTable.m +++ b/Source/CMCopyTable.m @@ -180,6 +180,7 @@ NSInteger MENU_EDIT_COPY_AS_SQL = 2002; NSArray *columns = [self tableColumns]; NSUInteger numColumns = [columns count]; + id dataSource = [self dataSource]; NSIndexSet *selectedRows = [self selectedRowIndexes]; NSMutableString *value = [NSMutableString stringWithCapacity:10]; @@ -222,6 +223,7 @@ NSInteger MENU_EDIT_COPY_AS_SQL = 2002; } NSUInteger rowIndex = [selectedRows firstIndex]; + NSTableColumn *col = nil; while ( rowIndex != NSNotFound ) { @@ -230,7 +232,11 @@ NSInteger MENU_EDIT_COPY_AS_SQL = 2002; rowCounter++; for ( c = 0; c < numColumns; c++ ) { - rowData = [[tableData objectAtIndex:rowIndex] objectAtIndex:[[columnMappings objectAtIndex:c] integerValue]]; + // rowData = [[tableData objectAtIndex:rowIndex] objectAtIndex:[[columnMappings objectAtIndex:c] integerValue]]; + col = NSArrayObjectAtIndex(columns, c); + rowData = [dataSource tableView:self + objectValueForTableColumn:col + row:rowIndex ]; // Check for NULL value if([rowData isNSNull]) { -- cgit v1.2.3