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.
This commit is contained in:
Filip Navara 2004-08-11 20:53:32 +00:00 committed by Alexandre Julliard
parent 522217c0e2
commit ab13698998
1 changed files with 6 additions and 13 deletions

View File

@ -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: