From 373fb8c25ca6e601c8b09a19ca65e256802b2120 Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Fri, 26 Dec 2014 11:02:47 +0000 Subject: [PATCH] [CHARMAP] Fix the following issues: - Skip rotated font (font name starting with "@" char) - Fix a comment (misspelled "Richedit") - Fix enlarged preview font in font name is long (it truncated font name in 31 chars when copying) - Fix 2 magic values (255 here is not meaningful, and it doesn't even entirely showing Unicode Plane 0) Patch by Roy Tam. CORE-8966 #resolve #comment Thanks. Commited in r65829. svn path=/trunk/; revision=65829 --- reactos/base/applications/charmap/charmap.c | 5 ++++- reactos/base/applications/charmap/lrgcell.c | 2 +- reactos/base/applications/charmap/map.c | 6 ++++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/reactos/base/applications/charmap/charmap.c b/reactos/base/applications/charmap/charmap.c index 0fc2fd068ef..25d922cb36f 100644 --- a/reactos/base/applications/charmap/charmap.c +++ b/reactos/base/applications/charmap/charmap.c @@ -34,6 +34,9 @@ EnumFontNames(ENUMLOGFONTEXW *lpelfe, HWND hwndCombo = (HWND)lParam; LPWSTR pszName = lpelfe->elfLogFont.lfFaceName; + /* Skip rotated font */ + if(pszName[0] == L'@') return 1; + /* make sure font doesn't already exist in our list */ if(SendMessageW(hwndCombo, CB_FINDSTRINGEXACT, @@ -321,7 +324,7 @@ CharMapDlgProc(HWND hDlg, ChangeMapFont(hDlg); - // Configure Richedi control for sending notification changes. + // Configure Richedit control for sending notification changes. evMask = SendDlgItemMessage(hDlg, IDC_TEXTBOX, EM_GETEVENTMASK, 0, 0); evMask |= ENM_CHANGE; SendDlgItemMessage(hDlg, IDC_TEXTBOX, EM_SETEVENTMASK, 0, (LPARAM)evMask); diff --git a/reactos/base/applications/charmap/lrgcell.c b/reactos/base/applications/charmap/lrgcell.c index fe086b2e50b..db68df6992b 100644 --- a/reactos/base/applications/charmap/lrgcell.c +++ b/reactos/base/applications/charmap/lrgcell.c @@ -35,7 +35,7 @@ SetLrgFont(PMAP infoPtr) { SendMessageW(hCombo, WM_GETTEXT, - 31, + Len + 1, (LPARAM)lpFontName); ZeroMemory(&lf, diff --git a/reactos/base/applications/charmap/map.c b/reactos/base/applications/charmap/map.c index cd8ee8e4b88..b47dab36c40 100644 --- a/reactos/base/applications/charmap/map.c +++ b/reactos/base/applications/charmap/map.c @@ -14,6 +14,8 @@ static const WCHAR szMapWndClass[] = L"FontMapWnd"; static const WCHAR szLrgCellWndClass[] = L"LrgCellWnd"; +#define MAX_ROWS (0xFFFF / XCELLS) + 1 - YCELLS + static VOID TagFontToCell(PCELL pCell, @@ -377,7 +379,7 @@ OnCreate(PMAP infoPtr, SetGrid(infoPtr); - SetScrollRange(hwnd, SB_VERT, 0, 255, FALSE); + SetScrollRange(hwnd, SB_VERT, 0, MAX_ROWS, FALSE); SetScrollPos(hwnd, SB_VERT, 0, TRUE); Ret = TRUE; @@ -423,7 +425,7 @@ OnVScroll(PMAP infoPtr, } infoPtr->iYStart = max(0, - min(infoPtr->iYStart, 255*16)); + min(infoPtr->iYStart, MAX_ROWS)); iYDiff = iOldYStart - infoPtr->iYStart; if (iYDiff)