# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1320581593 0 # Node ID 3f1ac800bf651e889422399883652962050a80bc # Parent 7630404386be0043b326036e9f4ed228a3162296 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. diff -r 7630404386be -r 3f1ac800bf65 gtk/dw.c --- a/gtk/dw.c Sun Nov 06 11:48:24 2011 +0000 +++ b/gtk/dw.c Sun Nov 06 12:13:13 2011 +0000 @@ -7564,7 +7564,7 @@ for(z=0;zpszIcon == text) + if((textcomp && pCore->pszIcon && strcmp(pCore->pszIcon, text) == 0) || (!textcomp && (char *)pCore->pszIcon == text)) { QUERYRECORDRECT qrr; int scrollpixels = 0, midway; @@ -8182,10 +8183,11 @@ void API dw_container_delete_row(HWND handle, char *text) { PRECORDCORE pCore = WinSendMsg(handle, CM_QUERYRECORD, (MPARAM)0L, MPFROM2SHORT(CMA_FIRST, CMA_ITEMORDER)); + int textcomp = DW_POINTER_TO_INT(dw_window_get_data(handle, "_dw_textcomp")); while(pCore) { - if((char *)pCore->pszIcon == text) + if((textcomp && pCore->pszIcon && strcmp(pCore->pszIcon, text) == 0) || (!textcomp && (char *)pCore->pszIcon == text)) { WinSendMsg(handle, CM_REMOVERECORD, (MPARAM)&pCore, MPFROM2SHORT(1, CMA_FREE | CMA_INVALIDATE)); return; diff -r 7630404386be -r 3f1ac800bf65 win/dw.c --- a/win/dw.c Sun Nov 06 11:48:24 2011 +0000 +++ b/win/dw.c Sun Nov 06 12:13:13 2011 +0000 @@ -8491,6 +8491,7 @@ void API dw_container_cursor(HWND handle, char *text) { int index = ListView_GetNextItem(handle, -1, LVNI_ALL); + int textcomp = DW_POINTER_TO_INT(dw_window_get_data(handle, "_dw_textcomp")); while ( index != -1 ) { @@ -8503,7 +8504,7 @@ ListView_GetItem( handle, &lvi ); - if ( strcmp( (char *)lvi.lParam, text ) == 0 ) + if ( (textcomp && lvi.lParam && strcmp( (char *)lvi.lParam, text ) == 0) || (!textcomp && (char *)lvi.lParam == text) ) { ListView_SetItemState( handle, index, LVIS_FOCUSED | LVIS_SELECTED, LVIS_FOCUSED | LVIS_SELECTED ); @@ -8524,6 +8525,7 @@ void API dw_container_delete_row(HWND handle, char *text) { int index = ListView_GetNextItem(handle, -1, LVNI_ALL); + int textcomp = DW_POINTER_TO_INT(dw_window_get_data(handle, "_dw_textcomp")); while(index != -1) { @@ -8536,7 +8538,7 @@ ListView_GetItem(handle, &lvi); - if ( strcmp( (char *)lvi.lParam, text ) == 0 ) + if ( (textcomp && lvi.lParam && strcmp( (char *)lvi.lParam, text ) == 0) || (!textcomp && (char *)lvi.lParam == text) ) { int _index = (int)dw_window_get_data(handle, "_dw_index");