From aa81962d7e7da9b0fa082bc1dc848e99dc5dda31 Mon Sep 17 00:00:00 2001 From: The Wine Synchronizer Date: Wed, 12 Dec 2007 08:52:08 +0000 Subject: [PATCH] Autosyncing with Wine HEAD svn path=/trunk/; revision=31178 --- reactos/dll/win32/comctl32/comctl32_ros.diff | 60 -------------------- reactos/dll/win32/comctl32/comctl32undoc.c | 4 +- reactos/dll/win32/comctl32/commctrl.c | 2 +- reactos/dll/win32/comctl32/dpa.c | 6 +- reactos/dll/win32/comctl32/dsa.c | 2 +- reactos/dll/win32/comctl32/header.c | 2 +- reactos/dll/win32/comctl32/listview.c | 37 ++++++------ reactos/dll/win32/comctl32/monthcal.c | 4 +- reactos/dll/win32/comctl32/propsheet.c | 6 +- reactos/dll/win32/comctl32/rebar.c | 2 +- reactos/dll/win32/comctl32/toolbar.c | 4 +- reactos/dll/win32/comctl32/tooltips.c | 2 +- reactos/dll/win32/comctl32/trackbar.c | 2 +- reactos/dll/win32/comctl32/treeview.c | 3 +- 14 files changed, 41 insertions(+), 95 deletions(-) diff --git a/reactos/dll/win32/comctl32/comctl32_ros.diff b/reactos/dll/win32/comctl32/comctl32_ros.diff index 72fe8eea957..fa639663c02 100644 --- a/reactos/dll/win32/comctl32/comctl32_ros.diff +++ b/reactos/dll/win32/comctl32/comctl32_ros.diff @@ -82,15 +82,6 @@ Index: propsheet.c } /****************************************************************************** -@@ -3521,6 +3525,8 @@ - * from which to switch to the next page */ - SendMessageW(hwndTabCtrl, TCM_SETCURSEL, psInfo->active_page, 0); - -+ PROPSHEET_UnChanged(hwnd, (HWND)wParam); -+ - return TRUE; - } - Index: tooltips.c =================================================================== --- tooltips.c (revision 25790) @@ -143,54 +134,3 @@ Index: treeview.c if (infoPtr->cdmode & CDRF_NOTIFYPOSTPAINT) infoPtr->cdmode = TREEVIEW_SendCustomDrawNotify(infoPtr, CDDS_POSTPAINT, hdc, rect); -@@ -4160,6 +4158,22 @@ - static LRESULT - TREEVIEW_RButtonUp(const TREEVIEW_INFO *infoPtr, const POINT *pPt) - { -+ TVHITTESTINFO ht; -+ -+ ht.pt = *pPt; -+ -+ TREEVIEW_HitTest(infoPtr, &ht); -+ -+ if (ht.hItem) -+ { -+ /* Change to screen coordinate for WM_CONTEXTMENU */ -+ ClientToScreen(infoPtr->hwnd, &ht.pt); -+ -+ /* Send a WM_CONTEXTMENU message in response to the RBUTTONUP */ -+ SendMessageW(infoPtr->hwnd, WM_CONTEXTMENU, -+ (WPARAM)infoPtr->hwnd, MAKELPARAM(ht.pt.x, ht.pt.y)); -+ } -+ - return 0; - } - -Index: monthcal.c -=================================================================== ---- monthcal.c (revision 29360) -+++ monthcal.c (working copy) -@@ -1719,11 +1719,12 @@ - - - static LRESULT --MONTHCAL_KillFocus(const MONTHCAL_INFO *infoPtr) -+MONTHCAL_KillFocus(const MONTHCAL_INFO *infoPtr, HWND hFocusWnd) - { - TRACE("\n"); - -- InvalidateRect(infoPtr->hwndSelf, NULL, TRUE); -+ if (infoPtr->hwndNotify != hFocusWnd) -+ ShowWindow(infoPtr->hwndSelf, SW_HIDE); - - return 0; - } -@@ -2031,7 +2032,7 @@ - return DLGC_WANTARROWS | DLGC_WANTCHARS; - - case WM_KILLFOCUS: -- return MONTHCAL_KillFocus(infoPtr); -+ return MONTHCAL_KillFocus(infoPtr, wParam); - - case WM_RBUTTONDOWN: - return MONTHCAL_RButtonDown(infoPtr, lParam); diff --git a/reactos/dll/win32/comctl32/comctl32undoc.c b/reactos/dll/win32/comctl32/comctl32undoc.c index 6f434a68e02..8ada7825bb7 100644 --- a/reactos/dll/win32/comctl32/comctl32undoc.c +++ b/reactos/dll/win32/comctl32/comctl32undoc.c @@ -834,8 +834,8 @@ INT WINAPI EnumMRUListW (HANDLE hList, INT nItemPos, LPVOID lpBuffer, const WINEMRUITEM *witem; INT desired, datasize; - if (nItemPos >= mp->cursize) return -1; if ((nItemPos < 0) || !lpBuffer) return mp->cursize; + if (nItemPos >= mp->cursize) return -1; desired = mp->realMRU[nItemPos]; desired -= 'a'; TRACE("nItemPos=%d, desired=%d\n", nItemPos, desired); @@ -860,8 +860,8 @@ INT WINAPI EnumMRUListA (HANDLE hList, INT nItemPos, LPVOID lpBuffer, INT desired, datasize; DWORD lenA; - if (nItemPos >= mp->cursize) return -1; if ((nItemPos < 0) || !lpBuffer) return mp->cursize; + if (nItemPos >= mp->cursize) return -1; desired = mp->realMRU[nItemPos]; desired -= 'a'; TRACE("nItemPos=%d, desired=%d\n", nItemPos, desired); diff --git a/reactos/dll/win32/comctl32/commctrl.c b/reactos/dll/win32/comctl32/commctrl.c index 4604c0ec7ac..60ea2efebb0 100644 --- a/reactos/dll/win32/comctl32/commctrl.c +++ b/reactos/dll/win32/comctl32/commctrl.c @@ -343,7 +343,7 @@ MenuHelp (UINT uMsg, WPARAM wParam, LPARAM lParam, HMENU hMainMenu, else { /* menu item was selected */ if (HIWORD(wParam) & MF_POPUP) - uMenuID = (UINT)*(lpwIDs+1); + uMenuID = *(lpwIDs+1); else uMenuID = (UINT)LOWORD(wParam); TRACE("uMenuID = %u\n", uMenuID); diff --git a/reactos/dll/win32/comctl32/dpa.c b/reactos/dll/win32/comctl32/dpa.c index 4df556eaf26..e5f98b9e956 100644 --- a/reactos/dll/win32/comctl32/dpa.c +++ b/reactos/dll/win32/comctl32/dpa.c @@ -443,7 +443,7 @@ HDPA WINAPI DPA_Clone (const HDPA hdpa, const HDPA hdpaNew) /* create a new pointer array */ nNewItems = hdpaTemp->nGrow * - ((INT)((hdpa->nItemCount - 1) / hdpaTemp->nGrow) + 1); + (((hdpa->nItemCount - 1) / hdpaTemp->nGrow) + 1); nSize = nNewItems * sizeof(LPVOID); hdpaTemp->ptrs = HeapAlloc (hdpaTemp->hHeap, HEAP_ZERO_MEMORY, nSize); hdpaTemp->nMaxCount = nNewItems; @@ -583,7 +583,7 @@ BOOL WINAPI DPA_SetPtr (const HDPA hdpa, INT i, LPVOID p) if (hdpa->nMaxCount <= i) { /* resize the block of memory */ INT nNewItems = - hdpa->nGrow * ((INT)(((i+1) - 1) / hdpa->nGrow) + 1); + hdpa->nGrow * ((((i+1) - 1) / hdpa->nGrow) + 1); INT nSize = nNewItems * sizeof(LPVOID); if (hdpa->ptrs) @@ -654,7 +654,7 @@ LPVOID WINAPI DPA_DeletePtr (const HDPA hdpa, INT i) return NULL; hdpa->nMaxCount = nNewItems; - hdpa->ptrs = (LPVOID*)lpDest; + hdpa->ptrs = lpDest; } return lpTemp; diff --git a/reactos/dll/win32/comctl32/dsa.c b/reactos/dll/win32/comctl32/dsa.c index 5edb4fc084e..13f63e23de4 100644 --- a/reactos/dll/win32/comctl32/dsa.c +++ b/reactos/dll/win32/comctl32/dsa.c @@ -211,7 +211,7 @@ BOOL WINAPI DSA_SetItem (const HDSA hdsa, INT nIndex, LPVOID pSrc) else { /* resize the block of memory */ nNewItems = - hdsa->nGrow * ((INT)(((nIndex + 1) - 1) / hdsa->nGrow) + 1); + hdsa->nGrow * ((((nIndex + 1) - 1) / hdsa->nGrow) + 1); nSize = hdsa->nItemSize * nNewItems; lpTemp = ReAlloc (hdsa->pData, nSize); diff --git a/reactos/dll/win32/comctl32/header.c b/reactos/dll/win32/comctl32/header.c index 64403fc4f80..cd144e2196e 100644 --- a/reactos/dll/win32/comctl32/header.c +++ b/reactos/dll/win32/comctl32/header.c @@ -981,7 +981,7 @@ HEADER_CreateDragImage (HWND hwnd, WPARAM wParam) int height, width; HFONT hFont; - if (wParam < 0 || wParam >= infoPtr->uNumItem) + if (wParam >= infoPtr->uNumItem) return FALSE; if (!infoPtr->bRectsValid) diff --git a/reactos/dll/win32/comctl32/listview.c b/reactos/dll/win32/comctl32/listview.c index e551ebe679b..8405d41e9da 100644 --- a/reactos/dll/win32/comctl32/listview.c +++ b/reactos/dll/win32/comctl32/listview.c @@ -944,7 +944,7 @@ static inline DWORD notify_customdraw (const LISTVIEW_INFO *infoPtr, DWORD dwDra return result; } -static void prepaint_setup (const LISTVIEW_INFO *infoPtr, HDC hdc, NMLVCUSTOMDRAW *lpnmlvcd) +static void prepaint_setup (const LISTVIEW_INFO *infoPtr, HDC hdc, NMLVCUSTOMDRAW *lpnmlvcd, BOOL SubItem) { if (lpnmlvcd->clrTextBk == CLR_DEFAULT) lpnmlvcd->clrTextBk = comctl32_color.clrWindow; @@ -952,18 +952,21 @@ static void prepaint_setup (const LISTVIEW_INFO *infoPtr, HDC hdc, NMLVCUSTOMDRA lpnmlvcd->clrText = comctl32_color.clrWindowText; /* apprently, for selected items, we have to override the returned values */ - if (lpnmlvcd->nmcd.uItemState & CDIS_SELECTED) + if (!SubItem) { - if (infoPtr->bFocus) - { - lpnmlvcd->clrTextBk = comctl32_color.clrHighlight; - lpnmlvcd->clrText = comctl32_color.clrHighlightText; + if (lpnmlvcd->nmcd.uItemState & CDIS_SELECTED) + { + if (infoPtr->bFocus) + { + lpnmlvcd->clrTextBk = comctl32_color.clrHighlight; + lpnmlvcd->clrText = comctl32_color.clrHighlightText; + } + else if (infoPtr->dwStyle & LVS_SHOWSELALWAYS) + { + lpnmlvcd->clrTextBk = comctl32_color.clr3dFace; + lpnmlvcd->clrText = comctl32_color.clrBtnText; + } } - else if (infoPtr->dwStyle & LVS_SHOWSELALWAYS) - { - lpnmlvcd->clrTextBk = comctl32_color.clr3dFace; - lpnmlvcd->clrText = comctl32_color.clrBtnText; - } } /* Set the text attributes */ @@ -3787,7 +3790,9 @@ static BOOL LISTVIEW_DrawItem(LISTVIEW_INFO *infoPtr, HDC hdc, INT nItem, INT nS if (cdsubitemmode & CDRF_SKIPDEFAULT) goto postpaint; } if (nSubItem == 0 || (cdmode & CDRF_NOTIFYITEMDRAW)) - prepaint_setup(infoPtr, hdc, &nmlvcd); + prepaint_setup(infoPtr, hdc, &nmlvcd, FALSE); + else if ((infoPtr->dwLvExStyle & LVS_EX_FULLROWSELECT) == FALSE) + prepaint_setup(infoPtr, hdc, &nmlvcd, TRUE); /* in full row select, subitems, will just use main item's colors */ if (nSubItem && uView == LVS_REPORT && (infoPtr->dwLvExStyle & LVS_EX_FULLROWSELECT)) @@ -3930,7 +3935,7 @@ static void LISTVIEW_RefreshOwnerDraw(const LISTVIEW_INFO *infoPtr, ITERATOR *i, if (!(cditemmode & CDRF_SKIPDEFAULT)) { - prepaint_setup (infoPtr, hdc, &nmlvcd); + prepaint_setup (infoPtr, hdc, &nmlvcd, FALSE); SendMessageW(infoPtr->hwndNotify, WM_DRAWITEM, dis.CtlID, (LPARAM)&dis); } @@ -4118,7 +4123,7 @@ static void LISTVIEW_Refresh(LISTVIEW_INFO *infoPtr, HDC hdc, const RECT *prcEra customdraw_fill(&nmlvcd, infoPtr, hdc, &rcClient, 0); cdmode = notify_customdraw(infoPtr, CDDS_PREPAINT, &nmlvcd); if (cdmode & CDRF_SKIPDEFAULT) goto enddraw; - prepaint_setup(infoPtr, hdc, &nmlvcd); + prepaint_setup(infoPtr, hdc, &nmlvcd, FALSE); /* Use these colors to draw the items */ infoPtr->clrTextBk = nmlvcd.clrTextBk; @@ -5040,12 +5045,12 @@ static INT LISTVIEW_FindItemA(const LISTVIEW_INFO *infoPtr, INT nStart, BOOL hasText = lpFindInfo->flags & (LVFI_STRING | LVFI_PARTIAL); LVFINDINFOW fiw; INT res; - LPWSTR strW; + LPWSTR strW = NULL; memcpy(&fiw, lpFindInfo, sizeof(fiw)); if (hasText) fiw.psz = strW = textdupTtoW((LPCWSTR)lpFindInfo->psz, FALSE); res = LISTVIEW_FindItemW(infoPtr, nStart, &fiw); - if (hasText) textfreeT(strW, FALSE); + textfreeT(strW, FALSE); return res; } diff --git a/reactos/dll/win32/comctl32/monthcal.c b/reactos/dll/win32/comctl32/monthcal.c index e8266127da1..0144df5f277 100644 --- a/reactos/dll/win32/comctl32/monthcal.c +++ b/reactos/dll/win32/comctl32/monthcal.c @@ -1725,6 +1725,8 @@ MONTHCAL_KillFocus(const MONTHCAL_INFO *infoPtr, HWND hFocusWnd) if (infoPtr->hwndNotify != hFocusWnd) ShowWindow(infoPtr->hwndSelf, SW_HIDE); + else + InvalidateRect(infoPtr->hwndSelf, NULL, TRUE); return 0; } @@ -2032,7 +2034,7 @@ MONTHCAL_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) return DLGC_WANTARROWS | DLGC_WANTCHARS; case WM_KILLFOCUS: - return MONTHCAL_KillFocus(infoPtr, wParam); + return MONTHCAL_KillFocus(infoPtr, (HWND)wParam); case WM_RBUTTONDOWN: return MONTHCAL_RButtonDown(infoPtr, lParam); diff --git a/reactos/dll/win32/comctl32/propsheet.c b/reactos/dll/win32/comctl32/propsheet.c index 83ab8318f3b..20ead0420ce 100644 --- a/reactos/dll/win32/comctl32/propsheet.c +++ b/reactos/dll/win32/comctl32/propsheet.c @@ -1527,7 +1527,7 @@ static VOID PROPSHEET_LoadWizardBitmaps(PropSheetInfo *psInfo) if ((psInfo->ppshheader.dwFlags & PSH_WATERMARK) && !(psInfo->ppshheader.dwFlags & PSH_USEHBMWATERMARK)) { - ((PropSheetInfo *)psInfo)->ppshheader.u4.hbmWatermark = + psInfo->ppshheader.u4.hbmWatermark = CreateMappedBitmap(psInfo->ppshheader.hInstance, (INT_PTR)psInfo->ppshheader.u4.pszbmWatermark, 0, NULL, 0); } @@ -1535,7 +1535,7 @@ static VOID PROPSHEET_LoadWizardBitmaps(PropSheetInfo *psInfo) if ((psInfo->ppshheader.dwFlags & PSH_HEADER) && !(psInfo->ppshheader.dwFlags & PSH_USEHBMHEADER)) { - ((PropSheetInfo *)psInfo)->ppshheader.u5.hbmHeader = + psInfo->ppshheader.u5.hbmHeader = CreateMappedBitmap(psInfo->ppshheader.hInstance, (INT_PTR)psInfo->ppshheader.u5.pszbmHeader, 0, NULL, 0); } } @@ -2081,7 +2081,7 @@ static BOOL PROPSHEET_SetCurSel(HWND hwndDlg, index = PROPSHEET_FindPageByResId(psInfo, result); if(index >= psInfo->nPages) { index = old_index; - WARN("Tried to skip to nonexistant page by res id\n"); + WARN("Tried to skip to nonexistent page by res id\n"); break; } continue; diff --git a/reactos/dll/win32/comctl32/rebar.c b/reactos/dll/win32/comctl32/rebar.c index 7cf11bf1904..f42c93743f5 100644 --- a/reactos/dll/win32/comctl32/rebar.c +++ b/reactos/dll/win32/comctl32/rebar.c @@ -2797,7 +2797,7 @@ REBAR_GetFont (const REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam) static LRESULT REBAR_PushChevron(const REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam) { - if (wParam >= 0 && (UINT)wParam < infoPtr->uNumBands) + if ((UINT)wParam < infoPtr->uNumBands) { NMREBARCHEVRON nmrbc; REBAR_BAND *lpBand = &infoPtr->bands[wParam]; diff --git a/reactos/dll/win32/comctl32/toolbar.c b/reactos/dll/win32/comctl32/toolbar.c index 429444e15ae..b7a67257781 100644 --- a/reactos/dll/win32/comctl32/toolbar.c +++ b/reactos/dll/win32/comctl32/toolbar.c @@ -3190,7 +3190,7 @@ TOOLBAR_Customize (HWND hwnd) (LPWSTR)RT_DIALOG))) return FALSE; - if(!(template = (LPVOID)LoadResource (COMCTL32_hModule, hRes))) + if(!(template = LoadResource (COMCTL32_hModule, hRes))) return FALSE; ret = DialogBoxIndirectParamW ((HINSTANCE)GetWindowLongPtrW(hwnd, GWLP_HINSTANCE), @@ -5893,7 +5893,7 @@ TOOLBAR_LButtonUp (HWND hwnd, WPARAM wParam, LPARAM lParam) infoPtr->nButtonDown = -1; /* Issue NM_RELEASEDCAPTURE to parent to let him know it is released */ - TOOLBAR_SendNotify ((NMHDR *) &hdr, infoPtr, + TOOLBAR_SendNotify (&hdr, infoPtr, NM_RELEASEDCAPTURE); /* native issues TBN_ENDDRAG here, if _LBUTTONDOWN issued the diff --git a/reactos/dll/win32/comctl32/tooltips.c b/reactos/dll/win32/comctl32/tooltips.c index 6882a178225..900c6cd15bf 100644 --- a/reactos/dll/win32/comctl32/tooltips.c +++ b/reactos/dll/win32/comctl32/tooltips.c @@ -1109,7 +1109,7 @@ TOOLTIPS_AddToolW (HWND hwnd, WPARAM wParam, LPARAM lParam) if (IS_INTRESOURCE(lpToolInfo->lpszText)) { TRACE("add string id %x\n", LOWORD(lpToolInfo->lpszText)); - toolPtr->lpszText = (LPWSTR)lpToolInfo->lpszText; + toolPtr->lpszText = lpToolInfo->lpszText; } else if (lpToolInfo->lpszText) { if (lpToolInfo->lpszText == LPSTR_TEXTCALLBACKW) { diff --git a/reactos/dll/win32/comctl32/trackbar.c b/reactos/dll/win32/comctl32/trackbar.c index f95ec5edccd..7b6c708a1b2 100644 --- a/reactos/dll/win32/comctl32/trackbar.c +++ b/reactos/dll/win32/comctl32/trackbar.c @@ -811,7 +811,7 @@ TRACKBAR_UpdateToolTip (const TRACKBAR_INFO *infoPtr) ClientToScreen(infoPtr->hwndSelf, &pt); SendMessageW (infoPtr->hwndToolTip, TTM_TRACKPOSITION, - 0, (LPARAM)MAKELPARAM(pt.x, pt.y)); + 0, MAKELPARAM(pt.x, pt.y)); } diff --git a/reactos/dll/win32/comctl32/treeview.c b/reactos/dll/win32/comctl32/treeview.c index 937bd0ee938..01e6f26ce8b 100644 --- a/reactos/dll/win32/comctl32/treeview.c +++ b/reactos/dll/win32/comctl32/treeview.c @@ -3994,7 +3994,7 @@ TREEVIEW_LButtonDown(TREEVIEW_INFO *infoPtr, LPARAM lParam) if(ht.hItem && (ht.flags & TVHT_ONITEM)) { infoPtr->focusedItem = ht.hItem; - InvalidateRect(hwnd, &(((HTREEITEM)(ht.hItem))->rect), TRUE); + InvalidateRect(hwnd, &ht.hItem->rect, TRUE); if(infoPtr->selectedItem) InvalidateRect(hwnd, &(infoPtr->selectedItem->rect), TRUE); @@ -4173,7 +4173,6 @@ TREEVIEW_RButtonUp(const TREEVIEW_INFO *infoPtr, const POINT *pPt) SendMessageW(infoPtr->hwnd, WM_CONTEXTMENU, (WPARAM)infoPtr->hwnd, MAKELPARAM(ht.pt.x, ht.pt.y)); } - return 0; }