ahh yup, my error.. here is the modified patch -aric
Huw D M Davies wrote:
On Thu, Jan 31, 2002 at 03:40:04PM -0600, Aric Stewart wrote:
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
Hi Aric,
This won't copy the terminating '\0'. It'd be better to use -1 instead of the strlen.
Huw.
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/02/01 12:46:44 @@ -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, + -1 , 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;