- fixed crash when adding items with TVI_SORT and wineItem->pszText is
set to LPSTR_TEXTCALLBACK.
- ditto for TREEVIEW_DeleteItem, TREEVIEW_CreateDragImage.
diff --git a/dlls/comctl32/treeview.c b/dlls/comctl32/treeview.c
index 8fc9f0b..d43c49c 100644
--- a/dlls/comctl32/treeview.c
+++ b/dlls/comctl32/treeview.c
@@ -1752,10 +1752,22 @@
else
aChild = &infoPtr->items[(INT)infoPtr->TopRootItem];
+ /* lookup the text if using LPSTR_TEXTCALLBACKs */
+ if (wineItem->pszText==LPSTR_TEXTCALLBACKA) {
+ TREEVIEW_SendDispInfoNotify (hwnd, wineItem, TVN_GETDISPINFO, TVIF_TEXT);
+ }
+
/* Iterate the parent children to see where we fit in */
while ( aChild != NULL )
{
- INT comp = strcmp(wineItem->pszText, aChild->pszText);
+ INT comp;
+
+ /* lookup the text if using LPSTR_TEXTCALLBACKs */
+ if (aChild->pszText==LPSTR_TEXTCALLBACKA) {
+ TREEVIEW_SendDispInfoNotify (hwnd, aChild, TVN_GETDISPINFO, TVIF_TEXT);
+ }
+
+ comp = strcmp(wineItem->pszText, aChild->pszText);
if ( comp < 0 ) /* we are smaller than the current one */
{
TREEVIEW_InsertBefore(infoPtr, wineItem, aChild, parentItem);
@@ -1941,7 +1953,11 @@
iItem= (INT) lParam;
wineItem = TREEVIEW_ValidItem (infoPtr, (HTREEITEM)iItem);
if (!wineItem) return FALSE;
- TRACE("%s\n",wineItem->pszText);
+
+ if (wineItem->pszText==LPSTR_TEXTCALLBACKA)
+ TRACE("LPSTR_TEXTCALLBACK\n");
+ else
+ TRACE("%s\n",wineItem->pszText);
TREEVIEW_RemoveItem (hwnd, wineItem);
}
@@ -3041,6 +3057,10 @@
dragItem=TREEVIEW_ValidItem (infoPtr, (HTREEITEM) lParam);
if (!dragItem) return 0;
+
+ if (dragItem->pszText==LPSTR_TEXTCALLBACKA) {
+ TREEVIEW_SendDispInfoNotify (hwnd, dragItem, TVN_GETDISPINFO, TVIF_TEXT);
+ }
itemtxt=dragItem->pszText;
hwtop=GetDesktopWindow ();