comctl32/listview: Initialize subitem text buffer before drawing each subitem.

Notification handler for LVN_GETDISPINFO is not guaranteed to touch text buffer.
When it doesn't, it can lead to already queried text to be reused for subitems.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52583
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
(cherry picked from commit 4f1853c576)
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
This commit is contained in:
Nikolay Sivov 2022-02-23 13:48:23 +03:00 committed by Michael Stefaniuc
parent c7ae2d5d22
commit 9002eae344
1 changed files with 1 additions and 0 deletions

View File

@ -4798,6 +4798,7 @@ static BOOL LISTVIEW_DrawItem(LISTVIEW_INFO *infoPtr, HDC hdc, INT nItem, ITERAT
lvItem.lParam = 0;
lvItem.cchTextMax = DISP_TEXT_SIZE;
lvItem.pszText = szDispText;
szDispText[0] = 0;
if (!LISTVIEW_GetItemW(infoPtr, &lvItem)) return FALSE;
if (infoPtr->dwLvExStyle & LVS_EX_FULLROWSELECT)
lvItem.state = LISTVIEW_GetItemState(infoPtr, nItem, LVIS_SELECTED);