comctl32/listview: Setting item text to callback stub value already having it raises item-change notifications.

Use same new text comparison rules for both items and subitems.
Based on patch by Stefan Stranz.
This commit is contained in:
Nikolay Sivov 2009-06-15 01:31:45 +04:00 committed by Alexandre Julliard
parent 47bc142dad
commit 7f936a0a6e
2 changed files with 7 additions and 8 deletions

View File

@ -507,7 +507,7 @@ static inline int textcmpWT(LPCWSTR aw, LPCWSTR bt, BOOL isW)
if (!aw) return bt ? -1 : 0;
if (!bt) return aw ? 1 : 0;
if (aw == LPSTR_TEXTCALLBACKW)
return bt == LPSTR_TEXTCALLBACKW ? 0 : -1;
return bt == LPSTR_TEXTCALLBACKW ? 1 : -1;
if (bt != LPSTR_TEXTCALLBACKW)
{
LPWSTR bw = textdupTtoW(bt, isW);
@ -3727,12 +3727,11 @@ static BOOL set_sub_item(const LISTVIEW_INFO *infoPtr, const LVITEMW *lpLVItem,
*bChanged = TRUE;
}
if (lpLVItem->mask & LVIF_TEXT)
if (lpSubItem->hdr.pszText != lpLVItem->pszText)
{
textsetptrT(&lpSubItem->hdr.pszText, lpLVItem->pszText, isW);
*bChanged = TRUE;
}
if ((lpLVItem->mask & LVIF_TEXT) && textcmpWT(lpSubItem->hdr.pszText, lpLVItem->pszText, isW))
{
textsetptrT(&lpSubItem->hdr.pszText, lpLVItem->pszText, isW);
*bChanged = TRUE;
}
return TRUE;
}

View File

@ -1118,7 +1118,7 @@ static void test_items(void)
expect(TRUE, r);
ok_sequence(sequences, PARENT_SEQ_INDEX, textcallback_set_again_parent_seq,
"check callback text comparison rule", TRUE);
"check callback text comparison rule", FALSE);
DestroyWindow(hwnd);
}