comparison mac/dw.m @ 1322:3f1ac800bf65

Initial fix for being able to do container string comparisons instead of pointer on all platforms. Improved on the GTK2 change earlier... where it would do both comparisons with string enabled.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Sun, 06 Nov 2011 12:13:13 +0000
parents ebd67be26f43
children 5e2ec37d1680
comparison
equal deleted inserted replaced
1321:7630404386be 1322:3f1ac800bf65
6259 int _locked_by_me = FALSE; 6259 int _locked_by_me = FALSE;
6260 DW_MUTEX_LOCK; 6260 DW_MUTEX_LOCK;
6261 DWContainer *cont = handle; 6261 DWContainer *cont = handle;
6262 char *thistext; 6262 char *thistext;
6263 int x, count = (int)[cont numberOfRowsInTableView:cont]; 6263 int x, count = (int)[cont numberOfRowsInTableView:cont];
6264 int textcomp = DW_POINTER_TO_INT(dw_window_get_data(handle, "_dw_textcomp"));
6264 6265
6265 for(x=0;x<count;x++) 6266 for(x=0;x<count;x++)
6266 { 6267 {
6267 thistext = [cont getRowTitle:x]; 6268 thistext = [cont getRowTitle:x];
6268 6269
6269 if(thistext == text) 6270 if((textcomp && thistext && strcmp(thistext, text) == 0) || (!textcomp && thistext == text))
6270 { 6271 {
6271 NSIndexSet *selected = [[NSIndexSet alloc] initWithIndex:(NSUInteger)x]; 6272 NSIndexSet *selected = [[NSIndexSet alloc] initWithIndex:(NSUInteger)x];
6272 6273
6273 [cont selectRowIndexes:selected byExtendingSelection:YES]; 6274 [cont selectRowIndexes:selected byExtendingSelection:YES];
6274 [selected release]; 6275 [selected release];
6288 int _locked_by_me = FALSE; 6289 int _locked_by_me = FALSE;
6289 DW_MUTEX_LOCK; 6290 DW_MUTEX_LOCK;
6290 DWContainer *cont = handle; 6291 DWContainer *cont = handle;
6291 char *thistext; 6292 char *thistext;
6292 int x, count = (int)[cont numberOfRowsInTableView:cont]; 6293 int x, count = (int)[cont numberOfRowsInTableView:cont];
6294 int textcomp = DW_POINTER_TO_INT(dw_window_get_data(handle, "_dw_textcomp"));
6293 6295
6294 for(x=0;x<count;x++) 6296 for(x=0;x<count;x++)
6295 { 6297 {
6296 thistext = [cont getRowTitle:x]; 6298 thistext = [cont getRowTitle:x];
6297 6299
6298 if(thistext == text) 6300 if((textcomp && thistext && strcmp(thistext, text) == 0) || (!textcomp && thistext == text))
6299 { 6301 {
6300 [cont removeRow:x]; 6302 [cont removeRow:x];
6301 return; 6303 return;
6302 } 6304 }
6303 } 6305 }