From 7cc76d8afc2810b32d289143e2ec488bba49e4f9 Mon Sep 17 00:00:00 2001 From: Katayama Hirofumi MZ Date: Mon, 9 Dec 2019 20:55:13 +0900 Subject: [PATCH 1/2] [KERNEL32_APITEST] Follow-up of #2131 --- modules/rostests/apitests/kernel32/ConsoleCP.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/modules/rostests/apitests/kernel32/ConsoleCP.c b/modules/rostests/apitests/kernel32/ConsoleCP.c index 94fcdd3c8a0..3a381977ed4 100644 --- a/modules/rostests/apitests/kernel32/ConsoleCP.c +++ b/modules/rostests/apitests/kernel32/ConsoleCP.c @@ -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"); From e329e83857db0db67c6798c538ad658be044057e Mon Sep 17 00:00:00 2001 From: Katayama Hirofumi MZ Date: Mon, 9 Dec 2019 21:16:28 +0900 Subject: [PATCH 2/2] [WIN32SS][COMCTL32] Improve button text position (#2135) Improve DrawText function especially DT_CALCRECT and DT_VCENTER. CORE-15478 --- win32ss/user/rtl/text.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/win32ss/user/rtl/text.c b/win32ss/user/rtl/text.c index 7670e2e5956..8963b0d0831 100644 --- a/win32ss/user/rtl/text.c +++ b/win32ss/user/rtl/text.c @@ -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