Commit 2b560c75 authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

Remove redundant parameters from MDICreateChild and MDIDestroyChild.

Make the parameter names slightly more descriptive.
parent 63c1c939
...@@ -463,7 +463,7 @@ static LRESULT MDIRefreshMenu( HWND hwnd, HMENU hmenuFrame, ...@@ -463,7 +463,7 @@ static LRESULT MDIRefreshMenu( HWND hwnd, HMENU hmenuFrame,
/********************************************************************** /**********************************************************************
* MDICreateChild * MDICreateChild
*/ */
static HWND MDICreateChild( WND *w, MDICLIENTINFO *ci, HWND parent, static HWND MDICreateChild( WND *wndParent, MDICLIENTINFO *ci,
LPMDICREATESTRUCTA cs, BOOL unicode ) LPMDICREATESTRUCTA cs, BOOL unicode )
{ {
POINT pos[2]; POINT pos[2];
...@@ -475,7 +475,7 @@ static HWND MDICreateChild( WND *w, MDICLIENTINFO *ci, HWND parent, ...@@ -475,7 +475,7 @@ static HWND MDICreateChild( WND *w, MDICLIENTINFO *ci, HWND parent,
TRACE("origin %i,%i - dim %i,%i, style %08lx\n", TRACE("origin %i,%i - dim %i,%i, style %08lx\n",
cs->x, cs->y, cs->cx, cs->cy, cs->style); cs->x, cs->y, cs->cx, cs->cy, cs->style);
/* calculate placement */ /* calculate placement */
MDI_CalcDefaultChildPos(w, ci->nTotalCreated++, pos, 0); MDI_CalcDefaultChildPos(wndParent, ci->nTotalCreated++, pos, 0);
if (cs->cx == CW_USEDEFAULT || !cs->cx) cs->cx = pos[1].x; if (cs->cx == CW_USEDEFAULT || !cs->cx) cs->cx = pos[1].x;
if (cs->cy == CW_USEDEFAULT || !cs->cy) cs->cy = pos[1].y; if (cs->cy == CW_USEDEFAULT || !cs->cy) cs->cy = pos[1].y;
...@@ -491,11 +491,11 @@ static HWND MDICreateChild( WND *w, MDICLIENTINFO *ci, HWND parent, ...@@ -491,11 +491,11 @@ static HWND MDICreateChild( WND *w, MDICLIENTINFO *ci, HWND parent,
{ {
TRACE("Restoring current maximized child %04x\n", ci->hwndChildMaximized); TRACE("Restoring current maximized child %04x\n", ci->hwndChildMaximized);
if( style & WS_MAXIMIZE ) if( style & WS_MAXIMIZE )
SendMessageW(w->hwndSelf, WM_SETREDRAW, FALSE, 0L); SendMessageW(wndParent->hwndSelf, WM_SETREDRAW, FALSE, 0L);
hwndMax = ci->hwndChildMaximized; hwndMax = ci->hwndChildMaximized;
ShowWindow( hwndMax, SW_SHOWNOACTIVATE ); ShowWindow( hwndMax, SW_SHOWNOACTIVATE );
if( style & WS_MAXIMIZE ) if( style & WS_MAXIMIZE )
SendMessageW(w->hwndSelf, WM_SETREDRAW, TRUE, 0L); SendMessageW(wndParent->hwndSelf, WM_SETREDRAW, TRUE, 0L);
} }
if (ci->nActiveChildren <= MDI_MOREWINDOWSLIMIT) if (ci->nActiveChildren <= MDI_MOREWINDOWSLIMIT)
...@@ -506,7 +506,7 @@ static HWND MDICreateChild( WND *w, MDICLIENTINFO *ci, HWND parent, ...@@ -506,7 +506,7 @@ static HWND MDICreateChild( WND *w, MDICLIENTINFO *ci, HWND parent,
ci->nActiveChildren++; ci->nActiveChildren++;
/* fix window style */ /* fix window style */
if( !(w->dwStyle & MDIS_ALLCHILDSTYLES) ) if( !(wndParent->dwStyle & MDIS_ALLCHILDSTYLES) )
{ {
TRACE("MDIS_ALLCHILDSTYLES is missing, fixing window style\n"); TRACE("MDIS_ALLCHILDSTYLES is missing, fixing window style\n");
style &= (WS_CHILD | WS_CLIPSIBLINGS | WS_MINIMIZE | WS_MAXIMIZE | style &= (WS_CHILD | WS_CLIPSIBLINGS | WS_MINIMIZE | WS_MAXIMIZE |
...@@ -514,18 +514,18 @@ static HWND MDICreateChild( WND *w, MDICLIENTINFO *ci, HWND parent, ...@@ -514,18 +514,18 @@ static HWND MDICreateChild( WND *w, MDICLIENTINFO *ci, HWND parent,
style |= (WS_VISIBLE | WS_OVERLAPPEDWINDOW); style |= (WS_VISIBLE | WS_OVERLAPPEDWINDOW);
} }
if( w->flags & WIN_ISWIN32 ) if( wndParent->flags & WIN_ISWIN32 )
{ {
if(unicode) if(unicode)
{ {
MDICREATESTRUCTW *csW = (MDICREATESTRUCTW *)cs; MDICREATESTRUCTW *csW = (MDICREATESTRUCTW *)cs;
hwnd = CreateWindowW( csW->szClass, csW->szTitle, style, hwnd = CreateWindowW( csW->szClass, csW->szTitle, style,
csW->x, csW->y, csW->cx, csW->cy, parent, csW->x, csW->y, csW->cx, csW->cy, wndParent->hwndSelf,
(HMENU)wIDmenu, csW->hOwner, csW ); (HMENU)wIDmenu, csW->hOwner, csW );
} }
else else
hwnd = CreateWindowA( cs->szClass, cs->szTitle, style, hwnd = CreateWindowA( cs->szClass, cs->szTitle, style,
cs->x, cs->y, cs->cx, cs->cy, parent, cs->x, cs->y, cs->cx, cs->cy, wndParent->hwndSelf,
(HMENU)wIDmenu, cs->hOwner, cs ); (HMENU)wIDmenu, cs->hOwner, cs );
} }
else else
...@@ -541,7 +541,7 @@ static HWND MDICreateChild( WND *w, MDICLIENTINFO *ci, HWND parent, ...@@ -541,7 +541,7 @@ static HWND MDICreateChild( WND *w, MDICLIENTINFO *ci, HWND parent,
cs16->szClass = SEGPTR_GET(cls); cs16->szClass = SEGPTR_GET(cls);
hwnd = CreateWindow16( cs->szClass, cs->szTitle, style, hwnd = CreateWindow16( cs->szClass, cs->szTitle, style,
cs16->x, cs16->y, cs16->cx, cs16->cy, parent, cs16->x, cs16->y, cs16->cx, cs16->cy, wndParent->hwndSelf,
(HMENU)wIDmenu, cs16->hOwner, (HMENU)wIDmenu, cs16->hOwner,
(LPVOID)SEGPTR_GET(cs16) ); (LPVOID)SEGPTR_GET(cs16) );
SEGPTR_FREE( title ); SEGPTR_FREE( title );
...@@ -564,7 +564,7 @@ static HWND MDICreateChild( WND *w, MDICLIENTINFO *ci, HWND parent, ...@@ -564,7 +564,7 @@ static HWND MDICreateChild( WND *w, MDICLIENTINFO *ci, HWND parent,
if (ci->nActiveChildren > MDI_MOREWINDOWSLIMIT) if (ci->nActiveChildren > MDI_MOREWINDOWSLIMIT)
MDI_SwapMenuItems(wnd->parent, wnd->wIDmenu, ci->idFirstChild + MDI_MOREWINDOWSLIMIT - 1); MDI_SwapMenuItems(wnd->parent, wnd->wIDmenu, ci->idFirstChild + MDI_MOREWINDOWSLIMIT - 1);
MDI_MenuModifyItem(w ,hwnd); MDI_MenuModifyItem(wndParent, hwnd);
/* Have we hit the "More Windows..." limit? If so, we must /* Have we hit the "More Windows..." limit? If so, we must
* add a "More Windows..." option * add a "More Windows..." option
...@@ -691,8 +691,7 @@ END: ...@@ -691,8 +691,7 @@ END:
* MDIDestroyChild * MDIDestroyChild
*/ */
static LRESULT MDIDestroyChild( WND *w_parent, MDICLIENTINFO *ci, static LRESULT MDIDestroyChild( WND *w_parent, MDICLIENTINFO *ci,
HWND parent, HWND child, HWND child, BOOL flagDestroy )
BOOL flagDestroy )
{ {
WND *childPtr = WIN_FindWndPtr(child); WND *childPtr = WIN_FindWndPtr(child);
...@@ -700,7 +699,7 @@ static LRESULT MDIDestroyChild( WND *w_parent, MDICLIENTINFO *ci, ...@@ -700,7 +699,7 @@ static LRESULT MDIDestroyChild( WND *w_parent, MDICLIENTINFO *ci,
{ {
if( child == ci->hwndActiveChild ) if( child == ci->hwndActiveChild )
{ {
MDI_SwitchActiveChild(parent, child, TRUE); MDI_SwitchActiveChild(w_parent->hwndSelf, child, TRUE);
if( child == ci->hwndActiveChild ) if( child == ci->hwndActiveChild )
{ {
...@@ -709,7 +708,7 @@ static LRESULT MDIDestroyChild( WND *w_parent, MDICLIENTINFO *ci, ...@@ -709,7 +708,7 @@ static LRESULT MDIDestroyChild( WND *w_parent, MDICLIENTINFO *ci,
{ {
MDI_RestoreFrameMenu(w_parent->parent, child); MDI_RestoreFrameMenu(w_parent->parent, child);
ci->hwndChildMaximized = 0; ci->hwndChildMaximized = 0;
MDI_UpdateFrameText(w_parent->parent,parent,TRUE,NULL); MDI_UpdateFrameText(w_parent->parent, w_parent->hwndSelf, TRUE, NULL);
} }
MDI_ChildActivate(w_parent, 0); MDI_ChildActivate(w_parent, 0);
...@@ -1343,13 +1342,13 @@ static LRESULT WINAPI MDIClientWndProc_locked( WND *wndPtr, UINT message, ...@@ -1343,13 +1342,13 @@ static LRESULT WINAPI MDIClientWndProc_locked( WND *wndPtr, UINT message,
goto END; goto END;
case WM_MDICREATE: case WM_MDICREATE:
if (lParam) retvalue = MDICreateChild( wndPtr, ci, wndPtr->hwndSelf, if (lParam) retvalue = MDICreateChild( wndPtr, ci,
(MDICREATESTRUCTA *)lParam, unicode ); (MDICREATESTRUCTA *)lParam, unicode );
else retvalue = 0; else retvalue = 0;
goto END; goto END;
case WM_MDIDESTROY: case WM_MDIDESTROY:
retvalue = MDIDestroyChild( wndPtr, ci, wndPtr->hwndSelf, (HWND)wParam, TRUE ); retvalue = MDIDestroyChild( wndPtr, ci, (HWND)wParam, TRUE );
goto END; goto END;
case WM_MDIGETACTIVE: case WM_MDIGETACTIVE:
...@@ -2072,15 +2071,16 @@ HWND WINAPI CreateMDIWindowA( ...@@ -2072,15 +2071,16 @@ HWND WINAPI CreateMDIWindowA(
{ {
MDICLIENTINFO* pCi; MDICLIENTINFO* pCi;
MDICREATESTRUCTA cs; MDICREATESTRUCTA cs;
WND *pWnd=WIN_FindWndPtr(hWndParent); WND *pWndParent = WIN_FindWndPtr(hWndParent);
HWND retvalue; HWND retvalue;
TRACE("(%s,%s,%ld,%d,%d,%d,%d,%x,%d,%ld)\n", TRACE("(%s,%s,%ld,%d,%d,%d,%d,%x,%d,%ld)\n",
debugstr_a(lpClassName),debugstr_a(lpWindowName),dwStyle,X,Y, debugstr_a(lpClassName),debugstr_a(lpWindowName),dwStyle,X,Y,
nWidth,nHeight,hWndParent,hInstance,lParam); nWidth,nHeight,hWndParent,hInstance,lParam);
if(!pWnd){ if(!pWndParent)
ERR(" bad hwnd for MDI-client: %d\n",hWndParent); {
ERR("bad hwnd for MDI-client: %04x\n", hWndParent);
return 0; return 0;
} }
cs.szClass=lpClassName; cs.szClass=lpClassName;
...@@ -2093,10 +2093,10 @@ HWND WINAPI CreateMDIWindowA( ...@@ -2093,10 +2093,10 @@ HWND WINAPI CreateMDIWindowA(
cs.style=dwStyle; cs.style=dwStyle;
cs.lParam=lParam; cs.lParam=lParam;
pCi=(MDICLIENTINFO *)pWnd->wExtra; pCi = (MDICLIENTINFO *)pWndParent->wExtra;
retvalue = MDICreateChild(pWnd, pCi, hWndParent, &cs, FALSE); retvalue = MDICreateChild(pWndParent, pCi, &cs, FALSE);
WIN_ReleaseWndPtr(pWnd); WIN_ReleaseWndPtr(pWndParent);
return retvalue; return retvalue;
} }
...@@ -2121,16 +2121,16 @@ HWND WINAPI CreateMDIWindowW( ...@@ -2121,16 +2121,16 @@ HWND WINAPI CreateMDIWindowW(
{ {
MDICLIENTINFO *pCi; MDICLIENTINFO *pCi;
MDICREATESTRUCTW cs; MDICREATESTRUCTW cs;
WND *pWnd = WIN_FindWndPtr(hWndParent); WND *pWndParent = WIN_FindWndPtr(hWndParent);
HWND retvalue; HWND retvalue;
TRACE("(%s,%s,%ld,%d,%d,%d,%d,%x,%d,%ld)\n", TRACE("(%s,%s,%ld,%d,%d,%d,%d,%x,%d,%ld)\n",
debugstr_w(lpClassName), debugstr_w(lpWindowName), dwStyle, X, Y, debugstr_w(lpClassName), debugstr_w(lpWindowName), dwStyle, X, Y,
nWidth, nHeight, hWndParent, hInstance, lParam); nWidth, nHeight, hWndParent, hInstance, lParam);
if(!pWnd) if(!pWndParent)
{ {
ERR(" bad hwnd for MDI-client: %d\n", hWndParent); ERR("bad hwnd for MDI-client: %04x\n", hWndParent);
return 0; return 0;
} }
cs.szClass = lpClassName; cs.szClass = lpClassName;
...@@ -2143,10 +2143,10 @@ HWND WINAPI CreateMDIWindowW( ...@@ -2143,10 +2143,10 @@ HWND WINAPI CreateMDIWindowW(
cs.style = dwStyle; cs.style = dwStyle;
cs.lParam = lParam; cs.lParam = lParam;
pCi = (MDICLIENTINFO *)pWnd->wExtra; pCi = (MDICLIENTINFO *)pWndParent->wExtra;
retvalue = MDICreateChild(pWnd, pCi, hWndParent, (MDICREATESTRUCTA *)&cs, TRUE); retvalue = MDICreateChild(pWndParent, pCi, (MDICREATESTRUCTA *)&cs, TRUE);
WIN_ReleaseWndPtr(pWnd); WIN_ReleaseWndPtr(pWndParent);
return retvalue; return retvalue;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment