Listview: Fix notify_dispinfoT for Unicode Parent

Robert Shearman rob at codeweavers.com
Sat Oct 30 08:16:09 CDT 2004


Changelog:
Fix notify_dispinfoT for Unicode parent.
-------------- next part --------------
Index: wine/dlls/comctl32/listview.c
===================================================================
RCS file: /home/wine/wine/dlls/comctl32/listview.c,v
retrieving revision 1.394
diff -u -p -r1.394 listview.c
--- wine/dlls/comctl32/listview.c	2 Sep 2004 23:00:53 -0000	1.394
+++ wine/dlls/comctl32/listview.c	30 Oct 2004 13:09:52 -0000
@@ -818,10 +818,6 @@ static int get_ansi_notification(INT uni
 }
 
 /*
-  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.
-
   infoPtr : listview struct
   notificationCode : *Unicode* notification code
   pdi : dispinfo structure (can be unicode or ansi)
@@ -834,8 +830,12 @@ static BOOL notify_dispinfoT(LISTVIEW_IN
     INT cchTempBufMax = 0, savCchTextMax = 0;
     LPWSTR pszTempBuf = NULL, savPszText = NULL;
 
-    if ((pdi->item.mask & LVIF_TEXT) && is_textT(pdi->item.pszText, isW))
-	    convertToAnsi = isW;
+    /* 
+       only need to convert to string from Unicode to Ansi if we expect a
+       valid pointer
+     */
+    if ((infoPtr->notifyFormat == NFR_ANSI) && (pdi->item.mask & LVIF_TEXT) && is_textT(pdi->item.pszText, FALSE))
+        convertToAnsi = TRUE;
 
     if (convertToAnsi)
     {
@@ -863,11 +863,13 @@ static BOOL notify_dispinfoT(LISTVIEW_IN
         pdi->item.cchTextMax = cchTempBufMax;
     }
 
+    if (infoPtr->notifyFormat == NFR_ANSI)
+        notificationCode = get_ansi_notification(notificationCode);
+
     TRACE(" pdi->item=%s\n", debuglvitem_t(&pdi->item, infoPtr->notifyFormat !=
            NFR_ANSI));
 
-    bResult = notify_hdr(infoPtr, get_ansi_notification(notificationCode),
-                        (LPNMHDR)pdi);
+    bResult = notify_hdr(infoPtr, notificationCode, &pdi->hdr);
 
     if (convertToAnsi)
     {


More information about the wine-patches mailing list