comctl32: Use strcmpW instead of pointer comparison to ensure treeview updates correctly
Nikolay Sivov
bunglehead at gmail.com
Sun Oct 19 10:49:28 CDT 2014
On 10/19/2014 18:44, Dan Bassi wrote:
> + /* Old text is a null pointer due to HeapAlloc() failing, therefore unable to perform strcmpW so assume text has changed */
> + if (!tiOld->pszText)
> + return TRUE;
> +
I don't think you should necessary assume it's changed.
> /* Text has changed and it's not a callback */
> - if ((tvChange->mask & TVIF_TEXT) && (tiOld->pszText != tiNew->pszText) &&
> + if ((tvChange->mask & TVIF_TEXT) && (strcmpW(tiOld->pszText, tiNew->pszText) != 0) &&
> tiNew->pszText != LPSTR_TEXTCALLBACKW)
> return TRUE;
This is wrong, you can't compare if it's a special callback value.
> + originalItem.pszText = HeapAlloc(GetProcessHeap(), 0, originalItem.cchTextMax * sizeof(WCHAR));
Normally comctl32 code uses Alloc()/Free() functions.
This patch needs tests first, those tests should cover all possible
combinations regarding callback cases, different pointers but same data,
same data but different pointers, maybe something else.
More information about the wine-devel
mailing list