[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:
James Tabor 2016-07-12 20:06:30 +00:00
parent d9af32368a
commit 45799931c9
2 changed files with 11 additions and 3 deletions

View file

@ -1189,7 +1189,7 @@ INT WINAPI DrawTextExWorker( HDC hdc,
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;
}

View file

@ -203,7 +203,7 @@ BOOL
WINAPI
CharToOemA(LPCSTR s, LPSTR d)
{
if (!s || !d) return TRUE;
if (!s || !d) return FALSE;
return CharToOemBuffA(s, d, strlen(s) + 1);
}
@ -216,6 +216,8 @@ CharToOemBuffA(LPCSTR s, LPSTR d, DWORD len)
{
WCHAR* bufW;
if ( !s || !d ) return FALSE;
bufW = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
if (bufW) {
MultiByteToWideChar(CP_ACP, 0, s, len, bufW, len);
@ -233,7 +235,7 @@ WINAPI
CharToOemBuffW(LPCWSTR s, LPSTR d, DWORD len)
{
if (!s || !d)
return TRUE;
return FALSE;
WideCharToMultiByte(CP_OEMCP, 0, s, len, d, len, NULL, NULL);
return TRUE;
}
@ -245,6 +247,7 @@ BOOL
WINAPI
CharToOemW(LPCWSTR s, LPSTR d)
{
if ( !s || !d ) return FALSE;
return CharToOemBuffW(s, d, wcslen(s) + 1);
}
@ -420,6 +423,7 @@ BOOL
WINAPI
OemToCharA(LPCSTR s, LPSTR d)
{
if ( !s || !d ) return FALSE;
return OemToCharBuffA(s, d, strlen(s) + 1);
}
@ -430,6 +434,8 @@ BOOL WINAPI OemToCharBuffA(LPCSTR s, LPSTR d, DWORD len)
{
WCHAR* bufW;
if ( !s || !d ) return FALSE;
bufW = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
if (bufW) {
MultiByteToWideChar(CP_OEMCP, 0, s, len, bufW, len);
@ -446,6 +452,7 @@ BOOL
WINAPI
OemToCharBuffW(LPCSTR s, LPWSTR d, DWORD len)
{
if ( !s || !d ) return FALSE;
MultiByteToWideChar(CP_OEMCP, 0, s, len, d, len);
return TRUE;
}
@ -455,6 +462,7 @@ OemToCharBuffW(LPCSTR s, LPWSTR d, DWORD len)
*/
BOOL WINAPI OemToCharW(LPCSTR s, LPWSTR d)
{
if ( !s || !d ) return FALSE;
return OemToCharBuffW(s, d, strlen(s) + 1);
}