From ab136989984c4c0ee5f0c783c0cf8f76d03c3d58 Mon Sep 17 00:00:00 2001 From: Filip Navara Date: Wed, 11 Aug 2004 20:53:32 +0000 Subject: [PATCH] Don't update infoPtr->dwStyle in LISTVIEW_WindowProc. It's already handled in LISTVIEW_StyleChanged and LISTVIEW_Create processing. Ignore WS_VSCROLL/WS_HSCROLL flags in infoPtr->dwStyle because they're not always up-to-date. --- dlls/comctl32/listview.c | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c index ce20425cc19..fae74b1bfac 100644 --- a/dlls/comctl32/listview.c +++ b/dlls/comctl32/listview.c @@ -117,7 +117,6 @@ * -- LVM_GETISEARCHSTRINGW, LVM_GETISEARCHSTRINGA * -- LVM_GETTILEINFO, LVM_SETTILEINFO * -- LVM_GETTILEVIEWINFO, LVM_SETTILEVIEWINFO - * -- LVM_GETTOOLTIPS, LVM_SETTOOLTIPS * -- LVM_GETUNICODEFORMAT, LVM_SETUNICODEFORMAT * -- LVM_GETVIEW, LVM_SETVIEW * -- LVM_GETWORKAREAS, LVM_SETWORKAREAS @@ -3485,7 +3484,6 @@ static BOOL LISTVIEW_SetItemT(LISTVIEW_INFO *infoPtr, const LVITEMW *lpLVItem, B */ static INT LISTVIEW_GetTopIndex(LISTVIEW_INFO *infoPtr) { - LONG lStyle = infoPtr->dwStyle; UINT uView = infoPtr->dwStyle & LVS_TYPEMASK; INT nItem = 0; SCROLLINFO scrollInfo; @@ -3495,17 +3493,17 @@ static INT LISTVIEW_GetTopIndex(LISTVIEW_INFO *infoPtr) if (uView == LVS_LIST) { - if ((lStyle & WS_HSCROLL) && GetScrollInfo(infoPtr->hwndSelf, SB_HORZ, &scrollInfo)) + if (GetScrollInfo(infoPtr->hwndSelf, SB_HORZ, &scrollInfo)) nItem = scrollInfo.nPos * LISTVIEW_GetCountPerColumn(infoPtr); } else if (uView == LVS_REPORT) { - if ((lStyle & WS_VSCROLL) && GetScrollInfo(infoPtr->hwndSelf, SB_VERT, &scrollInfo)) + if (GetScrollInfo(infoPtr->hwndSelf, SB_VERT, &scrollInfo)) nItem = scrollInfo.nPos; } else { - if ((lStyle & WS_VSCROLL) && GetScrollInfo(infoPtr->hwndSelf, SB_VERT, &scrollInfo)) + if (GetScrollInfo(infoPtr->hwndSelf, SB_VERT, &scrollInfo)) nItem = LISTVIEW_GetCountPerRow(infoPtr) * (scrollInfo.nPos / infoPtr->nItemHeight); } @@ -5829,9 +5827,9 @@ static void LISTVIEW_GetOrigin(LISTVIEW_INFO *infoPtr, LPPOINT lpptOrigin) scrollInfo.cbSize = sizeof(SCROLLINFO); scrollInfo.fMask = SIF_POS; - if ((infoPtr->dwStyle & WS_HSCROLL) && GetScrollInfo(infoPtr->hwndSelf, SB_HORZ, &scrollInfo)) + if (GetScrollInfo(infoPtr->hwndSelf, SB_HORZ, &scrollInfo)) nHorzPos = scrollInfo.nPos; - if ((infoPtr->dwStyle & WS_VSCROLL) && GetScrollInfo(infoPtr->hwndSelf, SB_VERT, &scrollInfo)) + if (GetScrollInfo(infoPtr->hwndSelf, SB_VERT, &scrollInfo)) nVertPos = scrollInfo.nPos; TRACE("nHorzPos=%d, nVertPos=%d\n", nHorzPos, nVertPos); @@ -8650,7 +8648,7 @@ static void LISTVIEW_UpdateSize(LISTVIEW_INFO *infoPtr) * The "2" is there to mimic the native control. I think it may be * related to either padding or edges. (GLA 7/2002) */ - if (!(infoPtr->dwStyle & WS_HSCROLL)) + if (!(GetWindowLongW(infoPtr->hwndSelf, GWL_STYLE) & WS_HSCROLL)) infoPtr->rcList.bottom -= GetSystemMetrics(SM_CYHSCROLL); infoPtr->rcList.bottom = max (infoPtr->rcList.bottom - 2, 0); } @@ -8780,11 +8778,6 @@ LISTVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) if (!infoPtr && (uMsg != WM_CREATE)) return DefWindowProcW(hwnd, uMsg, wParam, lParam); - if (infoPtr) - { - infoPtr->dwStyle = GetWindowLongW(hwnd, GWL_STYLE); - } - switch (uMsg) { case LVM_APPROXIMATEVIEWRECT: