This commit is contained in:
jimtabor 2019-12-09 11:19:18 -06:00
commit d447b41198
2 changed files with 8 additions and 16 deletions

View file

@ -23,7 +23,7 @@ static const WCHAR u9580[] = { 0x9580, 0 }; /* 門 */
static const WCHAR ideograph_space = (WCHAR)0x3000; /* fullwidth space */
static LCID lcidJapanese = MAKELCID(MAKELANGID(LANG_JAPANESE, SUBLANG_DEFAULT), SORT_DEFAULT);
static LCID lcidRussian = MAKELCID(MAKELANGID(LANG_RUSSIAN , SUBLANG_DEFAULT), SORT_DEFAULT);
static BOOL s_bIsVistaPlus;
static BOOL s_bIs8Plus;
static BOOL IsCJKCodePage(void)
{
@ -411,7 +411,7 @@ static void test_cp932(HANDLE hConOut)
c.X = c.Y = 0;
ret = FillConsoleOutputCharacterW(hConOut, ideograph_space, csbi.dwSize.X * csbi.dwSize.Y, c, &len);
ok(ret, "FillConsoleOutputCharacterW failed\n");
if (s_bIsVistaPlus)
if (s_bIs8Plus)
ok(len == csbi.dwSize.X * csbi.dwSize.Y / 2, "len was: %ld\n", len);
else
ok(len == csbi.dwSize.X * csbi.dwSize.Y, "len was: %ld\n", len);
@ -454,7 +454,7 @@ static void test_cp932(HANDLE hConOut)
c.X = c.Y = 0;
ret = ReadConsoleOutputCharacterW(hConOut, str, 3 * sizeof(WCHAR), c, &len);
ok(ret, "ReadConsoleOutputCharacterW failed\n");
if (s_bIsVistaPlus)
if (s_bIs8Plus)
{
ok(len == 3, "len was: %ld\n", len);
ok(str[0] == 0x3000, "str[0] was: 0x%04X\n", str[0]);
@ -479,8 +479,10 @@ START_TEST(ConsoleCP)
HANDLE hConIn, hConOut;
OSVERSIONINFOA osver = { sizeof(osver) };
// https://github.com/reactos/reactos/pull/2131#issuecomment-563189380
GetVersionExA(&osver);
s_bIsVistaPlus = (osver.dwMajorVersion >= 6);
s_bIs8Plus = (osver.dwMajorVersion > 6) ||
(osver.dwMajorVersion == 6 && osver.dwMinorVersion >= 2);
FreeConsole();
ok(AllocConsole(), "Couldn't alloc console\n");

View file

@ -1263,18 +1263,8 @@ INT WINAPI DrawTextExWorker( HDC hdc,
if (flags & DT_SINGLELINE)
{
#ifdef __REACTOS__
if (flags & DT_VCENTER)
{
if (flags & DT_CALCRECT)
{
if (rect->bottom - rect->top < size.cy / 2)
y = rect->top + (invert_y ? size.cy : -size.cy) / 2;
}
else
{
y = rect->top + (rect->bottom - rect->top + (invert_y ? size.cy : -size.cy)) / 2;
}
}
if (flags & DT_VCENTER) y = rect->top +
(rect->bottom - rect->top + (invert_y ? size.cy : -size.cy)) / 2;
else if (flags & DT_BOTTOM)
y = rect->bottom + (invert_y ? 0 : -size.cy);
#else