mirror of
https://github.com/reactos/reactos.git
synced 2025-05-09 03:37:08 +00:00
Vitaly Lipatov : Fix character conversion in combo box. Which needed to be synced to wine.
svn path=/trunk/; revision=22377
This commit is contained in:
parent
35c60c75a7
commit
35135e5ddb
1 changed files with 60 additions and 21 deletions
|
@ -432,6 +432,10 @@ static void CBCalcPlacement(
|
||||||
lprLB->right = lprLB->left + lphc->droppedWidth;
|
lprLB->right = lprLB->left + lphc->droppedWidth;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* don't allow negative window width */
|
||||||
|
if (lprEdit->right < lprEdit->left)
|
||||||
|
lprEdit->right = lprEdit->left;
|
||||||
|
|
||||||
TRACE("\ttext\t= (%ld,%ld-%ld,%ld)\n",
|
TRACE("\ttext\t= (%ld,%ld-%ld,%ld)\n",
|
||||||
lprEdit->left, lprEdit->top, lprEdit->right, lprEdit->bottom);
|
lprEdit->left, lprEdit->top, lprEdit->right, lprEdit->bottom);
|
||||||
|
|
||||||
|
@ -1841,6 +1845,19 @@ static LRESULT COMBO_GetComboBoxInfo(LPHEADCOMBO lphc, COMBOBOXINFO *pcbi)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static char *strdupA(LPCSTR str)
|
||||||
|
{
|
||||||
|
char *ret;
|
||||||
|
DWORD len;
|
||||||
|
|
||||||
|
if(!str) return NULL;
|
||||||
|
|
||||||
|
len = strlen(str);
|
||||||
|
ret = HeapAlloc(GetProcessHeap(), 0, len + 1);
|
||||||
|
memcpy(ret, str, len + 1);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* ComboWndProc_common
|
* ComboWndProc_common
|
||||||
*
|
*
|
||||||
|
@ -2068,16 +2085,32 @@ static LRESULT ComboWndProc_common( HWND hwnd, UINT message,
|
||||||
/* fall through */
|
/* fall through */
|
||||||
#endif
|
#endif
|
||||||
case CB_ADDSTRING:
|
case CB_ADDSTRING:
|
||||||
{
|
|
||||||
UINT msg = LB_ADDSTRING;
|
|
||||||
if( lphc->dwStyle & CBS_LOWERCASE )
|
|
||||||
msg = LB_ADDSTRING_LOWER;
|
|
||||||
else if( lphc->dwStyle & CBS_UPPERCASE )
|
|
||||||
msg = LB_ADDSTRING_UPPER;
|
|
||||||
if( unicode )
|
if( unicode )
|
||||||
return SendMessageW(lphc->hWndLBox, msg, 0, lParam);
|
{
|
||||||
else
|
if( lphc->dwStyle & CBS_LOWERCASE )
|
||||||
return SendMessageA(lphc->hWndLBox, msg, 0, lParam);
|
CharLowerW((LPWSTR)lParam);
|
||||||
|
else if( lphc->dwStyle & CBS_UPPERCASE )
|
||||||
|
CharUpperW((LPWSTR)lParam);
|
||||||
|
return SendMessageW(lphc->hWndLBox, LB_ADDSTRING, 0, lParam);
|
||||||
|
}
|
||||||
|
else /* unlike the unicode version, the ansi version does not overwrite
|
||||||
|
the string if converting case */
|
||||||
|
{
|
||||||
|
char *p, *string = NULL;
|
||||||
|
LRESULT ret;
|
||||||
|
if( lphc->dwStyle & CBS_LOWERCASE )
|
||||||
|
{
|
||||||
|
string = strdupA((LPSTR)lParam);
|
||||||
|
CharLowerA(string);
|
||||||
|
}
|
||||||
|
else if( lphc->dwStyle & CBS_UPPERCASE )
|
||||||
|
{
|
||||||
|
string = strdupA((LPSTR)lParam);
|
||||||
|
CharUpperA(string);
|
||||||
|
}
|
||||||
|
ret = SendMessageA(lphc->hWndLBox, LB_ADDSTRING, 0, string ? (LPARAM)string : lParam);
|
||||||
|
HeapFree(GetProcessHeap(), 0, string);
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
#ifndef __REACTOS__
|
#ifndef __REACTOS__
|
||||||
case CB_INSERTSTRING16:
|
case CB_INSERTSTRING16:
|
||||||
|
@ -2086,16 +2119,22 @@ static LRESULT ComboWndProc_common( HWND hwnd, UINT message,
|
||||||
/* fall through */
|
/* fall through */
|
||||||
#endif
|
#endif
|
||||||
case CB_INSERTSTRING:
|
case CB_INSERTSTRING:
|
||||||
{
|
|
||||||
UINT msg = LB_INSERTSTRING;
|
|
||||||
if( lphc->dwStyle & CBS_LOWERCASE )
|
|
||||||
msg = LB_INSERTSTRING_LOWER;
|
|
||||||
else if( lphc->dwStyle & CBS_UPPERCASE )
|
|
||||||
msg = LB_INSERTSTRING_UPPER;
|
|
||||||
if( unicode )
|
if( unicode )
|
||||||
return SendMessageW(lphc->hWndLBox, msg, 0, lParam);
|
{
|
||||||
|
if( lphc->dwStyle & CBS_LOWERCASE )
|
||||||
|
CharLowerW((LPWSTR)lParam);
|
||||||
|
else if( lphc->dwStyle & CBS_UPPERCASE )
|
||||||
|
CharUpperW((LPWSTR)lParam);
|
||||||
|
return SendMessageW(lphc->hWndLBox, LB_INSERTSTRING, wParam, lParam);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
return SendMessageA(lphc->hWndLBox, msg, 0, lParam);
|
{
|
||||||
|
char *p;
|
||||||
|
if( lphc->dwStyle & CBS_LOWERCASE )
|
||||||
|
CharLowerA((LPSTR)lParam);
|
||||||
|
else if( lphc->dwStyle & CBS_UPPERCASE )
|
||||||
|
CharUpperA((LPSTR)lParam);
|
||||||
|
return SendMessageA(lphc->hWndLBox, LB_INSERTSTRING, wParam, lParam);
|
||||||
}
|
}
|
||||||
#ifndef __REACTOS__
|
#ifndef __REACTOS__
|
||||||
case CB_DELETESTRING16:
|
case CB_DELETESTRING16:
|
||||||
|
|
Loading…
Reference in a new issue