Commit 8fb60376 authored by Vitaliy Margolen's avatar Vitaliy Margolen Committed by Alexandre Julliard

Correct Page Up/Down handling in report mode.

parent 7955fb01
......@@ -8015,7 +8015,13 @@ static LRESULT LISTVIEW_KeyDown(LISTVIEW_INFO *infoPtr, INT nVirtualKey, LONG lK
case VK_PRIOR:
if (uView == LVS_REPORT)
nItem = infoPtr->nFocusedItem - LISTVIEW_GetCountPerColumn(infoPtr);
{
INT topidx = LISTVIEW_GetTopIndex(infoPtr);
if (infoPtr->nFocusedItem == topidx)
nItem = topidx - LISTVIEW_GetCountPerColumn(infoPtr) + 1;
else
nItem = topidx;
}
else
nItem = infoPtr->nFocusedItem - LISTVIEW_GetCountPerColumn(infoPtr)
* LISTVIEW_GetCountPerRow(infoPtr);
......@@ -8024,7 +8030,14 @@ static LRESULT LISTVIEW_KeyDown(LISTVIEW_INFO *infoPtr, INT nVirtualKey, LONG lK
case VK_NEXT:
if (uView == LVS_REPORT)
nItem = infoPtr->nFocusedItem + LISTVIEW_GetCountPerColumn(infoPtr);
{
INT topidx = LISTVIEW_GetTopIndex(infoPtr);
INT cnt = LISTVIEW_GetCountPerColumn(infoPtr);
if (infoPtr->nFocusedItem == topidx + cnt - 1)
nItem = infoPtr->nFocusedItem + cnt - 1;
else
nItem = topidx + cnt - 1;
}
else
nItem = infoPtr->nFocusedItem + LISTVIEW_GetCountPerColumn(infoPtr)
* LISTVIEW_GetCountPerRow(infoPtr);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment