comctl32 header: Free the old string also when the new one is LPSTR_TEXTCALLBACK.

This commit is contained in:
Mikołaj Zalewski 2006-05-13 21:16:41 +02:00 committed by Alexandre Julliard
parent 16fefcd6d9
commit 25d66de358
1 changed files with 8 additions and 9 deletions

View File

@ -131,9 +131,6 @@ static void HEADER_StoreHDItemInHeader(HEADER_ITEM *lpItem, HDITEMW *phdi, BOOL
if (phdi->mask & HDI_TEXT)
{
if (phdi->pszText != LPSTR_TEXTCALLBACKW) /* covers != TEXTCALLBACKA too */
{
LPWSTR pszText;
if (lpItem->pszText)
{
if (lpItem->pszText != emptyString && lpItem->pszText != LPSTR_TEXTCALLBACKW)
@ -141,7 +138,9 @@ static void HEADER_StoreHDItemInHeader(HEADER_ITEM *lpItem, HDITEMW *phdi, BOOL
lpItem->pszText = NULL;
}
pszText = (phdi->pszText != NULL ? phdi->pszText : emptyString);
if (phdi->pszText != LPSTR_TEXTCALLBACKW) /* covers != TEXTCALLBACKA too */
{
LPWSTR pszText = (phdi->pszText != NULL ? phdi->pszText : emptyString);
if (fUnicode)
Str_SetPtrW(&lpItem->pszText, pszText);
else