comctl32/listview: Update view on style change only if LVS_TYPEMASK styles have changed.

This commit is contained in:
Nikolay Sivov 2015-03-23 01:19:41 +03:00 committed by Alexandre Julliard
parent cc737bd460
commit b6dc726bbd
2 changed files with 10 additions and 2 deletions

View File

@ -11067,7 +11067,6 @@ static INT LISTVIEW_StyleChanged(LISTVIEW_INFO *infoPtr, WPARAM wStyleType,
if (wStyleType != GWL_STYLE) return 0;
infoPtr->dwStyle = lpss->styleNew;
map_style_view(infoPtr);
if (((lpss->styleOld & WS_HSCROLL) != 0)&&
((lpss->styleNew & WS_HSCROLL) == 0))
@ -11080,7 +11079,10 @@ static INT LISTVIEW_StyleChanged(LISTVIEW_INFO *infoPtr, WPARAM wStyleType,
if (uNewView != uOldView)
{
HIMAGELIST himl;
/* LVM_SETVIEW doesn't change window style bits within LVS_TYPEMASK,
changing style updates current view only when view bits change. */
map_style_view(infoPtr);
SendMessageW(infoPtr->hwndEdit, WM_KILLFOCUS, 0, 0);
ShowWindow(infoPtr->hwndHeader, SW_HIDE);

View File

@ -4554,6 +4554,12 @@ static void test_get_set_view(void)
style = GetWindowLongPtrA(hwnd, GWL_STYLE);
ok(style & LVS_LIST, "Expected style to be preserved\n");
/* now change window style to see if view is remapped */
style = GetWindowLongPtrA(hwnd, GWL_STYLE);
SetWindowLongPtrA(hwnd, GWL_STYLE, style | LVS_SHOWSELALWAYS);
ret = SendMessageA(hwnd, LVM_GETVIEW, 0, 0);
expect(LV_VIEW_SMALLICON, ret);
DestroyWindow(hwnd);
}