Commit 292d8429 authored by Adam Gundy's avatar Adam Gundy Committed by Alexandre Julliard

TREEVIEW_UpdateScrollBars() now copes with an empty tree.

parent d4fcc4bd
......@@ -2690,14 +2690,23 @@ TREEVIEW_UpdateScrollBars(TREEVIEW_INFO *infoPtr)
if (vert)
{
si.nPage = TREEVIEW_GetVisibleCount(infoPtr);
si.nPos = infoPtr->firstVisible->visibleOrder;
si.nMax = infoPtr->maxVisibleOrder - 1;
if ( si.nPage )
{
si.nPos = infoPtr->firstVisible->visibleOrder;
si.nMax = infoPtr->maxVisibleOrder - 1;
SetScrollInfo(hwnd, SB_VERT, &si, TRUE);
SetScrollInfo(hwnd, SB_VERT, &si, TRUE);
if (!(infoPtr->uInternalStatus & TV_VSCROLL))
ShowScrollBar(hwnd, SB_VERT, TRUE);
infoPtr->uInternalStatus |= TV_VSCROLL;
if (!(infoPtr->uInternalStatus & TV_VSCROLL))
ShowScrollBar(hwnd, SB_VERT, TRUE);
infoPtr->uInternalStatus |= TV_VSCROLL;
}
else
{
if (infoPtr->uInternalStatus & TV_VSCROLL)
ShowScrollBar(hwnd, SB_VERT, FALSE);
infoPtr->uInternalStatus &= ~TV_VSCROLL;
}
}
else
{
......
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