notepad: Use int for point size value.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2020-05-13 18:36:46 +02:00 committed by Alexandre Julliard
parent 7b6f6257bc
commit 312ea8e72c
1 changed files with 4 additions and 3 deletions

View File

@ -215,7 +215,8 @@ static VOID NOTEPAD_LoadSettingFromRegistry(void)
if(RegOpenKeyW(HKEY_CURRENT_USER, notepad_reg_key, &hkey) == ERROR_SUCCESS) if(RegOpenKeyW(HKEY_CURRENT_USER, notepad_reg_key, &hkey) == ERROR_SUCCESS)
{ {
WORD data_helper[MAX_PATH]; WORD data_helper[MAX_PATH];
DWORD type, data, size; DWORD type, size;
int point_size;
#define QUERY_NOTEPAD_REG(hkey, value_name, ret) do { DWORD type, data; DWORD size = sizeof(DWORD); if(RegQueryValueExW(hkey, value_name, 0, &type, (LPBYTE)&data, &size) == ERROR_SUCCESS) if(type == REG_DWORD) ret = data; } while(0) #define QUERY_NOTEPAD_REG(hkey, value_name, ret) do { DWORD type, data; DWORD size = sizeof(DWORD); if(RegQueryValueExW(hkey, value_name, 0, &type, (LPBYTE)&data, &size) == ERROR_SUCCESS) if(type == REG_DWORD) ret = data; } while(0)
QUERY_NOTEPAD_REG(hkey, value_fWrap, Globals.bWrapLongLines); QUERY_NOTEPAD_REG(hkey, value_fWrap, Globals.bWrapLongLines);
@ -244,10 +245,10 @@ static VOID NOTEPAD_LoadSettingFromRegistry(void)
main_rect.bottom = main_rect.top + dy; main_rect.bottom = main_rect.top + dy;
size = sizeof(DWORD); size = sizeof(DWORD);
if(RegQueryValueExW(hkey, value_iPointSize, 0, &type, (LPBYTE)&data, &size) == ERROR_SUCCESS) if(RegQueryValueExW(hkey, value_iPointSize, 0, &type, (LPBYTE)&point_size, &size) == ERROR_SUCCESS)
if(type == REG_DWORD) if(type == REG_DWORD)
/* The value is stored as 10 * twips */ /* The value is stored as 10 * twips */
Globals.lfFont.lfHeight = -MulDiv(abs(data), get_dpi(), 720); Globals.lfFont.lfHeight = -MulDiv(abs(point_size), get_dpi(), 720);
size = sizeof(Globals.lfFont.lfFaceName); size = sizeof(Globals.lfFont.lfFaceName);
if(RegQueryValueExW(hkey, value_lfFaceName, 0, &type, (LPBYTE)&data_helper, &size) == ERROR_SUCCESS) if(RegQueryValueExW(hkey, value_lfFaceName, 0, &type, (LPBYTE)&data_helper, &size) == ERROR_SUCCESS)