From 72f174192b9adc75d47a166f2b28bf28a7c08898 Mon Sep 17 00:00:00 2001 From: Owen Rudge Date: Thu, 8 Mar 2012 11:34:01 +0000 Subject: [PATCH] comctl32/monthcal: Check both min and max ranges in IsDateInValidRange. --- dlls/comctl32/monthcal.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/dlls/comctl32/monthcal.c b/dlls/comctl32/monthcal.c index e148a62aa80..1c9572b477c 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; + } } }