Sync to Wine-0_9_2:
authorGé van Geldorp <ge@gse.nl>
Sat, 26 Nov 2005 10:18:02 +0000 (10:18 +0000)
committerGé van Geldorp <ge@gse.nl>
Sat, 26 Nov 2005 10:18:02 +0000 (10:18 +0000)
Rein Klazes <wijn@wanadoo.nl>
- Fixes for FormatCharDlgProc16:
- properly store the ChooseFont pointer, use a window property as the
  A and W functions do;
- handle other messages then WM_INITDIALOG and WM_MEASUREITEM as well.
- In CFn_CHOOSEFONT16to32W fix the conversion of the lpTemplateName and
  the lpszStyle fields.
Francois Gouget <fgouget@free.fr>
- Remove spaces before '\n' in traces.
Dmitry Timoshkov <dmitry@codeweavers.com>
- There is no need to resize our own fake dialog to match the parent, it
  doesn't have controls anyway.
Markus Amsler <markus.amsler@oribi.org>
- Improve c2man Documented-Total count. Changes:
- add missing description
- complete missing A/W pairs
- document remaining comdlg32 functions

svn path=/trunk/; revision=19622

reactos/lib/comdlg32/cdlg_Ko.rc
reactos/lib/comdlg32/filedlg.c
reactos/lib/comdlg32/fontdlg16.c

index c681c86..81e25bc 100644 (file)
@@ -1,5 +1,6 @@
 /*
  * Copyright 1996 Bang Jun Young
 /*
  * Copyright 1996 Bang Jun Young
+ * Copyright 2005 YunSong Hwang
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -85,7 +86,7 @@ FONT 9, "MS Shell Dlg"
  LTEXT "Àμâ Ç°Áú(&Q):", 1092, 6, 100, 76, 9
  COMBOBOX 1136, 80, 100, 92, 68, CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_BORDER | WS_VSCROLL | WS_TABSTOP
  CHECKBOX "ÆÄÀϷΠÀμâ(&L)", 1040, 20, 100, 50, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP
  LTEXT "Àμâ Ç°Áú(&Q):", 1092, 6, 100, 76, 9
  COMBOBOX 1136, 80, 100, 92, 68, CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_BORDER | WS_VSCROLL | WS_TABSTOP
  CHECKBOX "ÆÄÀϷΠÀμâ(&L)", 1040, 20, 100, 50, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP
- CHECKBOX "Condensed", 1041, 160, 100, 50, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP
+ CHECKBOX " ÆøÀÌ Á¼Àº", 1041, 160, 100, 50, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP
 }
 
 
 }
 
 
@@ -117,76 +118,76 @@ FONT 9, "MS Shell Dlg"
 PRINT32 DIALOG LOADONCALL MOVEABLE DISCARDABLE  32, 32, 288, 186
 STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU |
       DS_CONTEXTHELP | DS_3DLOOK
 PRINT32 DIALOG LOADONCALL MOVEABLE DISCARDABLE  32, 32, 288, 186
 STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU |
       DS_CONTEXTHELP | DS_3DLOOK
-CAPTION "Print"
+CAPTION "Àμâ"
 FONT 9, "MS Shell Dlg"
 {
 FONT 9, "MS Shell Dlg"
 {
-    DEFPUSHBUTTON   "OK",     IDOK,     180,164, 48,14, WS_GROUP | BS_DEFPUSHBUTTON
-    PUSHBUTTON      "Cancel", IDCANCEL, 232,164, 48,14, WS_GROUP
-    PUSHBUTTON      "&Help",  pshHelp,  50, 161, 48,14, WS_GROUP
+    DEFPUSHBUTTON   "È®ÀÎ",     IDOK,     180,164, 48,14, WS_GROUP | BS_DEFPUSHBUTTON
+    PUSHBUTTON      "Ãë¼Ò", IDCANCEL, 232,164, 48,14, WS_GROUP
+    PUSHBUTTON      "µµ¿ò¸»(&H)",  pshHelp,  50, 161, 48,14, WS_GROUP
 
 
-    GROUPBOX        "Printer",        grp4,   8,  4, 272,84, WS_GROUP
-    CONTROL         "Print to fi&le", chx1, "Button",BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP,212,70,64,12
-    PUSHBUTTON      "&Properties",    psh2, 212, 17,  60,14, WS_GROUP
-    LTEXT           "&Name:",         stc6,  16, 20,  36,8
+    GROUPBOX        "ÇÁ¸°ÅÍ",        grp4,   8,  4, 272,84, WS_GROUP
+    CONTROL         "ÆÄÀϷΠÀμâ(&l)", chx1, "Button",BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP,212,70,64,12
+    PUSHBUTTON      "¼Ó¼º(&P)",    psh2, 212, 17,  60,14, WS_GROUP
+    LTEXT           "À̸§(&N):",         stc6,  16, 20,  36,8
     COMBOBOX                          cmb4,  52, 18, 152,152,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_GROUP | WS_TABSTOP
     COMBOBOX                          cmb4,  52, 18, 152,152,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_GROUP | WS_TABSTOP
-    LTEXT           "Status:",        stc8,  16, 36,  36,10, SS_NOPREFIX
-    LTEXT           "Dummy State",    stc12, 52, 36, 224,10, SS_NOPREFIX | SS_LEFTNOWORDWRAP
-    LTEXT           "Type:",          stc7,  16, 48,  36,10, SS_NOPREFIX
-    LTEXT           "Dummy Type",     stc11, 52, 48, 224,10, SS_NOPREFIX | SS_LEFTNOWORDWRAP
-    LTEXT           "Where:",         stc10, 16, 60,  36,10, SS_NOPREFIX
-    LTEXT           "Dummy Location", stc14, 52, 60, 224,10, SS_NOPREFIX | SS_LEFTNOWORDWRAP
-    LTEXT           "Comment:",       stc9,  16, 72,  36,10, SS_NOPREFIX
-    LTEXT           "Dummy Remark",   stc13, 52, 72, 152,10, SS_NOPREFIX | SS_LEFTNOWORDWRAP
+    LTEXT           "»óÅÂ:",        stc8,  16, 36,  36,10, SS_NOPREFIX
+    LTEXT           "´õ¹Ì »óÅÂ",    stc12, 52, 36, 224,10, SS_NOPREFIX | SS_LEFTNOWORDWRAP
+    LTEXT           "ŸÀÔ:",          stc7,  16, 48,  36,10, SS_NOPREFIX
+    LTEXT           "´õ¹Ì Å¸ÀÔ",     stc11, 52, 48, 224,10, SS_NOPREFIX | SS_LEFTNOWORDWRAP
+    LTEXT           "¾îµð?:",         stc10, 16, 60,  36,10, SS_NOPREFIX
+    LTEXT           "´õ¹Ì À§Ä¡", stc14, 52, 60, 224,10, SS_NOPREFIX | SS_LEFTNOWORDWRAP
+    LTEXT           "¼³¸í:",       stc9,  16, 72,  36,10, SS_NOPREFIX
+    LTEXT           "´õ¹Ì ¼³¸í",   stc13, 52, 72, 152,10, SS_NOPREFIX | SS_LEFTNOWORDWRAP
 
 
-    GROUPBOX        "Copies",         grp2, 160, 92, 120,64, WS_GROUP
-    LTEXT           "Number of &copies:",stc5,168,108,68,8
+    GROUPBOX        "º¹»çº»",         grp2, 160, 92, 120,64, WS_GROUP
+    LTEXT           "º¹»çº» °¹¼ö(&c):",stc5,168,108,68,8
     ICON            "",               ico3, 162,124,  76,24, WS_GROUP | SS_CENTERIMAGE
     ICON            "",               ico3, 162,124,  76,24, WS_GROUP | SS_CENTERIMAGE
-    CONTROL         "C&ollate",       chx2,"Button",BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP,240,130,36,12
+    CONTROL         "ÇÕÄ¡±â(&o)",       chx2,"Button",BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP,240,130,36,12
     EDITTEXT                          edt3, 240,106,  32,12, WS_GROUP | ES_NUMBER
 
     EDITTEXT                          edt3, 240,106,  32,12, WS_GROUP | ES_NUMBER
 
-    GROUPBOX        "Print range",    grp1,   8,92,  144,64, WS_GROUP
-    CONTROL         "&All",           rad1,"Button",BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,16,106,64,12
-    CONTROL         "Pa&ges",         rad3,"Button",BS_AUTORADIOBUTTON,16,122,36,12
-    CONTROL         "&Selection",     rad2,"Button",BS_AUTORADIOBUTTON,16,138,64,12
+    GROUPBOX        "Àμ⠹üÀ§",    grp1,   8,92,  144,64, WS_GROUP
+    CONTROL         "¸ðµÎ(&A)",           rad1,"Button",BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,16,106,64,12
+    CONTROL         "ÆäÀÌÁö(&g)",         rad3,"Button",BS_AUTORADIOBUTTON,16,122,36,12
+    CONTROL         "¼±Åÿµ¿ª(&S)",     rad2,"Button",BS_AUTORADIOBUTTON,16,138,64,12
     EDITTEXT                          edt1,  74,122,  26,12, WS_GROUP | ES_NUMBER
     EDITTEXT                          edt2, 118,122,  26,12, WS_GROUP | ES_NUMBER
     EDITTEXT                          edt1,  74,122,  26,12, WS_GROUP | ES_NUMBER
     EDITTEXT                          edt2, 118,122,  26,12, WS_GROUP | ES_NUMBER
-    RTEXT           "&from:",         stc2,  52,124,  20,8
-    RTEXT           "&to:",           stc3, 100,124,  16,8
+    RTEXT           "¿©±â¼­ºÎÅÍ(&f):",         stc2,  52,124,  20,8
+    RTEXT           "¿©±â±îÁö(&t):",           stc3, 100,124,  16,8
 }
 
 PRINT32_SETUP DIALOG LOADONCALL MOVEABLE DISCARDABLE  32, 32, 288, 178
 STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU |
       DS_CONTEXTHELP | DS_3DLOOK
 }
 
 PRINT32_SETUP DIALOG LOADONCALL MOVEABLE DISCARDABLE  32, 32, 288, 178
 STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU |
       DS_CONTEXTHELP | DS_3DLOOK
-CAPTION "Print Setup"
+CAPTION "Àμ⠼³Á¤"
 FONT 9, "MS Shell Dlg"
 BEGIN
 FONT 9, "MS Shell Dlg"
 BEGIN
-    DEFPUSHBUTTON   "OK",IDOK,180,156,48,14,WS_GROUP
-    PUSHBUTTON      "Cancel",IDCANCEL,232,156,48,14
-/*    PUSHBUTTON      "Network...", psh5, 284,156,48,14 */
+    DEFPUSHBUTTON   "È®ÀÎ",IDOK,180,156,48,14,WS_GROUP
+    PUSHBUTTON      "Ãë¼Ò",IDCANCEL,232,156,48,14
+/*    PUSHBUTTON      "³×Æ®¿öÅ©...", psh5, 284,156,48,14 */
 
 
-    GROUPBOX        "Printer",        grp4,   8,  4, 272,84, WS_GROUP
-    PUSHBUTTON      "&Properties",    psh2, 212, 17,  60,14, WS_GROUP
-    LTEXT           "&Name:",         stc6,  16, 20,  36,8
+    GROUPBOX        "ÇÁ¸°ÅÍ",        grp4,   8,  4, 272,84, WS_GROUP
+    PUSHBUTTON      "¼Ó¼º(&P)",    psh2, 212, 17,  60,14, WS_GROUP
+    LTEXT           "À̸§(&N):",         stc6,  16, 20,  36,8
     COMBOBOX                          cmb1,  52, 18, 152,152,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_GROUP | WS_TABSTOP
     COMBOBOX                          cmb1,  52, 18, 152,152,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_GROUP | WS_TABSTOP
-    LTEXT           "Status:",        stc8,  16, 36,  36,10, SS_NOPREFIX
-    LTEXT           "Dummy State",    stc12, 52, 36, 224,10, SS_NOPREFIX | SS_LEFTNOWORDWRAP
-    LTEXT           "Type:",          stc7,  16, 48,  36,10, SS_NOPREFIX
-    LTEXT           "Dummy Type",     stc11, 52, 48, 224,10, SS_NOPREFIX | SS_LEFTNOWORDWRAP
-    LTEXT           "Where:",         stc10, 16, 60,  36,10, SS_NOPREFIX
-    LTEXT           "Dummy Location", stc14, 52, 60, 224,10, SS_NOPREFIX | SS_LEFTNOWORDWRAP
-    LTEXT           "Comment:",       stc9,  16, 72,  36,10, SS_NOPREFIX
-    LTEXT           "Dummy Remark",   stc13, 52, 72, 224,10, SS_NOPREFIX | SS_LEFTNOWORDWRAP
+    LTEXT           "»óÅÂ:",        stc8,  16, 36,  36,10, SS_NOPREFIX
+    LTEXT           "´õºñ »óÅÂ",    stc12, 52, 36, 224,10, SS_NOPREFIX | SS_LEFTNOWORDWRAP
+    LTEXT           "ŸÀÔ:",          stc7,  16, 48,  36,10, SS_NOPREFIX
+    LTEXT           "´õ¹Ì Å¸ÀÔ",     stc11, 52, 48, 224,10, SS_NOPREFIX | SS_LEFTNOWORDWRAP
+    LTEXT           "¾îµð?:",         stc10, 16, 60,  36,10, SS_NOPREFIX
+    LTEXT           "´õ¹Ì À§Ä¡", stc14, 52, 60, 224,10, SS_NOPREFIX | SS_LEFTNOWORDWRAP
+    LTEXT           "¼³¸í:",       stc9,  16, 72,  36,10, SS_NOPREFIX
+    LTEXT           "´õ¹Ì ¼³¸í",   stc13, 52, 72, 224,10, SS_NOPREFIX | SS_LEFTNOWORDWRAP
 
 
-    GROUPBOX        "Paper",          grp2,   8, 92, 164,56, WS_GROUP
-    LTEXT           "Si&ze:",         stc2,  16,108,  36, 8
+    GROUPBOX        "Á¾ÀÌ",          grp2,   8, 92, 164,56, WS_GROUP
+    LTEXT           "Å©±â(&z):",         stc2,  16,108,  36, 8
     COMBOBOX                          cmb2,  52,106, 112,112,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_GROUP | WS_TABSTOP
     COMBOBOX                          cmb2,  52,106, 112,112,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_GROUP | WS_TABSTOP
-    LTEXT           "&Source:",       stc3,  16,128,  36, 8
+    LTEXT           "¿øº»(&S):",       stc3,  16,128,  36, 8
     COMBOBOX                          cmb3,  52,126, 112,112,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_GROUP | WS_TABSTOP
 
     COMBOBOX                          cmb3,  52,126, 112,112,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_GROUP | WS_TABSTOP
 
-    GROUPBOX        "Orientation",    grp1, 180, 92, 100,56, WS_GROUP
+    GROUPBOX        "¹æÇâ",    grp1, 180, 92, 100,56, WS_GROUP
     ICON            "",               ico1, 195,112,  18,20, WS_GROUP
     ICON            "",               ico1, 195,112,  18,20, WS_GROUP
-    CONTROL         "P&ortrait",      rad1,"Button",BS_AUTORADIOBUTTON | WS_GROUP |WS_TABSTOP,224,106,52,12
-    CONTROL         "L&andscape",     rad2,"Button",BS_AUTORADIOBUTTON,224,126,52,12
+    CONTROL         "°¡·Î(&o)",      rad1,"Button",BS_AUTORADIOBUTTON | WS_GROUP |WS_TABSTOP,224,106,52,12
+    CONTROL         "¼¼·Î(&a)",     rad2,"Button",BS_AUTORADIOBUTTON,224,126,52,12
 END
 
 
 END
 
 
index b7bea6d..cbe6198 100644 (file)
@@ -283,7 +283,7 @@ static BOOL WINAPI GetFileName95(FileOpenDlgInfos *fodInfos)
     }
 
     /* Some shell namespace extensions depend on COM being initialized. */
     }
 
     /* Some shell namespace extensions depend on COM being initialized. */
-    hr = CoInitialize(NULL);
+    hr = OleInitialize(NULL);
 
     lRes = DialogBoxIndirectParamA(COMDLG32_hInstance,
                                   (LPDLGTEMPLATEA) template,
 
     lRes = DialogBoxIndirectParamA(COMDLG32_hInstance,
                                   (LPDLGTEMPLATEA) template,
@@ -291,7 +291,7 @@ static BOOL WINAPI GetFileName95(FileOpenDlgInfos *fodInfos)
                                   FileOpenDlgProc95,
                                   (LPARAM) fodInfos);
     if (SUCCEEDED(hr)) 
                                   FileOpenDlgProc95,
                                   (LPARAM) fodInfos);
     if (SUCCEEDED(hr)) 
-        CoUninitialize();
+        OleUninitialize();
 
     /* Unable to create the dialog */
     if( lRes == -1)
 
     /* Unable to create the dialog */
     if( lRes == -1)
@@ -701,10 +701,6 @@ static void ArrangeCtrlPositions(HWND hwndChildDlg, HWND hwndParentDlg, BOOL hid
     /* finally use fixed parent size */
     rectParent.bottom -= help_fixup;
 
     /* finally use fixed parent size */
     rectParent.bottom -= help_fixup;
 
-    /* save the size of the parent's client area */
-    rectChild.right = rectParent.right;
-    rectChild.bottom = rectParent.bottom;
-
     /* set the size of the parent dialog */
     AdjustWindowRectEx(&rectParent, GetWindowLongW(hwndParentDlg, GWL_STYLE),
                        FALSE, GetWindowLongW(hwndParentDlg, GWL_EXSTYLE));
     /* set the size of the parent dialog */
     AdjustWindowRectEx(&rectParent, GetWindowLongW(hwndParentDlg, GWL_STYLE),
                        FALSE, GetWindowLongW(hwndParentDlg, GWL_EXSTYLE));
@@ -713,10 +709,6 @@ static void ArrangeCtrlPositions(HWND hwndChildDlg, HWND hwndParentDlg, BOOL hid
                  rectParent.right - rectParent.left,
                  rectParent.bottom - rectParent.top,
                  SWP_NOMOVE | SWP_NOZORDER);
                  rectParent.right - rectParent.left,
                  rectParent.bottom - rectParent.top,
                  SWP_NOMOVE | SWP_NOZORDER);
-
-    /* set the size of the child dialog */
-    SetWindowPos(hwndChildDlg, HWND_BOTTOM,
-                 0, 0, rectChild.right, rectChild.bottom, SWP_NOACTIVATE);
 }
 
 static INT_PTR CALLBACK FileOpenDlgProcUserTemplate(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 }
 
 static INT_PTR CALLBACK FileOpenDlgProcUserTemplate(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
@@ -1032,9 +1024,29 @@ INT_PTR CALLBACK FileOpenDlgProc95(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM l
          FILEDLG95_InitControls(hwnd);
 
          if (fodInfos->DlgInfos.hwndCustomDlg)
          FILEDLG95_InitControls(hwnd);
 
          if (fodInfos->DlgInfos.hwndCustomDlg)
+         {
+             RECT rc;
+             UINT flags = SWP_NOACTIVATE;
+
              ArrangeCtrlPositions(fodInfos->DlgInfos.hwndCustomDlg, hwnd,
                  (fodInfos->ofnInfos->Flags & (OFN_HIDEREADONLY | OFN_SHOWHELP)) == OFN_HIDEREADONLY);
 
              ArrangeCtrlPositions(fodInfos->DlgInfos.hwndCustomDlg, hwnd,
                  (fodInfos->ofnInfos->Flags & (OFN_HIDEREADONLY | OFN_SHOWHELP)) == OFN_HIDEREADONLY);
 
+             /* resize the custom dialog to the parent size */
+             if (fodInfos->ofnInfos->Flags & (OFN_ENABLETEMPLATE | OFN_ENABLETEMPLATEHANDLE))
+                 GetClientRect(hwnd, &rc);
+             else
+             {
+                 /* our own fake template is zero sized and doesn't have
+                  * children, so there is no need to resize it.
+                  * Picasa depends on it.
+                  */
+                 flags |= SWP_NOSIZE;
+                 SetRectEmpty(&rc);
+             }
+             SetWindowPos(fodInfos->DlgInfos.hwndCustomDlg, HWND_BOTTOM,
+                          0, 0, rc.right, rc.bottom, flags);
+         }
+
         FILEDLG95_FillControls(hwnd, wParam, lParam);
 
          SendCustomDlgNotificationMessage(hwnd,CDN_INITDONE);
         FILEDLG95_FillControls(hwnd, wParam, lParam);
 
          SendCustomDlgNotificationMessage(hwnd,CDN_INITDONE);
@@ -3782,6 +3794,8 @@ BOOL WINAPI GetOpenFileNameA(
 {
     BOOL win16look = FALSE;
 
 {
     BOOL win16look = FALSE;
 
+    TRACE("flags %08lx\n", ofn->Flags);
+
     /* OFN_FILEMUSTEXIST implies OFN_PATHMUSTEXIST */
     if (ofn->Flags & OFN_FILEMUSTEXIST)
         ofn->Flags |= OFN_PATHMUSTEXIST;
     /* OFN_FILEMUSTEXIST implies OFN_PATHMUSTEXIST */
     if (ofn->Flags & OFN_FILEMUSTEXIST)
         ofn->Flags |= OFN_PATHMUSTEXIST;
@@ -3810,6 +3824,12 @@ BOOL WINAPI GetOpenFileNameW(
 {
     BOOL win16look = FALSE;
 
 {
     BOOL win16look = FALSE;
 
+    TRACE("flags %08lx\n", ofn->Flags);
+
+    /* OFN_FILEMUSTEXIST implies OFN_PATHMUSTEXIST */
+    if (ofn->Flags & OFN_FILEMUSTEXIST)
+        ofn->Flags |= OFN_PATHMUSTEXIST;
+
     if (ofn->Flags & (OFN_ALLOWMULTISELECT|OFN_ENABLEHOOK|OFN_ENABLETEMPLATE))
         win16look = (ofn->Flags & OFN_EXPLORER) ? FALSE : TRUE;
 
     if (ofn->Flags & (OFN_ALLOWMULTISELECT|OFN_ENABLEHOOK|OFN_ENABLETEMPLATE))
         win16look = (ofn->Flags & OFN_EXPLORER) ? FALSE : TRUE;
 
index d80e75c..b3883b4 100644 (file)
@@ -41,6 +41,9 @@ WINE_DEFAULT_DEBUG_CHANNEL(commdlg);
 #include "cdlg.h"
 #include "cdlg16.h"
 
 #include "cdlg.h"
 #include "cdlg16.h"
 
+static const WCHAR strWineFontData16[] =
+                               {'_','_','W','I','N','E','_','F','O','N','T','D','L','G','D','A','T','A','1','6',0};
+
 static void FONT_LogFont16To32W( const LPLOGFONT16 font16, LPLOGFONTW font32 )
 {
     font32->lfHeight = font16->lfHeight;
 static void FONT_LogFont16To32W( const LPLOGFONT16 font16, LPLOGFONTW font32 )
 {
     font32->lfHeight = font16->lfHeight;
@@ -58,7 +61,7 @@ static void FONT_LogFont16To32W( const LPLOGFONT16 font16, LPLOGFONTW font32 )
     font32->lfPitchAndFamily = font16->lfPitchAndFamily;
     MultiByteToWideChar(CP_ACP, 0, font16->lfFaceName,
                         LF_FACESIZE, font32->lfFaceName, LF_FACESIZE);
     font32->lfPitchAndFamily = font16->lfPitchAndFamily;
     MultiByteToWideChar(CP_ACP, 0, font16->lfFaceName,
                         LF_FACESIZE, font32->lfFaceName, LF_FACESIZE);
-};
+}
 
 static void FONT_Metrics16To32W( const TEXTMETRIC16 *pm16,
                                  NEWTEXTMETRICEXW *pnm32w)
 
 static void FONT_Metrics16To32W( const TEXTMETRIC16 *pm16,
                                  NEWTEXTMETRICEXW *pnm32w)
@@ -67,24 +70,23 @@ static void FONT_Metrics16To32W( const TEXTMETRIC16 *pm16,
     /* NOTE: only the fields used by AddFontStyle() are filled in */
     pnm32w->ntmTm.tmHeight = pm16->tmHeight;
     pnm32w->ntmTm.tmExternalLeading = pm16->tmExternalLeading;
     /* NOTE: only the fields used by AddFontStyle() are filled in */
     pnm32w->ntmTm.tmHeight = pm16->tmHeight;
     pnm32w->ntmTm.tmExternalLeading = pm16->tmExternalLeading;
-};
+}
 
 static void CFn_CHOOSEFONT16to32W(LPCHOOSEFONT16 chf16, LPCHOOSEFONTW chf32w)
 {
   int len;
 
 static void CFn_CHOOSEFONT16to32W(LPCHOOSEFONT16 chf16, LPCHOOSEFONTW chf32w)
 {
   int len;
-  if(chf16->lpTemplateName)
+  if (chf16->Flags & CF_ENABLETEMPLATE)
   {
   {
-    len = MultiByteToWideChar(CP_ACP, 0, (LPCSTR)chf16->lpTemplateName, -1, NULL, 0);
-    chf32w->lpTemplateName = HeapAlloc(GetProcessHeap(), 0,len*sizeof(WCHAR));
-    MultiByteToWideChar(CP_ACP, 0, (LPSTR)MapSL(chf16->lpTemplateName),
-                        -1, (LPWSTR)chf32w->lpTemplateName, len);
+      len = MultiByteToWideChar( CP_ACP, 0, MapSL(chf16->lpTemplateName), -1, NULL, 0);
+      chf32w->lpTemplateName = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
+      MultiByteToWideChar( CP_ACP, 0, MapSL(chf16->lpTemplateName),
+                           -1, (LPWSTR)chf32w->lpTemplateName, len);
   }
   }
-  if(chf16->lpszStyle)
+  if (chf16->Flags & CF_USESTYLE)
   {
   {
-    len = MultiByteToWideChar(CP_ACP, 0, (LPCSTR)chf16->lpszStyle, -1, NULL, 0);
-    chf32w->lpszStyle = HeapAlloc(GetProcessHeap(), 0, len*sizeof(WCHAR));
-    MultiByteToWideChar(CP_ACP, 0, (LPSTR)MapSL(chf16->lpTemplateName),
-                        -1, chf32w->lpszStyle, len);
+      len = MultiByteToWideChar( CP_ACP, 0, MapSL(chf16->lpszStyle), -1, NULL, 0);
+      chf32w->lpszStyle = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
+      MultiByteToWideChar( CP_ACP, 0, MapSL(chf16->lpszStyle), -1, chf32w->lpszStyle, len);
   }
   chf32w->lStructSize=sizeof(CHOOSEFONTW);
   chf32w->hwndOwner=HWND_32(chf16->hwndOwner);
   }
   chf32w->lStructSize=sizeof(CHOOSEFONTW);
   chf32w->hwndOwner=HWND_32(chf16->hwndOwner);
@@ -95,12 +97,11 @@ static void CFn_CHOOSEFONT16to32W(LPCHOOSEFONT16 chf16, LPCHOOSEFONTW chf32w)
   chf32w->lCustData=chf16->lCustData;
   chf32w->lpfnHook=NULL;
   chf32w->hInstance=HINSTANCE_32(chf16->hInstance);
   chf32w->lCustData=chf16->lCustData;
   chf32w->lpfnHook=NULL;
   chf32w->hInstance=HINSTANCE_32(chf16->hInstance);
-  chf32w->lpszStyle=MapSL(chf16->lpszStyle);
   chf32w->nFontType=chf16->nFontType;
   chf32w->nSizeMax=chf16->nSizeMax;
   chf32w->nSizeMin=chf16->nSizeMin;
   FONT_LogFont16To32W(MapSL(chf16->lpLogFont), chf32w->lpLogFont);
   chf32w->nFontType=chf16->nFontType;
   chf32w->nSizeMax=chf16->nSizeMax;
   chf32w->nSizeMin=chf16->nSizeMin;
   FONT_LogFont16To32W(MapSL(chf16->lpLogFont), chf32w->lpLogFont);
-};
+}
 
 /***********************************************************************
  *                          CFn_HookCallChk                 [internal]
 
 /***********************************************************************
  *                          CFn_HookCallChk                 [internal]
@@ -122,11 +123,13 @@ INT16 WINAPI FontFamilyEnumProc16( SEGPTR logfont, SEGPTR metrics,
 {
   HWND hwnd=HWND_32(LOWORD(lParam));
   HWND hDlg=GetParent(hwnd);
 {
   HWND hwnd=HWND_32(LOWORD(lParam));
   HWND hDlg=GetParent(hwnd);
-  LPCHOOSEFONT16 lpcf=(LPCHOOSEFONT16)GetWindowLongPtrW(hDlg, DWLP_USER);
+  LPCHOOSEFONT16 lpcf;
   LOGFONT16 *lplf = MapSL( logfont );
   TEXTMETRIC16 *lpmtrx16 = MapSL(metrics);
   ENUMLOGFONTEXW elf32w;
   NEWTEXTMETRICEXW nmtrx32w;
   LOGFONT16 *lplf = MapSL( logfont );
   TEXTMETRIC16 *lpmtrx16 = MapSL(metrics);
   ENUMLOGFONTEXW elf32w;
   NEWTEXTMETRICEXW nmtrx32w;
+
+  lpcf = (LPCHOOSEFONT16)GetPropW(hDlg, strWineFontData16);
   FONT_LogFont16To32W(lplf, &(elf32w.elfLogFont));
   FONT_Metrics16To32W(lpmtrx16, &nmtrx32w);
   return AddFontFamily(&elf32w, &nmtrx32w, nFontType,
   FONT_LogFont16To32W(lplf, &(elf32w.elfLogFont));
   FONT_Metrics16To32W(lpmtrx16, &nmtrx32w);
   return AddFontFamily(&elf32w, &nmtrx32w, nFontType,
@@ -142,11 +145,13 @@ INT16 WINAPI FontStyleEnumProc16( SEGPTR logfont, SEGPTR metrics,
   HWND hcmb2=HWND_32(LOWORD(lParam));
   HWND hcmb3=HWND_32(HIWORD(lParam));
   HWND hDlg=GetParent(hcmb3);
   HWND hcmb2=HWND_32(LOWORD(lParam));
   HWND hcmb3=HWND_32(HIWORD(lParam));
   HWND hDlg=GetParent(hcmb3);
-  LPCHOOSEFONT16 lpcf=(LPCHOOSEFONT16)GetWindowLongPtrW(hDlg, DWLP_USER);
+  LPCHOOSEFONT16 lpcf;
   LOGFONT16 *lplf = MapSL(logfont);
   TEXTMETRIC16 *lpmtrx16 = MapSL(metrics);
   ENUMLOGFONTEXW elf32w;
   NEWTEXTMETRICEXW nmtrx32w;
   LOGFONT16 *lplf = MapSL(logfont);
   TEXTMETRIC16 *lpmtrx16 = MapSL(metrics);
   ENUMLOGFONTEXW elf32w;
   NEWTEXTMETRICEXW nmtrx32w;
+
+  lpcf = (LPCHOOSEFONT16)GetPropW(hDlg, strWineFontData16);
   FONT_LogFont16To32W(lplf, &(elf32w.elfLogFont));
   FONT_Metrics16To32W(lpmtrx16, &nmtrx32w);
   return AddFontStyle(&elf32w, &nmtrx32w, nFontType,
   FONT_LogFont16To32W(lplf, &(elf32w.elfLogFont));
   FONT_Metrics16To32W(lpmtrx16, &nmtrx32w);
   return AddFontStyle(&elf32w, &nmtrx32w, nFontType,
@@ -300,13 +305,13 @@ BOOL16 CALLBACK FormatCharDlgProc16(HWND16 hDlg16, UINT16 message,
   BOOL16 res=0;
   if (message!=WM_INITDIALOG)
   {
   BOOL16 res=0;
   if (message!=WM_INITDIALOG)
   {
-   lpcf=(LPCHOOSEFONT16)GetWindowLongPtrW(hDlg, DWLP_USER);
-   if (!lpcf && message != WM_MEASUREITEM)
-      return FALSE;
-   if (CFn_HookCallChk(lpcf))
-     res=CallWindowProc16((WNDPROC16)lpcf->lpfnHook,hDlg16,message,wParam,lParam);
-   if (res)
-    return res;
+      lpcf = (LPCHOOSEFONT16)GetPropW(hDlg, strWineFontData16);
+      if (!lpcf)
+          return FALSE;
+      if (CFn_HookCallChk(lpcf))
+          res=CallWindowProc16((WNDPROC16)lpcf->lpfnHook,hDlg16,message,wParam,lParam);
+      if (res)
+          return res;
   }
   else
   {
   }
   else
   {
@@ -316,6 +321,7 @@ BOOL16 CALLBACK FormatCharDlgProc16(HWND16 hDlg16, UINT16 message,
       TRACE("CFn_WMInitDialog returned FALSE\n");
       return FALSE;
     }
       TRACE("CFn_WMInitDialog returned FALSE\n");
       return FALSE;
     }
+    SetPropW(hDlg, strWineFontData16, (HANDLE)lParam);
     if (CFn_HookCallChk(lpcf))
       return CallWindowProc16((WNDPROC16)lpcf->lpfnHook,hDlg16,WM_INITDIALOG,wParam,lParam);
   }
     if (CFn_HookCallChk(lpcf))
       return CallWindowProc16((WNDPROC16)lpcf->lpfnHook,hDlg16,WM_INITDIALOG,wParam,lParam);
   }