user32/combo: Remove redundant argument from text height helper.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
13d7cad9de
commit
14e074b2a4
|
@ -193,9 +193,7 @@ static LRESULT COMBO_NCDestroy( LPHEADCOMBO lphc )
|
||||||
* This height was determined through experimentation.
|
* This height was determined through experimentation.
|
||||||
* CBCalcPlacement will add 2*COMBO_YBORDERSIZE pixels for the border
|
* CBCalcPlacement will add 2*COMBO_YBORDERSIZE pixels for the border
|
||||||
*/
|
*/
|
||||||
static INT CBGetTextAreaHeight(
|
static INT CBGetTextAreaHeight(HEADCOMBO *lphc)
|
||||||
HWND hwnd,
|
|
||||||
LPHEADCOMBO lphc)
|
|
||||||
{
|
{
|
||||||
INT iTextItemHeight;
|
INT iTextItemHeight;
|
||||||
|
|
||||||
|
@ -206,7 +204,7 @@ static INT CBGetTextAreaHeight(
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
TEXTMETRICW tm;
|
TEXTMETRICW tm;
|
||||||
HDC hDC = GetDC(hwnd);
|
HDC hDC = GetDC(lphc->self);
|
||||||
HFONT hPrevFont = 0;
|
HFONT hPrevFont = 0;
|
||||||
INT baseUnitY;
|
INT baseUnitY;
|
||||||
|
|
||||||
|
@ -220,7 +218,7 @@ static INT CBGetTextAreaHeight(
|
||||||
if( hPrevFont )
|
if( hPrevFont )
|
||||||
SelectObject( hDC, hPrevFont );
|
SelectObject( hDC, hPrevFont );
|
||||||
|
|
||||||
ReleaseDC(hwnd, hDC);
|
ReleaseDC(lphc->self, hDC);
|
||||||
|
|
||||||
iTextItemHeight = baseUnitY + 4;
|
iTextItemHeight = baseUnitY + 4;
|
||||||
}
|
}
|
||||||
|
@ -240,7 +238,7 @@ static INT CBGetTextAreaHeight(
|
||||||
/*
|
/*
|
||||||
* We use the client rect for the width of the item.
|
* We use the client rect for the width of the item.
|
||||||
*/
|
*/
|
||||||
GetClientRect(hwnd, &clientRect);
|
GetClientRect(lphc->self, &clientRect);
|
||||||
|
|
||||||
lphc->wState &= ~CBF_MEASUREITEM;
|
lphc->wState &= ~CBF_MEASUREITEM;
|
||||||
|
|
||||||
|
@ -294,7 +292,7 @@ static void CBForceDummyResize(
|
||||||
RECT windowRect;
|
RECT windowRect;
|
||||||
int newComboHeight;
|
int newComboHeight;
|
||||||
|
|
||||||
newComboHeight = CBGetTextAreaHeight(lphc->self,lphc) + 2*COMBO_YBORDERSIZE();
|
newComboHeight = CBGetTextAreaHeight(lphc) + 2*COMBO_YBORDERSIZE();
|
||||||
|
|
||||||
GetWindowRect(lphc->self, &windowRect);
|
GetWindowRect(lphc->self, &windowRect);
|
||||||
|
|
||||||
|
@ -328,7 +326,7 @@ static void CBCalcPlacement(HEADCOMBO *combo)
|
||||||
InflateRect(&combo->textRect, -COMBO_XBORDERSIZE(), -COMBO_YBORDERSIZE());
|
InflateRect(&combo->textRect, -COMBO_XBORDERSIZE(), -COMBO_YBORDERSIZE());
|
||||||
|
|
||||||
/* Chop off the bottom part to fit with the height of the text area. */
|
/* Chop off the bottom part to fit with the height of the text area. */
|
||||||
combo->textRect.bottom = combo->textRect.top + CBGetTextAreaHeight(combo->self, combo);
|
combo->textRect.bottom = combo->textRect.top + CBGetTextAreaHeight(combo);
|
||||||
|
|
||||||
/* The button starts the same vertical position as the text area. */
|
/* The button starts the same vertical position as the text area. */
|
||||||
combo->buttonRect = combo->textRect;
|
combo->buttonRect = combo->textRect;
|
||||||
|
@ -1455,7 +1453,7 @@ static void COMBO_Size( LPHEADCOMBO lphc )
|
||||||
GetWindowRect(lphc->self, &rc);
|
GetWindowRect(lphc->self, &rc);
|
||||||
curComboHeight = rc.bottom - rc.top;
|
curComboHeight = rc.bottom - rc.top;
|
||||||
curComboWidth = rc.right - rc.left;
|
curComboWidth = rc.right - rc.left;
|
||||||
newComboHeight = CBGetTextAreaHeight(lphc->self, lphc) + 2*COMBO_YBORDERSIZE();
|
newComboHeight = CBGetTextAreaHeight(lphc) + 2*COMBO_YBORDERSIZE();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Resizing a combobox has another side effect, it resizes the dropped
|
* Resizing a combobox has another side effect, it resizes the dropped
|
||||||
|
@ -2004,7 +2002,7 @@ LRESULT ComboWndProc_common( HWND hwnd, UINT message, WPARAM wParam, LPARAM lPar
|
||||||
case CB_GETITEMHEIGHT:
|
case CB_GETITEMHEIGHT:
|
||||||
if( (INT)wParam >= 0 ) /* listbox item */
|
if( (INT)wParam >= 0 ) /* listbox item */
|
||||||
return SendMessageW(lphc->hWndLBox, LB_GETITEMHEIGHT, wParam, 0);
|
return SendMessageW(lphc->hWndLBox, LB_GETITEMHEIGHT, wParam, 0);
|
||||||
return CBGetTextAreaHeight(hwnd, lphc);
|
return CBGetTextAreaHeight(lphc);
|
||||||
case CB_RESETCONTENT:
|
case CB_RESETCONTENT:
|
||||||
SendMessageW(lphc->hWndLBox, LB_RESETCONTENT, 0, 0);
|
SendMessageW(lphc->hWndLBox, LB_RESETCONTENT, 0, 0);
|
||||||
if( (lphc->wState & CBF_EDIT) && CB_HASSTRINGS(lphc) )
|
if( (lphc->wState & CBF_EDIT) && CB_HASSTRINGS(lphc) )
|
||||||
|
|
Loading…
Reference in New Issue