Commit d5af0175 authored by Gael de Chalendar's avatar Gael de Chalendar Committed by Alexandre Julliard

Partially complete GetTextCharsetInfo and corrects return values for

this family of functions.
parent 1509b2d0
......@@ -6883,7 +6883,7 @@ BOOL32 WINAPI GetStringTypeEx32W(LCID,DWORD,LPCWSTR,INT32,LPWORD);
VOID WINAPI GetSystemInfo(LPSYSTEM_INFO);
BOOL32 WINAPI GetSystemPowerStatus(LPSYSTEM_POWER_STATUS);
VOID WINAPI GetSystemTime(LPSYSTEMTIME);
INT32 WINAPI GetTextCharsetInfo(HDC32,LPCHARSETINFO,DWORD);
UINT32 WINAPI GetTextCharsetInfo(HDC32,LPFONTSIGNATURE,DWORD);
BOOL32 WINAPI GetTextExtentExPoint32A(HDC32,LPCSTR,INT32,INT32,
LPINT32,LPINT32,LPSIZE32);
BOOL32 WINAPI GetTextExtentExPoint32W(HDC32,LPCWSTR,INT32,INT32,
......@@ -8314,8 +8314,8 @@ UINT32 WINAPI GetTextAlign32(HDC32);
INT16 WINAPI GetTextCharacterExtra16(HDC16);
INT32 WINAPI GetTextCharacterExtra32(HDC32);
#define GetTextCharacterExtra WINELIB_NAME(GetTextCharacterExtra)
INT16 WINAPI GetTextCharset16(HDC16);
INT32 WINAPI GetTextCharset32(HDC32);
UINT16 WINAPI GetTextCharset16(HDC16);
UINT32 WINAPI GetTextCharset32(HDC32);
#define GetTextCharset WINELIB_NAME(GetTextCharset)
COLORREF WINAPI GetTextColor16(HDC16);
COLORREF WINAPI GetTextColor32(HDC32);
......
......@@ -721,12 +721,13 @@ DWORD WINAPI GetTabbedTextExtent32W( HDC32 hdc, LPCWSTR lpstr, INT32 count,
*
* NOTES
* Should it return a UINT32 instead of an INT32?
* => YES, as GetTextCharsetInfo returns UINT32
*
* RETURNS
* Success: Character set identifier
* Failure: DEFAULT_CHARSET
*/
INT32 WINAPI GetTextCharset32(
UINT32 WINAPI GetTextCharset32(
HDC32 hdc) /* [in] Handle to device context */
{
/* MSDN docs say this is equivalent */
......@@ -736,9 +737,9 @@ INT32 WINAPI GetTextCharset32(
/***********************************************************************
* GetTextCharset16 [GDI.612]
*/
INT16 WINAPI GetTextCharset16(HDC16 hdc)
UINT16 WINAPI GetTextCharset16(HDC16 hdc)
{
return GetTextCharset32(hdc);
return (UINT16)GetTextCharset32(hdc);
}
/***********************************************************************
......@@ -747,21 +748,31 @@ INT16 WINAPI GetTextCharset16(HDC16 hdc)
* NOTES
* Should csi be an LPFONTSIGNATURE instead of an LPCHARSETINFO?
* Should it return a UINT32 instead of an INT32?
* => YES and YES, from win32.hlp from Borland
*
* RETURNS
* Success: Character set identifier
* Failure: DEFAULT_CHARSET
*/
INT32 WINAPI GetTextCharsetInfo(
HDC32 hdc, /* [in] Handle to device context */
LPCHARSETINFO csi, /* [out] Pointer to struct to receive data */
DWORD flags) /* [in] Reserved - must be 0 */
UINT32 WINAPI GetTextCharsetInfo(
HDC32 hdc, /* [in] Handle to device context */
LPFONTSIGNATURE fs, /* [out] Pointer to struct to receive data */
DWORD flags) /* [in] Reserved - must be 0 */
{
FIXME(text,"(0x%x,%p,%08lx): stub\n",hdc,csi,flags);
if (csi) {
csi->ciCharset = DEFAULT_CHARSET;
csi->ciACP = GetACP();
HGDIOBJ32 hFont;
UINT32 charSet = DEFAULT_CHARSET;
LOGFONT32W lf;
if (fs != NULL)
FIXME(text,"(0x%x,%p,%08lx): stub\n",hdc,fs,flags);
hFont = GetCurrentObject(hdc, OBJ_FONT);
if (hFont == 0)
return(DEFAULT_CHARSET);
if ( GetObject32W(hFont, sizeof(LOGFONT32W), &lf) != 0 )
charSet = lf.lfCharSet;
if (fs != NULL) {
/* ... fill fontstruct too ... still to do*/
}
/* ... fill fontstruct too ... */
return DEFAULT_CHARSET;
return charSet;
}
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