comctl32: Fix callback in treeview.

This commit is contained in:
André Hentschel 2009-01-20 20:34:48 +01:00 committed by Alexandre Julliard
parent 9b0be4980a
commit 2ef02afe95
2 changed files with 3 additions and 3 deletions

View File

@ -311,7 +311,7 @@ static void TestCallback(void)
ok(ret == 1, "Expected SetItem return 1, got %ld\n", ret);
tvi.pszText = buf;
TreeView_GetItem(hTree, &tvi);
todo_wine ok(strcmp(tvi.pszText, TEST_CALLBACK_TEXT) == 0, "Item text mismatch %s vs %s\n",
ok(strcmp(tvi.pszText, TEST_CALLBACK_TEXT) == 0, "Item text mismatch %s vs %s\n",
tvi.pszText, TEST_CALLBACK_TEXT);
U(ins).item.pszText = NULL;
@ -320,7 +320,7 @@ static void TestCallback(void)
tvi.hItem = hItem2;
memset(buf, 0, sizeof(buf));
TreeView_GetItem(hTree, &tvi);
todo_wine ok(strcmp(tvi.pszText, TEST_CALLBACK_TEXT) == 0, "Item text mismatch %s vs %s\n",
ok(strcmp(tvi.pszText, TEST_CALLBACK_TEXT) == 0, "Item text mismatch %s vs %s\n",
tvi.pszText, TEST_CALLBACK_TEXT);
}

View File

@ -1112,7 +1112,7 @@ TREEVIEW_DoSetItemT(const TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem,
if (tvItem->mask & TVIF_TEXT)
{
wineItem->textWidth = 0; /* force width recalculation */
if (tvItem->pszText != LPSTR_TEXTCALLBACKW) /* covers != TEXTCALLBACKA too */
if (tvItem->pszText != LPSTR_TEXTCALLBACKW && tvItem->pszText != NULL) /* covers != TEXTCALLBACKA too, and undocumented: pszText of NULL also means TEXTCALLBACK */
{
int len;
LPWSTR newText;