[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
This commit is contained in:
Pierre Schweitzer 2014-12-26 11:02:47 +00:00
parent 51cd3cccb9
commit 373fb8c25c
3 changed files with 9 additions and 4 deletions

View file

@ -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);

View file

@ -35,7 +35,7 @@ SetLrgFont(PMAP infoPtr)
{
SendMessageW(hCombo,
WM_GETTEXT,
31,
Len + 1,
(LPARAM)lpFontName);
ZeroMemory(&lf,

View file

@ -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)