Hello,
Testing showed that the current implementation of notify_dispinfoT doesnt work with W2K. (or at least not with SP4 (: )
The attached patch corrects that our Listview doesnt display anything on native.


Following assumption proved to be wrong for the Message LVN_GETDISPINFOW:
/*
With testing on Windows 2000 it looks like the notify format
has nothing to do with this message. It ALWAYS seems to be
in ansi format. */

This time, only LVN_*ETDISPINFOW is patched, anything else is untouched.
-Anybody please tell me if you see problems with this Fix since i dont want to break things.-


Tho

Index: listview.c
===================================================================
RCS file: /home/wine/wine/dlls/comctl32/listview.c,v
retrieving revision 1.394
diff -u -r1.394 listview.c
--- listview.c	2 Sep 2004 23:00:53 -0000	1.394
+++ listview.c	27 Oct 2004 17:22:39 -0000
@@ -807,8 +807,6 @@
     {
     case LVN_BEGINLABELEDITW: return LVN_BEGINLABELEDITA;
     case LVN_ENDLABELEDITW: return LVN_ENDLABELEDITA;
-    case LVN_GETDISPINFOW: return LVN_GETDISPINFOA;
-    case LVN_SETDISPINFOW: return LVN_SETDISPINFOA;
     case LVN_ODFINDITEMW: return LVN_ODFINDITEMA;
     case LVN_GETINFOTIPW: return LVN_GETINFOTIPA;
     }
@@ -834,21 +832,20 @@
     INT cchTempBufMax = 0, savCchTextMax = 0;
     LPWSTR pszTempBuf = NULL, savPszText = NULL;
 
+    if  ((notificationCode = LVN_GETDISPINFOW)||(notificationCode = LVN_SETDISPINFOW))
+    {
+	    bResult = notify_hdr(infoPtr, notificationCode,
+                        (LPNMHDR)pdi);
+        return bResult;                
+    }
+
     if ((pdi->item.mask & LVIF_TEXT) && is_textT(pdi->item.pszText, isW))
 	    convertToAnsi = isW;
 
     if (convertToAnsi)
-    {
-	if (notificationCode != LVN_GETDISPINFOW)
-	{
-            cchTempBufMax = WideCharToMultiByte(CP_ACP, 0, pdi->item.pszText,
-                                                -1, NULL, 0, NULL, NULL);
-        }
-	else
-	{
-	    cchTempBufMax = pdi->item.cchTextMax;
-	    *pdi->item.pszText = 0; /* make sure we don't process garbage */
-	}
+    {	      
+	    cchTempBufMax = WideCharToMultiByte(CP_ACP, 0, pdi->item.pszText,
+                                                -1, NULL, 0, NULL, NULL);	
 
         pszTempBuf = HeapAlloc(GetProcessHeap(), 0, sizeof(CHAR) *
                                cchTempBufMax);
@@ -3621,7 +3618,7 @@
         if (uStateImage)
 	{
 	     TRACE("uStateImage=%d\n", uStateImage);
-	     ImageList_Draw(infoPtr->himlState, uStateImage - 1, hdc, rcState.left, rcState.top, ILD_NORMAL);
+	     ImageList_Draw(infoPtr->himlState, uStateImage - 1, hdc, rcState.left, rcState.top, ILD_TRANSPARENT);
 	}
     }
 
@@ -3631,7 +3628,7 @@
     {
 	TRACE("iImage=%d\n", lvItem.iImage);
 	ImageList_Draw(himl, lvItem.iImage, hdc, rcIcon.left, rcIcon.top,
-			(lvItem.state & LVIS_SELECTED) && (infoPtr->bFocus) ? ILD_SELECTED : ILD_NORMAL);
+			(lvItem.state & LVIS_SELECTED) && (infoPtr->bFocus) ? ILD_SELECTED|ILD_TRANSPARENT : ILD_TRANSPARENT);
     }
 
     /* Don't bother painting item being edited */

Reply via email to