Use the lfHeight field to initialize the font dialog's point size. Do
authorRein Klazes <rklazes@xs4all.nl>
Thu, 4 Dec 2003 01:43:01 +0000 (01:43 +0000)
committerAlexandre Julliard <julliard@winehq.org>
Thu, 4 Dec 2003 01:43:01 +0000 (01:43 +0000)
not forget to return some values in the choosefont structure in the 16
bit version of the ChooseFont function.

dlls/commdlg/fontdlg.c
dlls/commdlg/fontdlg16.c

index 297d2a255783dc54163ecb2f57c56afc7db0831b..d63259cc4f412bc0b93b8d821191d0b6ce59200b 100644 (file)
@@ -615,7 +615,7 @@ static INT CFn_FitFontStyle( HWND hDlg, LONG packedstyle )
 static INT CFn_FitCharSet( HWND hDlg, int charset )
 {
     int i,n,cs;
-    /* look for fitting har set in combobox5 */
+    /* look for fitting char set in combobox5 */
     n=SendDlgItemMessageA(hDlg, cmb5, CB_GETCOUNT, 0, 0);
     for (i=0;i<n;i++)
     {
@@ -737,9 +737,11 @@ LRESULT CFn_WMInitDialog(HWND hDlg, WPARAM wParam, LPARAM lParam,
             j=SendDlgItemMessageA(hDlg,cmb1,CB_FINDSTRING,-1,(LONG)lpxx->lfFaceName);
             if (j!=CB_ERR)
             {
-                INT height = (lpcf->iPointSize + 5) / 10;
+                INT height = lpxx->lfHeight < 0 ? -lpxx->lfHeight :
+                    lpxx->lfHeight;
                 int charset = lpxx->lfCharSet;
-                pstyle=MAKELONG(lpxx->lfWeight > FW_MEDIUM ? FW_BOLD:FW_NORMAL,lpxx->lfItalic !=0);
+                pstyle = MAKELONG(lpxx->lfWeight > FW_MEDIUM ? FW_BOLD:
+                        FW_NORMAL,lpxx->lfItalic !=0);
                 SendDlgItemMessageA(hDlg, cmb1, CB_SETCURSEL, j, 0);
                 SendMessageA(hDlg, WM_COMMAND, MAKEWPARAM(cmb1, CBN_SELCHANGE),
                         (LPARAM)GetDlgItem(hDlg,cmb1));
index cf334436d34abf66fb5651c9200ca02b79d946b6..289f5e76d613e8325513bd320ea4a8fc2d92b6d2 100644 (file)
@@ -227,6 +227,11 @@ BOOL16 WINAPI ChooseFont16(LPCHOOSEFONT16 lpChFont)
     }
     lpChFont->lpTemplateName=lpTemplateName;
 
+    lpChFont->iPointSize = cf32a.iPointSize;
+    lpChFont->Flags = cf32a.Flags;
+    lpChFont->rgbColors = cf32a.rgbColors;
+    lpChFont->lCustData = cf32a.lCustData;
+    lpChFont->nFontType = cf32a.nFontType;
 
     font16 = MapSL(lpChFont->lpLogFont);
     font16->lfHeight = cf32a.lpLogFont->lfHeight;