From 0f9d56fde884094fd2bfa56a7ea11f0d5e1a7fb6 Mon Sep 17 00:00:00 2001 From: Niclas Karlsson MATE Date: Mon, 14 Aug 2000 17:17:57 +0000 Subject: [PATCH] LPSTR_TEXTCALLBACK wouldn't work if the application supplied the item text in its own buffer. --- dlls/comctl32/listview.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c index 2a1b6b445e6..8d0f5994406 100644 --- a/dlls/comctl32/listview.c +++ b/dlls/comctl32/listview.c @@ -4796,7 +4796,11 @@ static LRESULT LISTVIEW_GetItemA(HWND hwnd, LPLVITEMA lpLVItem, BOOL internal) { Str_SetPtrA(ppszText, dispInfo.item.pszText); } - /* Here lpLVItem->pszText==dispInfo.item.pszText so a copy is unnecessary */ + /* If lpLVItem->pszText==dispInfo.item.pszText a copy is unnecessary, but */ + /* some apps give a new pointer in ListView_Notify so we can't be sure. */ + if (lpLVItem->pszText!=dispInfo.item.pszText) { + lstrcpynA(lpLVItem->pszText, dispInfo.item.pszText, lpLVItem->cchTextMax); + } } else if (lpLVItem->mask & LVIF_TEXT) {