Farshad Agah : comctl32: monthcal: Reject out of range dates in MCM_SETCURSEL.

Alexandre Julliard julliard at wine.codeweavers.com
Fri Mar 9 07:28:27 CST 2007


Module: wine
Branch: master
Commit: d0f75b5993d04392e4723f16cbfbcb85cc1a3afa
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=d0f75b5993d04392e4723f16cbfbcb85cc1a3afa

Author: Farshad Agah <f_agah at yahoo.com>
Date:   Thu Mar  8 20:48:48 2007 -0800

comctl32: monthcal: Reject out of range dates in MCM_SETCURSEL.

---

 dlls/comctl32/monthcal.c       |    2 ++
 dlls/comctl32/tests/monthcal.c |    6 +++---
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/dlls/comctl32/monthcal.c b/dlls/comctl32/monthcal.c
index 53a8e5c..ded5c5c 100644
--- a/dlls/comctl32/monthcal.c
+++ b/dlls/comctl32/monthcal.c
@@ -1038,6 +1038,8 @@ MONTHCAL_SetCurSel(MONTHCAL_INFO *infoPtr, LPARAM lParam)
   if((infoPtr==NULL) ||(lpSel==NULL)) return FALSE;
   if(GetWindowLongW(infoPtr->hwndSelf, GWL_STYLE) & MCS_MULTISELECT) return FALSE;
 
+  if(!MONTHCAL_ValidateTime(*lpSel)) return FALSE;
+
   infoPtr->currentMonth=lpSel->wMonth;
   infoPtr->currentYear=lpSel->wYear;
 
diff --git a/dlls/comctl32/tests/monthcal.c b/dlls/comctl32/tests/monthcal.c
index 6de5be8..c8666f3 100644
--- a/dlls/comctl32/tests/monthcal.c
+++ b/dlls/comctl32/tests/monthcal.c
@@ -206,7 +206,7 @@ static void test_monthcal_currDate(HWND hwnd)
     /* Overflow matters, check for wDay */
     st_test.wDay += 4;
     res = SendMessage(hwnd, MCM_SETCURSEL, 0, (LPARAM)&st_test);
-    todo_wine {expect(0,res);}
+    expect(0,res);
 
     /* correct wDay before checking for wMonth */
     st_test.wDay -= 4;
@@ -215,7 +215,7 @@ static void test_monthcal_currDate(HWND hwnd)
     /* Overflow matters, check for wMonth */
     st_test.wMonth += 4;
     res = SendMessage(hwnd, MCM_SETCURSEL, 0, (LPARAM)&st_test);
-    todo_wine {expect(0,res);}
+    expect(0,res);
 
     /* checking if gets the information right, modify st_new */
     st_new.wYear += 4;
@@ -231,7 +231,7 @@ static void test_monthcal_currDate(HWND hwnd)
     /* st_new change to st_origin, above settings with overflow */
     /* should not change the current settings */
     expect(st_original.wYear, st_new.wYear);
-    todo_wine {expect(st_original.wMonth, st_new.wMonth);}
+    expect(st_original.wMonth, st_new.wMonth);
     expect(st_original.wDay, st_new.wDay);
     expect(st_original.wHour, st_new.wHour);
     expect(st_original.wMinute, st_new.wMinute);




More information about the wine-cvs mailing list