Akihiro Sagawa : comdlg32: Set DEFAULT_CHARSET if CF_NOSCRIPTSEL is set.

Alexandre Julliard julliard at winehq.org
Mon Jan 25 16:42:06 CST 2021


Module: wine
Branch: master
Commit: 89ded8c8e145d9d1010078c17c44a2f5e5df1010
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=89ded8c8e145d9d1010078c17c44a2f5e5df1010

Author: Akihiro Sagawa <sagawa.aki at gmail.com>
Date:   Sat Jan 23 00:28:14 2021 +0900

comdlg32: Set DEFAULT_CHARSET if CF_NOSCRIPTSEL is set.

Signed-off-by: Akihiro Sagawa <sagawa.aki at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/comdlg32/fontdlg.c       | 13 +++++++++----
 dlls/comdlg32/tests/fontdlg.c |  2 +-
 2 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/dlls/comdlg32/fontdlg.c b/dlls/comdlg32/fontdlg.c
index a518c78fb17..e2c8eb2b3ad 100644
--- a/dlls/comdlg32/fontdlg.c
+++ b/dlls/comdlg32/fontdlg.c
@@ -1032,11 +1032,16 @@ static LRESULT CFn_WMCommand(HWND hDlg, WPARAM wParam, LPARAM lParam, LPCHOOSEFO
             get_dialog_font_point_size(hDlg, lpcf);
 
             /* charset */
-            i=SendDlgItemMessageW(hDlg, cmb5, CB_GETCURSEL, 0, 0);
-            if (i!=CB_ERR)
-                lpxx->lfCharSet=SendDlgItemMessageW(hDlg, cmb5, CB_GETITEMDATA, i, 0);
-            else
+            if (lpcf->Flags & CF_NOSCRIPTSEL)
                 lpxx->lfCharSet = DEFAULT_CHARSET;
+            else
+            {
+                i=SendDlgItemMessageW(hDlg, cmb5, CB_GETCURSEL, 0, 0);
+                if (i!=CB_ERR)
+                    lpxx->lfCharSet=SendDlgItemMessageW(hDlg, cmb5, CB_GETITEMDATA, i, 0);
+                else
+                    lpxx->lfCharSet = DEFAULT_CHARSET;
+            }
             lpxx->lfStrikeOut=IsDlgButtonChecked(hDlg,chx1);
             lpxx->lfUnderline=IsDlgButtonChecked(hDlg,chx2);
             lpxx->lfWidth=lpxx->lfOrientation=lpxx->lfEscapement=0;
diff --git a/dlls/comdlg32/tests/fontdlg.c b/dlls/comdlg32/tests/fontdlg.c
index e8f184c4ed8..2836ba1e9ef 100644
--- a/dlls/comdlg32/tests/fontdlg.c
+++ b/dlls/comdlg32/tests/fontdlg.c
@@ -116,7 +116,7 @@ static void test_ChooseFontA(void)
     cfa.Flags = CF_ENABLEHOOK|CF_INITTOLOGFONTSTRUCT|CF_SCREENFONTS|CF_NOSCRIPTSEL;
     ret = ChooseFontA(&cfa);
     ok(ret == TRUE, "ChooseFontA returned FALSE\n");
-    todo_wine ok(lfa.lfCharSet == DEFAULT_CHARSET, "Expected DEFAULT_CHARSET, got %i\n", lfa.lfCharSet);
+    ok(lfa.lfCharSet == DEFAULT_CHARSET, "Expected DEFAULT_CHARSET, got %i\n", lfa.lfCharSet);
 
     printer_ic = get_printer_ic();
     if (!printer_ic)




More information about the wine-cvs mailing list