[Wine-devel] Eter's patch is applied to winehq repo 08/17/12

builder-robot на etersoft.ru builder-robot на etersoft.ru
Пт Авг 17 19:41:07 MSK 2012


New Etersoft's patches since last build time:
commit d54979e329647f5bf0f19de7f917129ae3e58564
Author: Sergey Guralnik <serhio на etersoft.ru>

    comctl32: Correct values passed in MCN_SELECT/MCN_SELCHANGE notifications.

commit c7abff0a2736c6c11260ed77a48fd7269fdcea30
Author: Sergey Guralnik <serhio на etersoft.ru>

    comctl32/tests: Add test for MCN_SELECT/MCN_SELCHANGE notifications.

---

commit d54979e329647f5bf0f19de7f917129ae3e58564
Author: Sergey Guralnik <serhio на etersoft.ru>
Date:   Fri Aug 17 10:24:12 2012 +0400

    comctl32: Correct values passed in MCN_SELECT/MCN_SELCHANGE notifications.

diff --git a/dlls/comctl32/monthcal.c b/dlls/comctl32/monthcal.c
index c5b6d91..f27eee3 100644
--- a/dlls/comctl32/monthcal.c
+++ b/dlls/comctl32/monthcal.c
@@ -185,7 +185,14 @@ static inline void MONTHCAL_NotifySelectionChange(const MONTHCAL_INFO *infoPtr)
     nmsc.nmhdr.idFrom   = GetWindowLongPtrW(infoPtr->hwndSelf, GWLP_ID);
     nmsc.nmhdr.code     = MCN_SELCHANGE;
     nmsc.stSelStart     = infoPtr->minSel;
-    nmsc.stSelEnd       = infoPtr->maxSel;
+    nmsc.stSelStart.wDayOfWeek = 0;
+    if(infoPtr->dwStyle & MCS_MULTISELECT){
+        nmsc.stSelEnd = infoPtr->maxSel;
+        nmsc.stSelEnd.wDayOfWeek = 0;
+    }
+    else
+        nmsc.stSelEnd = st_null;
+
     SendMessageW(infoPtr->hwndNotify, WM_NOTIFY, nmsc.nmhdr.idFrom, (LPARAM)&nmsc);
 }
 
@@ -198,7 +205,13 @@ static inline void MONTHCAL_NotifySelect(const MONTHCAL_INFO *infoPtr)
     nmsc.nmhdr.idFrom   = GetWindowLongPtrW(infoPtr->hwndSelf, GWLP_ID);
     nmsc.nmhdr.code     = MCN_SELECT;
     nmsc.stSelStart     = infoPtr->minSel;
-    nmsc.stSelEnd       = infoPtr->maxSel;
+    nmsc.stSelStart.wDayOfWeek = 0;
+    if(infoPtr->dwStyle & MCS_MULTISELECT){
+        nmsc.stSelEnd = infoPtr->maxSel;
+        nmsc.stSelEnd.wDayOfWeek = 0;
+    }
+    else
+        nmsc.stSelEnd = st_null;
 
     SendMessageW(infoPtr->hwndNotify, WM_NOTIFY, nmsc.nmhdr.idFrom, (LPARAM)&nmsc);
 }
diff --git a/dlls/comctl32/tests/monthcal.c b/dlls/comctl32/tests/monthcal.c
index 7bba895..1fed831 100644
--- a/dlls/comctl32/tests/monthcal.c
+++ b/dlls/comctl32/tests/monthcal.c
@@ -502,19 +502,18 @@ static LRESULT WINAPI parent_wnd_proc(HWND hwnd, UINT message, WPARAM wParam, LP
 
             expect(st[0].wYear,  nmchg->stSelStart.wYear);
             expect(st[0].wMonth, nmchg->stSelStart.wMonth);
-            todo_wine expect(0,  nmchg->stSelStart.wDayOfWeek);
+            expect(0,            nmchg->stSelStart.wDayOfWeek);
             expect(st[0].wDay,   nmchg->stSelStart.wDay);
 
             if(is_multisel)
             {
               expect(st[1].wYear,  nmchg->stSelEnd.wYear);
               expect(st[1].wMonth, nmchg->stSelEnd.wMonth);
-              todo_wine expect(0,  nmchg->stSelEnd.wDayOfWeek);
+              expect(0,            nmchg->stSelEnd.wDayOfWeek);
               expect(st[1].wDay,   nmchg->stSelEnd.wDay);
             }
             else
-              todo_wine
-                ok(!(nmchg->stSelEnd.wYear | nmchg->stSelEnd.wMonth |
+              ok(!(nmchg->stSelEnd.wYear | nmchg->stSelEnd.wMonth |
                         nmchg->stSelEnd.wDayOfWeek | nmchg->stSelEnd.wDay |
                         nmchg->stSelEnd.wHour | nmchg->stSelEnd.wMinute |
                         nmchg->stSelEnd.wSecond | nmchg->stSelEnd.wMilliseconds),

commit c7abff0a2736c6c11260ed77a48fd7269fdcea30
Author: Sergey Guralnik <serhio на etersoft.ru>
Date:   Fri Aug 17 10:17:02 2012 +0400

    comctl32/tests: Add test for MCN_SELECT/MCN_SELCHANGE notifications.

diff --git a/dlls/comctl32/tests/monthcal.c b/dlls/comctl32/tests/monthcal.c
index 1fe2e61..7bba895 100644
--- a/dlls/comctl32/tests/monthcal.c
+++ b/dlls/comctl32/tests/monthcal.c
@@ -41,6 +41,8 @@
 #define PARENT_SEQ_INDEX    0
 #define MONTHCAL_SEQ_INDEX  1
 
+#define SEL_NOTIFY_TEST_ID  100
+
 static struct msg_sequence *sequences[NUM_MSG_SEQUENCES];
 
 static HWND parent_wnd;
@@ -485,6 +487,40 @@ static LRESULT WINAPI parent_wnd_proc(HWND hwnd, UINT message, WPARAM wParam, LP
 
             return TRUE;
           }
+          case MCN_SELECT:
+          case MCN_SELCHANGE:
+          {
+            NMSELCHANGE *nmchg = (NMSELCHANGE*)lParam;
+            SYSTEMTIME st[2];
+            BOOL is_multisel = GetWindowLongPtr(nmchg->nmhdr.hwndFrom, GWL_STYLE) &
+                        MCS_MULTISELECT;
+
+            if(GetWindowLongPtr(nmchg->nmhdr.hwndFrom, GWLP_ID) != SEL_NOTIFY_TEST_ID)
+              break;
+            SendMessage(nmchg->nmhdr.hwndFrom, is_multisel ? MCM_GETSELRANGE :
+                        MCM_GETCURSEL, 0, (LPARAM)st);
+
+            expect(st[0].wYear,  nmchg->stSelStart.wYear);
+            expect(st[0].wMonth, nmchg->stSelStart.wMonth);
+            todo_wine expect(0,  nmchg->stSelStart.wDayOfWeek);
+            expect(st[0].wDay,   nmchg->stSelStart.wDay);
+
+            if(is_multisel)
+            {
+              expect(st[1].wYear,  nmchg->stSelEnd.wYear);
+              expect(st[1].wMonth, nmchg->stSelEnd.wMonth);
+              todo_wine expect(0,  nmchg->stSelEnd.wDayOfWeek);
+              expect(st[1].wDay,   nmchg->stSelEnd.wDay);
+            }
+            else
+              todo_wine
+                ok(!(nmchg->stSelEnd.wYear | nmchg->stSelEnd.wMonth |
+                        nmchg->stSelEnd.wDayOfWeek | nmchg->stSelEnd.wDay |
+                        nmchg->stSelEnd.wHour | nmchg->stSelEnd.wMinute |
+                        nmchg->stSelEnd.wSecond | nmchg->stSelEnd.wMilliseconds),
+                        "Non-zero member in stSelEnd\n");
+            return TRUE;
+          }
           default:
             break;
         }
@@ -1919,6 +1955,51 @@ static void test_daystate(void)
     DestroyWindow(hwnd);
 }
 
+static void test_sel_notify(void)
+{
+    typedef struct
+    {
+        DWORD       val;
+        const char* name;
+    } Monthcal_style;
+
+    HWND hwnd;
+    RECT rc;
+    MCHITTESTINFO mchit = {sizeof(MCHITTESTINFO)};
+    SYSTEMTIME st;
+    Monthcal_style styles[] = {
+        {MCS_NOTODAY,                    "MCS_NOTODAY"},
+        {MCS_NOTODAY | MCS_MULTISELECT,  "MCS_NOTODAY | MCS_MULTISELECT"},
+        {MCS_DAYSTATE,                   "MCS_DAYSTATE"},
+        {MCS_DAYSTATE | MCS_MULTISELECT, "MCS_DAYSTATE | MCS_MULTISELECT"}
+    };
+    int i;
+
+    for(i = 0; i < sizeof styles / sizeof styles[0]; i++)
+    {
+        trace("%s\n", styles[i].name);
+        hwnd = create_monthcal_control(styles[i].val);
+        SetWindowLongPtr(hwnd, GWLP_ID, SEL_NOTIFY_TEST_ID);
+        assert(hwnd);
+        SendMessage(hwnd, MCM_GETMINREQRECT, 0, (LPARAM)&rc);
+        MoveWindow(hwnd, 0, 0, rc.right, rc.bottom, FALSE);
+        /* Simulate mouse click on some unselected day to generate
+            MCN_SELECT and MCN_SELCHANGE notifications */
+        mchit.pt.x = rc.right / 2;
+        mchit.pt.y = rc.bottom / 2;
+        SendMessage(hwnd, MCM_HITTEST, 0, (LPARAM)&mchit);
+        SendMessage(hwnd, MCM_GETCURSEL, 0, (LPARAM)&st);
+        while(st.wDay == mchit.st.wDay) /* Ensure that mchit.pt points to unselected day */
+        {
+            mchit.pt.y++;
+            SendMessage(hwnd, MCM_HITTEST, 0, (LPARAM)&mchit);
+        }
+        SendMessage(hwnd, WM_LBUTTONDOWN, 0, MAKELPARAM(mchit.pt.x, mchit.pt.y));
+        SendMessage(hwnd, WM_LBUTTONUP, 0, MAKELPARAM(mchit.pt.x, mchit.pt.y));
+        DestroyWindow(hwnd);
+    }
+}
+
 START_TEST(monthcal)
 {
     BOOL (WINAPI *pInitCommonControlsEx)(const INITCOMMONCONTROLSEX*);
@@ -1962,6 +2043,7 @@ START_TEST(monthcal)
     test_selrange();
     test_killfocus();
     test_daystate();
+    test_sel_notify();
 
     if (!load_v6_module(&ctx_cookie, &hCtx))
     {


Подробная информация о списке рассылки Wine-devel