Index: REditor.m =================================================================== --- REditor.m (revision 612) +++ REditor.m (working copy) @@ -121,22 +121,19 @@ objectValueForTableColumn: (NSTableColumn *)tableColumn row: (int)row { - int i; - + int i = [[tableColumn identifier] intValue]; + if(i > xmaxused) + return @""; - for(i= 1;i<=xmaxused;i++) - if([[tableColumn identifier] isEqualToString:[NSString stringWithFormat:@"%d",i]]) { - SEXP tmp = VECTOR_ELT(work, i-1); - char buf[1025]; - buf[0] = '\0'; - if (!isNull(tmp)) { - if(LENGTH(tmp)>row){ - printelt(tmp, row, buf); - return [NSString stringWithCString:buf]; - } else return @""; - } else return @""; - } - return @""; + SEXP tmp = VECTOR_ELT(work, i-1); + char buf[1025]; + buf[0] = '\0'; + if (!isNull(tmp)) { + if(LENGTH(tmp)>row){ + printelt(tmp, row, buf); + return [NSString stringWithCString:buf]; + } else return @""; + } else return @""; } @@ -152,10 +149,9 @@ buf[0] = '\0'; - for(col=1;col<=xmaxused;col++) - if([[tableColumn identifier] isEqualToString:[NSString stringWithFormat:@"%d",col]]) - break; + col = [[tableColumn identifier] intValue]; + tmp = VECTOR_ELT(work, col-1); CFStringGetCString((CFStringRef)anObject, buf, 255, kCFStringEncodingMacRoman); @@ -201,7 +197,7 @@ for (i = 1; i <= xmaxused ; i++) { NSTableColumn *col; - col = [[[NSTableColumn alloc] initWithIdentifier:[NSString stringWithFormat:@"%d",i]] autorelease]; + col = [[[NSTableColumn alloc] initWithIdentifier:[NSNumber numberWithInt:i]] autorelease]; [[col headerCell] setTitle:[NSString stringWithCString:get_col_name(i)]]; [col setWidth: 50]; [col setMaxWidth: 300]; @@ -555,11 +551,7 @@ newvar = 0; [[REditor getDEController] setDatas:YES]; [[[REditor getDEController] window] orderFront:self]; - NSModalSession session = [NSApp beginModalSessionForWindow:[[REditor getDEController] window]]; - while(IsDataEntry) - [NSApp runModalSession:session]; - - [NSApp endModalSession:session]; + [NSApp runModalForWindow:[[REditor getDEController] window]]; [pool release]; }