comctl32: Set updown control value to min or max in out of range case.

This commit is contained in:
Piotr Caban 2013-10-16 16:34:19 +02:00 committed by Alexandre Julliard
parent a8ebda9801
commit e6fce2de4a
1 changed files with 7 additions and 2 deletions

View File

@ -150,11 +150,16 @@ static BOOL UPDOWN_OffsetVal(UPDOWN_INFO *infoPtr, int delta)
(infoPtr->MaxVal < infoPtr->MinVal ? -1 : 1) *
(infoPtr->MinVal - infoPtr->MaxVal) +
(delta < 0 ? 1 : -1);
} else return FALSE;
} if ((infoPtr->MaxVal > infoPtr->MinVal && infoPtr->CurVal+delta > infoPtr->MaxVal)
|| (infoPtr->MaxVal < infoPtr->MinVal && infoPtr->CurVal+delta < infoPtr->MaxVal)) {
delta = infoPtr->MaxVal - infoPtr->CurVal;
} else {
delta = infoPtr->MinVal - infoPtr->CurVal;
}
}
infoPtr->CurVal += delta;
return TRUE;
return delta != 0;
}
/***********************************************************************