comctl32/monthcal: Check both min and max ranges in IsDateInValidRange.

This commit is contained in:
Owen Rudge 2012-03-08 11:34:01 +00:00 committed by Alexandre Julliard
parent e3ab993647
commit 72f174192b
1 changed files with 10 additions and 7 deletions

View File

@ -353,16 +353,19 @@ 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) {
else {
if(infoPtr->rangeValid & GDTR_MAX) {
if((MONTHCAL_CompareSystemTime(date, &infoPtr->maxDate) == 1)) {
fix_st = &infoPtr->maxDate;
}
}
else if(infoPtr->rangeValid & GDTR_MIN) {
if(infoPtr->rangeValid & GDTR_MIN) {
if((MONTHCAL_CompareSystemTime(date, &infoPtr->minDate) == -1)) {
fix_st = &infoPtr->minDate;
}
}
}
if (fix && fix_st) {
date->wYear = fix_st->wYear;