treeview2.c

Aric Stewart aric at codeweavers.com
Thu Jan 31 15:40:04 CST 2002


Why where we setting the items text to NULL on GetItemW.

This appears to implement what the person was trying to do within the if
0 block.

Changelog: fix to GetItemW to stop whipping out the items text

-aric
-------------- next part --------------
Index: dlls/comctl32/treeview.c
===================================================================
RCS file: /home/wine/wine/dlls/comctl32/treeview.c,v
retrieving revision 1.95
diff -u -u -r1.95 treeview.c
--- dlls/comctl32/treeview.c	2001/12/11 00:15:11	1.95
+++ dlls/comctl32/treeview.c	2002/01/31 19:38:37
@@ -1970,18 +1970,19 @@
     if (tvItem->mask & TVIF_STATE) {
         tvItem->state = wineItem->state & tvItem->stateMask;
     }
-#if 0
+
     if (tvItem->mask & TVIF_TEXT) {
-        if (wineItem->pszText == LPSTR_TEXTCALLBACKW) {
-            tvItem->pszText = LPSTR_TEXTCALLBACKW;  /* FIXME:send notification? */
-            ERR(" GetItem called with LPSTR_TEXTCALLBACK\n");
+        if (wineItem->pszText == LPSTR_TEXTCALLBACKA) {
+            tvItem->pszText = LPSTR_TEXTCALLBACKW; 
+            FIXME(" GetItem called with LPSTR_TEXTCALLBACK\n");
         }
         else if (wineItem->pszText) {
-            lstrcpynAtoW(tvItem->pszText, wineItem->pszText, tvItem->cchTextMax);
+            MultiByteToWideChar(CP_ACP, 0, wineItem->pszText,
+                                strlen(wineItem->pszText), tvItem->pszText, 
+                                tvItem->cchTextMax);
         }
     }
-#endif
-    wineItem->pszText = NULL;
+
     TRACE("item %d<%p>, txt %p, img %p, action %x\n",
         iItem, tvItem, tvItem->pszText, &tvItem->iImage, tvItem->mask);
     return TRUE;


More information about the wine-patches mailing list