Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid using out of range value in wxSpinCtrl with inversed range.
In wxMSW it is possible that minimal allowed value is greater than maximal allowed one and the native control works correctly in this case, however wxSpinCtrl set m_oldValue to an invalid value which could result in an infinite recursion if SetRange() was called from the wxEVT_SPINCTRL event handler. For example, if the control value was initially 0 and the event handler called SetRange(1, 0), it would result setting the value to 1 because it was less than the minimum, resulting in another call to the event handler which would now set the value to 0 because it was more than the maximum resulting in another call to the event handler and so forth. Fix this by ensuring that the value lies between minimal and maximal values, whatever is their relative order.
- Loading branch information