diff 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
line wrap: on
line diff
--- a/mac/dw.m	Sun Nov 06 11:48:24 2011 +0000
+++ b/mac/dw.m	Sun Nov 06 12:13:13 2011 +0000
@@ -6261,12 +6261,13 @@
     DWContainer *cont = handle;
     char *thistext;
     int x, count = (int)[cont numberOfRowsInTableView:cont];
+    int textcomp = DW_POINTER_TO_INT(dw_window_get_data(handle, "_dw_textcomp"));
 
     for(x=0;x<count;x++)
     {
         thistext = [cont getRowTitle:x];
 
-        if(thistext == text)
+        if((textcomp && thistext && strcmp(thistext, text) == 0) || (!textcomp && thistext == text))
         {
             NSIndexSet *selected = [[NSIndexSet alloc] initWithIndex:(NSUInteger)x];
 
@@ -6290,12 +6291,13 @@
     DWContainer *cont = handle;
     char *thistext;
     int x, count = (int)[cont numberOfRowsInTableView:cont];
+    int textcomp = DW_POINTER_TO_INT(dw_window_get_data(handle, "_dw_textcomp"));
 
     for(x=0;x<count;x++)
     {
         thistext = [cont getRowTitle:x];
 
-        if(thistext == text)
+        if((textcomp && thistext && strcmp(thistext, text) == 0) || (!textcomp && thistext == text))
         {
             [cont removeRow:x];
             return;