Module: wine Branch: master Commit: 72f174192b9adc75d47a166f2b28bf28a7c08898 URL: http://source.winehq.org/git/wine.git/?a=commit;h=72f174192b9adc75d47a166f2b...
Author: Owen Rudge orudge@codeweavers.com Date: Thu Mar 8 11:34:01 2012 +0000
comctl32/monthcal: Check both min and max ranges in IsDateInValidRange.
---
dlls/comctl32/monthcal.c | 17 ++++++++++------- 1 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/dlls/comctl32/monthcal.c b/dlls/comctl32/monthcal.c index e148a62..1c9572b 100644 --- a/dlls/comctl32/monthcal.c +++ b/dlls/comctl32/monthcal.c @@ -353,14 +353,17 @@ static BOOL MONTHCAL_IsDateInValidRange(const MONTHCAL_INFO *infoPtr, else if(MONTHCAL_CompareSystemTime(date, &min_allowed_date) == -1) { fix_st = &min_allowed_date; } - else if(infoPtr->rangeValid & GDTR_MAX) { - if((MONTHCAL_CompareSystemTime(date, &infoPtr->maxDate) == 1)) { - fix_st = &infoPtr->maxDate; + else { + if(infoPtr->rangeValid & GDTR_MAX) { + if((MONTHCAL_CompareSystemTime(date, &infoPtr->maxDate) == 1)) { + fix_st = &infoPtr->maxDate; + } } - } - else if(infoPtr->rangeValid & GDTR_MIN) { - if((MONTHCAL_CompareSystemTime(date, &infoPtr->minDate) == -1)) { - fix_st = &infoPtr->minDate; + + if(infoPtr->rangeValid & GDTR_MIN) { + if((MONTHCAL_CompareSystemTime(date, &infoPtr->minDate) == -1)) { + fix_st = &infoPtr->minDate; + } } }