mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 14:53:40 +00:00
[Win32SS]
- Update (Sync/Port) User32:Text to Wine Staging 1.9.11, see CORE-11368. svn path=/trunk/; revision=71906
This commit is contained in:
parent
d9af32368a
commit
45799931c9
2 changed files with 11 additions and 3 deletions
|
@ -1189,7 +1189,7 @@ INT WINAPI DrawTextExWorker( HDC hdc,
|
||||||
|
|
||||||
if (flags & DT_EXPANDTABS)
|
if (flags & DT_EXPANDTABS)
|
||||||
{
|
{
|
||||||
int tabstop = ((flags & DT_TABSTOP) && dtp) ? dtp->iTabLength : 8;
|
int tabstop = ((flags & DT_TABSTOP) && dtp && dtp->iTabLength) ? dtp->iTabLength : 8;
|
||||||
tabwidth = tm.tmAveCharWidth * tabstop;
|
tabwidth = tm.tmAveCharWidth * tabstop;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -203,7 +203,7 @@ BOOL
|
||||||
WINAPI
|
WINAPI
|
||||||
CharToOemA(LPCSTR s, LPSTR d)
|
CharToOemA(LPCSTR s, LPSTR d)
|
||||||
{
|
{
|
||||||
if (!s || !d) return TRUE;
|
if (!s || !d) return FALSE;
|
||||||
return CharToOemBuffA(s, d, strlen(s) + 1);
|
return CharToOemBuffA(s, d, strlen(s) + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -216,6 +216,8 @@ CharToOemBuffA(LPCSTR s, LPSTR d, DWORD len)
|
||||||
{
|
{
|
||||||
WCHAR* bufW;
|
WCHAR* bufW;
|
||||||
|
|
||||||
|
if ( !s || !d ) return FALSE;
|
||||||
|
|
||||||
bufW = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
|
bufW = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
|
||||||
if (bufW) {
|
if (bufW) {
|
||||||
MultiByteToWideChar(CP_ACP, 0, s, len, bufW, len);
|
MultiByteToWideChar(CP_ACP, 0, s, len, bufW, len);
|
||||||
|
@ -233,7 +235,7 @@ WINAPI
|
||||||
CharToOemBuffW(LPCWSTR s, LPSTR d, DWORD len)
|
CharToOemBuffW(LPCWSTR s, LPSTR d, DWORD len)
|
||||||
{
|
{
|
||||||
if (!s || !d)
|
if (!s || !d)
|
||||||
return TRUE;
|
return FALSE;
|
||||||
WideCharToMultiByte(CP_OEMCP, 0, s, len, d, len, NULL, NULL);
|
WideCharToMultiByte(CP_OEMCP, 0, s, len, d, len, NULL, NULL);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@ -245,6 +247,7 @@ BOOL
|
||||||
WINAPI
|
WINAPI
|
||||||
CharToOemW(LPCWSTR s, LPSTR d)
|
CharToOemW(LPCWSTR s, LPSTR d)
|
||||||
{
|
{
|
||||||
|
if ( !s || !d ) return FALSE;
|
||||||
return CharToOemBuffW(s, d, wcslen(s) + 1);
|
return CharToOemBuffW(s, d, wcslen(s) + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -420,6 +423,7 @@ BOOL
|
||||||
WINAPI
|
WINAPI
|
||||||
OemToCharA(LPCSTR s, LPSTR d)
|
OemToCharA(LPCSTR s, LPSTR d)
|
||||||
{
|
{
|
||||||
|
if ( !s || !d ) return FALSE;
|
||||||
return OemToCharBuffA(s, d, strlen(s) + 1);
|
return OemToCharBuffA(s, d, strlen(s) + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -430,6 +434,8 @@ BOOL WINAPI OemToCharBuffA(LPCSTR s, LPSTR d, DWORD len)
|
||||||
{
|
{
|
||||||
WCHAR* bufW;
|
WCHAR* bufW;
|
||||||
|
|
||||||
|
if ( !s || !d ) return FALSE;
|
||||||
|
|
||||||
bufW = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
|
bufW = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
|
||||||
if (bufW) {
|
if (bufW) {
|
||||||
MultiByteToWideChar(CP_OEMCP, 0, s, len, bufW, len);
|
MultiByteToWideChar(CP_OEMCP, 0, s, len, bufW, len);
|
||||||
|
@ -446,6 +452,7 @@ BOOL
|
||||||
WINAPI
|
WINAPI
|
||||||
OemToCharBuffW(LPCSTR s, LPWSTR d, DWORD len)
|
OemToCharBuffW(LPCSTR s, LPWSTR d, DWORD len)
|
||||||
{
|
{
|
||||||
|
if ( !s || !d ) return FALSE;
|
||||||
MultiByteToWideChar(CP_OEMCP, 0, s, len, d, len);
|
MultiByteToWideChar(CP_OEMCP, 0, s, len, d, len);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@ -455,6 +462,7 @@ OemToCharBuffW(LPCSTR s, LPWSTR d, DWORD len)
|
||||||
*/
|
*/
|
||||||
BOOL WINAPI OemToCharW(LPCSTR s, LPWSTR d)
|
BOOL WINAPI OemToCharW(LPCSTR s, LPWSTR d)
|
||||||
{
|
{
|
||||||
|
if ( !s || !d ) return FALSE;
|
||||||
return OemToCharBuffW(s, d, strlen(s) + 1);
|
return OemToCharBuffW(s, d, strlen(s) + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue