[USER32] Pure Whitespace sync from comctl32/combo.c, no functional change

This will make future syncs between those files much easier,
and fixes tons of mixed tab-space-indentation.

Please no whitespace nitpicks when reviewing this commit, it is a SYNC!
This commit is contained in:
Joachim Henze 2023-09-10 23:36:21 +02:00 committed by Joachim Henze
parent d97313181e
commit e13ebd44c6

View file

@ -173,7 +173,6 @@ static LRESULT COMBO_NCCreate(HWND hwnd, LONG style)
*/ */
static LRESULT COMBO_NCDestroy( LPHEADCOMBO lphc ) static LRESULT COMBO_NCDestroy( LPHEADCOMBO lphc )
{ {
if (lphc) if (lphc)
{ {
TRACE("[%p]: freeing storage\n", lphc->self); TRACE("[%p]: freeing storage\n", lphc->self);
@ -858,8 +857,7 @@ static LRESULT COMBO_Paint(LPHEADCOMBO lphc, HDC hParamDC)
PAINTSTRUCT ps; PAINTSTRUCT ps;
HDC hDC; HDC hDC;
hDC = (hParamDC) ? hParamDC hDC = (hParamDC) ? hParamDC : BeginPaint(lphc->self, &ps);
: BeginPaint( lphc->self, &ps);
TRACE("hdc=%p\n", hDC); TRACE("hdc=%p\n", hDC);
@ -872,7 +870,6 @@ static LRESULT COMBO_Paint(LPHEADCOMBO lphc, HDC hParamDC)
* DC. * DC.
*/ */
hBkgBrush = COMBO_PrepareColors(lphc, hDC); hBkgBrush = COMBO_PrepareColors(lphc, hDC);
hPrevBrush = SelectObject(hDC, hBkgBrush); hPrevBrush = SelectObject(hDC, hBkgBrush);
if (!(lphc->wState & CBF_EDIT)) if (!(lphc->wState & CBF_EDIT))
FillRect(hDC, &lphc->textRect, hBkgBrush); FillRect(hDC, &lphc->textRect, hBkgBrush);
@ -883,9 +880,7 @@ static LRESULT COMBO_Paint(LPHEADCOMBO lphc, HDC hParamDC)
CBPaintBorder(lphc->self, lphc, hDC); CBPaintBorder(lphc->self, lphc, hDC);
if (!IsRectEmpty(&lphc->buttonRect)) if (!IsRectEmpty(&lphc->buttonRect))
{
CBPaintButton(lphc, hDC, lphc->buttonRect); CBPaintButton(lphc, hDC, lphc->buttonRect);
}
/* paint the edit control padding area */ /* paint the edit control padding area */
if (CB_GETTYPE(lphc) != CBS_DROPDOWNLIST) if (CB_GETTYPE(lphc) != CBS_DROPDOWNLIST)
@ -963,11 +958,9 @@ static void CBUpdateEdit( LPHEADCOMBO lphc , INT index )
if( length != LB_ERR) if( length != LB_ERR)
{ {
if ((pText = HeapAlloc(GetProcessHeap(), 0, (length + 1) * sizeof(WCHAR)))) if ((pText = HeapAlloc(GetProcessHeap(), 0, (length + 1) * sizeof(WCHAR))))
{
SendMessageW(lphc->hWndLBox, LB_GETTEXT, (WPARAM)index, (LPARAM)pText ); SendMessageW(lphc->hWndLBox, LB_GETTEXT, (WPARAM)index, (LPARAM)pText );
} }
} }
}
if( CB_HASSTRINGS(lphc) ) if( CB_HASSTRINGS(lphc) )
{ {
@ -1842,8 +1835,7 @@ LRESULT WINAPI ComboWndProc_common( HWND hwnd, UINT message, WPARAM wParam, LPAR
} }
#endif #endif
TRACE("[%p]: msg %s wp %08lx lp %08lx\n", TRACE("[%p]: msg %s wp %08lx lp %08lx\n", hwnd, SPY_GetMsgName(message, hwnd), wParam, lParam);
hwnd, SPY_GetMsgName(message, hwnd), wParam, lParam );
#ifndef __REACTOS__ #ifndef __REACTOS__
if (!IsWindow(hwnd)) return 0; if (!IsWindow(hwnd)) return 0;
@ -1852,13 +1844,9 @@ LRESULT WINAPI ComboWndProc_common( HWND hwnd, UINT message, WPARAM wParam, LPAR
if (lphc || message == WM_NCCREATE) if (lphc || message == WM_NCCREATE)
switch(message) switch(message)
{ {
/* System messages */
case WM_NCCREATE: case WM_NCCREATE:
{ {
LONG style = unicode ? ((LPCREATESTRUCTW)lParam)->style : LONG style = unicode ? ((LPCREATESTRUCTW)lParam)->style : ((LPCREATESTRUCTA)lParam)->style;
((LPCREATESTRUCTA)lParam)->style;
return COMBO_NCCreate(hwnd, style); return COMBO_NCCreate(hwnd, style);
} }
case WM_NCDESTROY: case WM_NCDESTROY:
@ -1884,13 +1872,11 @@ LRESULT WINAPI ComboWndProc_common( HWND hwnd, UINT message, WPARAM wParam, LPAR
} }
return COMBO_Create(hwnd, lphc, hwndParent, style, unicode); return COMBO_Create(hwnd, lphc, hwndParent, style, unicode);
} }
case WM_PRINTCLIENT: case WM_PRINTCLIENT:
/* Fallthrough */ /* Fallthrough */
case WM_PAINT: case WM_PAINT:
/* wParam may contain a valid HDC! */ /* wParam may contain a valid HDC! */
return COMBO_Paint(lphc, (HDC)wParam); return COMBO_Paint(lphc, (HDC)wParam);
case WM_ERASEBKGND: case WM_ERASEBKGND:
/* do all painting in WM_PAINT like Windows does */ /* do all painting in WM_PAINT like Windows does */
return 1; return 1;
@ -1908,8 +1894,8 @@ LRESULT WINAPI ComboWndProc_common( HWND hwnd, UINT message, WPARAM wParam, LPAR
return result; return result;
} }
case WM_SIZE: case WM_SIZE:
if( lphc->hWndLBox && if (lphc->hWndLBox && !(lphc->wState & CBF_NORESIZE))
!(lphc->wState & CBF_NORESIZE) ) COMBO_Size( lphc ); COMBO_Size( lphc );
return TRUE; return TRUE;
case WM_SETFONT: case WM_SETFONT:
COMBO_Font( lphc, (HFONT)wParam, (BOOL)lParam ); COMBO_Font( lphc, (HFONT)wParam, (BOOL)lParam );
@ -1917,10 +1903,12 @@ LRESULT WINAPI ComboWndProc_common( HWND hwnd, UINT message, WPARAM wParam, LPAR
case WM_GETFONT: case WM_GETFONT:
return (LRESULT)lphc->hFont; return (LRESULT)lphc->hFont;
case WM_SETFOCUS: case WM_SETFOCUS:
if( lphc->wState & CBF_EDIT ) { if (lphc->wState & CBF_EDIT)
{
SetFocus( lphc->hWndEdit ); SetFocus( lphc->hWndEdit );
/* The first time focus is received, select all the text */ /* The first time focus is received, select all the text */
if( !(lphc->wState & CBF_BEENFOCUSED) ) { if (!(lphc->wState & CBF_BEENFOCUSED))
{
SendMessageW(lphc->hWndEdit, EM_SETSEL, 0, -1); SendMessageW(lphc->hWndEdit, EM_SETSEL, 0, -1);
lphc->wState |= CBF_BEENFOCUSED; lphc->wState |= CBF_BEENFOCUSED;
} }
@ -1931,8 +1919,7 @@ LRESULT WINAPI ComboWndProc_common( HWND hwnd, UINT message, WPARAM wParam, LPAR
case WM_KILLFOCUS: case WM_KILLFOCUS:
{ {
HWND hwndFocus = WIN_GetFullHandle((HWND)wParam); HWND hwndFocus = WIN_GetFullHandle((HWND)wParam);
if( !hwndFocus || if (!hwndFocus || (hwndFocus != lphc->hWndEdit && hwndFocus != lphc->hWndLBox))
(hwndFocus != lphc->hWndEdit && hwndFocus != lphc->hWndLBox ))
COMBO_KillFocus( lphc ); COMBO_KillFocus( lphc );
return TRUE; return TRUE;
} }
@ -1960,7 +1947,8 @@ LRESULT WINAPI ComboWndProc_common( HWND hwnd, UINT message, WPARAM wParam, LPAR
lphc->wState &= ~CBF_NOEDITNOTIFY; lphc->wState &= ~CBF_NOEDITNOTIFY;
return ret; return ret;
} }
else return CB_ERR; else
return CB_ERR;
case WM_CUT: case WM_CUT:
case WM_PASTE: case WM_PASTE:
case WM_COPY: case WM_COPY:
@ -2067,7 +2055,6 @@ LRESULT WINAPI ComboWndProc_common( HWND hwnd, UINT message, WPARAM wParam, LPAR
break; break;
/* Combo messages */ /* Combo messages */
case CB_ADDSTRING: case CB_ADDSTRING:
if (unicode) if (unicode)
{ {
@ -2113,7 +2100,6 @@ LRESULT WINAPI ComboWndProc_common( HWND hwnd, UINT message, WPARAM wParam, LPAR
CharLowerA((LPSTR)lParam); CharLowerA((LPSTR)lParam);
else if (lphc->dwStyle & CBS_UPPERCASE) else if (lphc->dwStyle & CBS_UPPERCASE)
CharUpperA((LPSTR)lParam); CharUpperA((LPSTR)lParam);
return SendMessageA(lphc->hWndLBox, LB_INSERTSTRING, wParam, lParam); return SendMessageA(lphc->hWndLBox, LB_INSERTSTRING, wParam, lParam);
} }
case CB_DELETESTRING: case CB_DELETESTRING:
@ -2156,8 +2142,7 @@ LRESULT WINAPI ComboWndProc_common( HWND hwnd, UINT message, WPARAM wParam, LPAR
case CB_SETLOCALE: case CB_SETLOCALE:
return SendMessageW(lphc->hWndLBox, LB_SETLOCALE, wParam, 0); return SendMessageW(lphc->hWndLBox, LB_SETLOCALE, wParam, 0);
case CB_SETDROPPEDWIDTH: case CB_SETDROPPEDWIDTH:
if( (CB_GETTYPE(lphc) == CBS_SIMPLE) || if ((CB_GETTYPE(lphc) == CBS_SIMPLE) || (INT)wParam >= 32768)
(INT)wParam >= 32768 )
return CB_ERR; return CB_ERR;
/* new value must be higher than combobox width */ /* new value must be higher than combobox width */
if ((INT)wParam >= lphc->droppedRect.right - lphc->droppedRect.left) if ((INT)wParam >= lphc->droppedRect.right - lphc->droppedRect.left)
@ -2190,8 +2175,7 @@ LRESULT WINAPI ComboWndProc_common( HWND hwnd, UINT message, WPARAM wParam, LPAR
if (!(lphc->wState & CBF_DROPPED)) if (!(lphc->wState & CBF_DROPPED))
CBDropDown( lphc ); CBDropDown( lphc );
} }
else else if (lphc->wState & CBF_DROPPED)
if( lphc->wState & CBF_DROPPED )
CBRollUp( lphc, FALSE, TRUE ); CBRollUp( lphc, FALSE, TRUE );
} }
return TRUE; return TRUE;
@ -2225,8 +2209,7 @@ LRESULT WINAPI ComboWndProc_common( HWND hwnd, UINT message, WPARAM wParam, LPAR
return CB_ERR; return CB_ERR;
case CB_SETEDITSEL: case CB_SETEDITSEL:
if (lphc->wState & CBF_EDIT) if (lphc->wState & CBF_EDIT)
return SendMessageW(lphc->hWndEdit, EM_SETSEL, return SendMessageW(lphc->hWndEdit, EM_SETSEL, (INT)(INT16)LOWORD(lParam), (INT)(INT16)HIWORD(lParam) );
(INT)(INT16)LOWORD(lParam), (INT)(INT16)HIWORD(lParam) );
return CB_ERR; return CB_ERR;
case CB_SETEXTENDEDUI: case CB_SETEXTENDEDUI:
if (CB_GETTYPE(lphc) == CBS_SIMPLE ) if (CB_GETTYPE(lphc) == CBS_SIMPLE )
@ -2268,13 +2251,11 @@ LRESULT WINAPI ComboWndProc_common( HWND hwnd, UINT message, WPARAM wParam, LPAR
CB_NOTIFY(lphc, CBN_KILLFOCUS); CB_NOTIFY(lphc, CBN_KILLFOCUS);
} }
return TRUE; return TRUE;
#endif #endif
default: default:
if (message >= WM_USER) if (message >= WM_USER)
WARN("unknown msg WM_USER+%04x wp=%04lx lp=%08lx\n", WARN("unknown msg WM_USER+%04x wp=%04lx lp=%08lx\n", message - WM_USER, wParam, lParam );
message - WM_USER, wParam, lParam );
break; break;
} }
return unicode ? DefWindowProcW(hwnd, message, wParam, lParam) : return unicode ? DefWindowProcW(hwnd, message, wParam, lParam) :
@ -2309,7 +2290,8 @@ LRESULT WINAPI ComboWndProcW( HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
/************************************************************************* /*************************************************************************
* GetComboBoxInfo (USER32.@) * GetComboBoxInfo (USER32.@)
*/ */
BOOL WINAPI GetComboBoxInfo(HWND hwndCombo, /* [in] handle to combo box */ BOOL WINAPI GetComboBoxInfo(
HWND hwndCombo, /* [in] handle to combo box */
PCOMBOBOXINFO pcbi /* [in/out] combo box information */) PCOMBOBOXINFO pcbi /* [in/out] combo box information */)
{ {
TRACE("(%p, %p)\n", hwndCombo, pcbi); TRACE("(%p, %p)\n", hwndCombo, pcbi);