oleaut32: Fix year 0.
This commit is contained in:
parent
ac1ca87b21
commit
23ff47610e
|
@ -1665,7 +1665,7 @@ static void test_VarDateFromUdate(void)
|
|||
UD2T(1,12001,-1020,18,1,16,0,0,0,0,S_OK,29221.75087962963); /* Test rolled year and month */
|
||||
UD2T(1,-23,1982,18,1,16,0,0,0,0,S_OK,29221.75087962963); /* Test backrolled month */
|
||||
UD2T(-59,3,1980,18,1,16,0,0,0,0,S_OK,29221.75087962963); /* Test backrolled days */
|
||||
todo_wine UD2T(1,1,0,0,0,0,0,0,0,0,S_OK,36526); /* Test zero year */
|
||||
UD2T(1,1,0,0,0,0,0,0,0,0,S_OK,36526); /* Test zero year */
|
||||
UD2T(0,0,1980,0,0,0,0,0,0,0,S_OK,29189); /* Test zero day and month */
|
||||
UD2T(0,1,1980,0,0,0,0,2,1,0,S_OK,29220.0); /* Test zero day = LastDayOfMonth */
|
||||
UD2T(-1,1,1980,18,1,16,0,0,0,0,S_OK,29219.75087962963); /* Test day -1 = LastDayOfMonth - 1 */
|
||||
|
|
|
@ -1145,7 +1145,7 @@ static HRESULT VARIANT_RollUdate(UDATE *lpUd)
|
|||
if (iYear > 9999 || iYear < -9999)
|
||||
return E_INVALIDARG; /* Invalid value */
|
||||
/* Years < 100 are treated as 1900 + year */
|
||||
if (iYear >= 0 && iYear < 100)
|
||||
if (iYear > 0 && iYear < 100)
|
||||
iYear += 1900;
|
||||
|
||||
iMinute += (iSecond - (iSecond % 60)) / 60;
|
||||
|
@ -1180,7 +1180,7 @@ static HRESULT VARIANT_RollUdate(UDATE *lpUd)
|
|||
if (iSecond<0){iSecond+=60; iMinute--;}
|
||||
if (iMinute<0){iMinute+=60; iHour--;}
|
||||
if (iHour<0) {iHour+=24; iDay--;}
|
||||
if (iYear<0) iYear+=2000;
|
||||
if (iYear<=0) iYear+=2000;
|
||||
|
||||
lpUd->st.wYear = iYear;
|
||||
lpUd->st.wMonth = iMonth;
|
||||
|
|
Loading…
Reference in New Issue