comctl32/listview: Fix a regression caused by 59148d0bb5.

This commit is contained in:
Nikolay Sivov 2009-04-13 18:42:57 -04:00 committed by Alexandre Julliard
parent 9c1a0e468f
commit e014484a43
2 changed files with 19 additions and 6 deletions

View File

@ -1398,6 +1398,8 @@ static INT LISTVIEW_CreateHeader(LISTVIEW_INFO *infoPtr)
/* set header font */
SendMessageW(infoPtr->hwndHeader, WM_SETFONT, (WPARAM)infoPtr->hFont, (LPARAM)TRUE);
LISTVIEW_UpdateSize(infoPtr);
return 0;
}
@ -1673,6 +1675,8 @@ static void LISTVIEW_UpdateHeaderSize(const LISTVIEW_INFO *infoPtr, INT nNewScro
TRACE("nNewScrollPos=%d\n", nNewScrollPos);
if (!infoPtr->hwndHeader) return;
GetWindowRect(infoPtr->hwndHeader, &winRect);
point[0].x = winRect.left;
point[0].y = winRect.top;
@ -8143,7 +8147,6 @@ static LRESULT LISTVIEW_Create(HWND hwnd, const CREATESTRUCTW *lpcs)
{
ShowWindow(infoPtr->hwndHeader, SW_SHOWNORMAL);
}
LISTVIEW_UpdateSize(infoPtr);
LISTVIEW_UpdateScroll(infoPtr);
}
@ -9127,7 +9130,7 @@ static LRESULT LISTVIEW_Paint(LISTVIEW_INFO *infoPtr, HDC hdc)
LISTVIEW_UpdateScroll(infoPtr);
}
UpdateWindow(infoPtr->hwndHeader);
if (infoPtr->hwndHeader) UpdateWindow(infoPtr->hwndHeader);
if (hdc)
LISTVIEW_Refresh(infoPtr, hdc, NULL);

View File

@ -903,14 +903,14 @@ static void test_create(void)
(GetWindowLongPtr(hList, GWL_STYLE) & ~LVS_LIST) | LVS_REPORT);
ok(((ret & WS_VISIBLE) && (ret & LVS_LIST)), "Style wrong, should have WS_VISIBLE|LVS_LIST\n");
hHeader = (HWND)SendMessage(hList, LVM_GETHEADER, 0, 0);
ok(IsWindow(hHeader), "Header shouldn't be created\n");
ok(hHeader == GetDlgItem(hList, 0), "NULL dialog item expected\n");
ok(IsWindow(hHeader), "Header should be created\n");
ok(hHeader == GetDlgItem(hList, 0), "Expected header as dialog item\n");
ret = SetWindowLongPtr(hList, GWL_STYLE,
(GetWindowLongPtr(hList, GWL_STYLE) & ~LVS_REPORT) | LVS_LIST);
ok(((ret & WS_VISIBLE) && (ret & LVS_REPORT)), "Style wrong, should have WS_VISIBLE|LVS_REPORT\n");
hHeader = (HWND)SendMessage(hList, LVM_GETHEADER, 0, 0);
ok(IsWindow(hHeader), "Header shouldn't be created\n");
ok(hHeader == GetDlgItem(hList, 0), "NULL dialog item expected\n");
ok(IsWindow(hHeader), "Header should be created\n");
ok(hHeader == GetDlgItem(hList, 0), "Expected header as dialog item\n");
DestroyWindow(hList);
/* LVS_REPORT without WS_VISIBLE */
@ -941,6 +941,16 @@ static void test_create(void)
ok(IsWindow(hHeader), "Header should be created\n");
ok(hHeader == GetDlgItem(hList, 0), "Expected header as dialog item\n");
DestroyWindow(hList);
/* LVS_REPORT with LVS_NOCOLUMNHEADER */
hList = CreateWindow("SysListView32", "Test", LVS_REPORT|LVS_NOCOLUMNHEADER|WS_VISIBLE,
0, 0, 100, 100, NULL, NULL, GetModuleHandle(NULL), 0);
hHeader = (HWND)SendMessage(hList, LVM_GETHEADER, 0, 0);
ok(IsWindow(hHeader), "Header should be created\n");
ok(hHeader == GetDlgItem(hList, 0), "Expected header as dialog item\n");
/* HDS_DRAGDROP set by default */
ok(GetWindowLongPtr(hHeader, GWL_STYLE) & HDS_DRAGDROP, "Expected header to have HDS_DRAGDROP\n");
DestroyWindow(hList);
}
static void test_redraw(void)