Sync to Wine-20050111:

Robert Shearman <rob@codeweavers.com>
- Change dialog templates to not explicitly specify extended window
styles for the static rects on the Page Setup dialog as the ones
specified were wrong anyway.
Dmitry Timoshkov <dmitry@codeweavers.com>
- Replace 'All xxx pages' text in common print dialog by simple 'All'.
Jose Manuel Ferrer Ortiz <jmfo1982@yahoo.es>
- Updated Spanish resource.
Jacek Caban <jack@itma.pwr.wroc.pl>
- Moved save* strings to resources.
- Moved string to resources.
- Get rid of W->A calls.
- Unicodified fontdlg.
Eric Pouech <pouech-eric@wanadoo.fr>
- Removed excessive statement (break after return or goto, not useful
break, not needed vars...)
Paul Vriens <Paul.Vriens@xs4all.nl>
- use Interlocked* functions in AddRef and Release.
- store the result of the Interlocked functions and use only this.
Michael Stefaniuc <mstefani@redhat.de>
- Do not check for non NULL pointer before HeapFree'ing it. It's
redundant.
Alexandre Julliard <julliard@winehq.org>
- Janitorial: C booleans must not be compared against TRUE.

svn path=/trunk/; revision=12935
This commit is contained in:
Gé van Geldorp 2005-01-11 23:05:16 +00:00
parent fe687a094d
commit 85527b3aaa
24 changed files with 484 additions and 417 deletions

View file

@ -93,7 +93,7 @@ typedef struct {
#define PD32_DEFAULT_PRINTER 1582
#define PD32_NR_OF_DOCUMENTS_IN_QUEUE 1583
#define PD32_PRINT_ALL_X_PAGES 1584
#define PD32_MARGINS_IN_INCHES 1585
#define PD32_MARGINS_IN_MILIMETERS 1586
#define PD32_MILIMETERS 1587
@ -145,6 +145,13 @@ typedef struct {
#define IDS_COLOR_AQUA 1054
#define IDS_COLOR_WHITE 1055
#define IDS_FONT_SIZE 1200
#define IDS_SAVE_BUTTON 1201
#define IDS_SAVE_IN 1202
#define IDS_SAVE 1203
#define IDS_SAVE_AS 1204
#define IDS_OPEN_FILE 1205
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
@ -199,26 +206,25 @@ typedef struct
{
HWND hWnd1;
HWND hWnd2;
LPCHOOSEFONTA lpcf32a;
LPCHOOSEFONTW lpcf32w;
int added;
} CFn_ENUMSTRUCT, *LPCFn_ENUMSTRUCT;
INT AddFontFamily(const ENUMLOGFONTEXA *lpElfex, const NEWTEXTMETRICEXA *lpNTM,
UINT nFontType, LPCHOOSEFONTA lpcf, HWND hwnd,
INT AddFontFamily(const ENUMLOGFONTEXW *lpElfex, const NEWTEXTMETRICEXW *lpNTM,
UINT nFontType, LPCHOOSEFONTW lpcf, HWND hwnd,
LPCFn_ENUMSTRUCT e);
INT AddFontStyle(const ENUMLOGFONTEXA *lpElfex, const NEWTEXTMETRICEXA *metrics,
UINT nFontType, LPCHOOSEFONTA lpcf, HWND hcmb2, HWND hcmb3,
INT AddFontStyle(const ENUMLOGFONTEXW *lpElfex, const NEWTEXTMETRICEXW *metrics,
UINT nFontType, LPCHOOSEFONTW lpcf, HWND hcmb2, HWND hcmb3,
HWND hDlg, BOOL iswin16);
void _dump_cf_flags(DWORD cflags);
LRESULT CFn_WMInitDialog(HWND hDlg, WPARAM wParam, LPARAM lParam,
LPCHOOSEFONTA lpcf);
LPCHOOSEFONTW lpcf);
LRESULT CFn_WMMeasureItem(HWND hDlg, WPARAM wParam, LPARAM lParam);
LRESULT CFn_WMDrawItem(HWND hDlg, WPARAM wParam, LPARAM lParam);
LRESULT CFn_WMCommand(HWND hDlg, WPARAM wParam, LPARAM lParam,
LPCHOOSEFONTA lpcf);
LPCHOOSEFONTW lpcf);
LRESULT CFn_WMPaint(HWND hDlg, WPARAM wParam, LPARAM lParam,
LPCHOOSEFONTA lpcf);
LRESULT CFn_WMDestroy(HWND hwnd, WPARAM wParam, LPARAM lParam);
LPCHOOSEFONTW lpcf);
#endif /* _WINE_DLL_CDLG_H */

View file

@ -300,9 +300,9 @@ STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Ò³ÃæÉèÖÃ"
FONT 8, "MS Shell Dlg"
BEGIN
CONTROL "", rct1, 130, 0x00020006, 80, 8, 80, 80, SS_WHITERECT
CONTROL "", rct2, 130, 0x00020005, 160, 12, 4, 80, SS_GRAYRECT
CONTROL "", rct3, 130, 0x00020005, 84, 88, 80, 4, SS_GRAYRECT
CONTROL "", rct1, "Static", SS_WHITERECT, 80, 8, 80, 80
CONTROL "", rct2, "Static", SS_GRAYRECT, 160, 12, 4, 80
CONTROL "", rct3, "Static", SS_GRAYRECT, 84, 88, 80, 4
GROUPBOX "Ö½ÕÅ", grp2, 8, 96, 224, 56, BS_GROUPBOX
LTEXT "´óС(&S):", stc2, 16, 112, 36, 8
COMBOBOX cmb2, 64, 110, 160, 160, CBS_SIMPLE|CBS_DROPDOWN|CBS_SORT|WS_GROUP|WS_TABSTOP|WS_VSCROLL
@ -408,7 +408,6 @@ supported by your printer.\nPlease enter a value between 1 and %d."
PD32_DEFAULT_PRINTER "Default Printer; "
PD32_NR_OF_DOCUMENTS_IN_QUEUE "There are %d documents in the queue"
PD32_PRINT_ALL_X_PAGES "&All %d pages"
PD32_MARGINS_IN_INCHES "Margins [inches]"
PD32_MARGINS_IN_MILIMETERS "Margins [mm]"
PD32_MILIMETERS "mm"

View file

@ -120,9 +120,9 @@ STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Seite einrichten"
FONT 8, "MS Shell Dlg"
BEGIN
CONTROL "", rct1, 130, 0x00020006, 80, 8, 80, 80, SS_WHITERECT
CONTROL "", rct2, 130, 0x00020005, 160, 12, 4, 80, SS_GRAYRECT
CONTROL "", rct3, 130, 0x00020005, 84, 88, 80, 4, SS_GRAYRECT
CONTROL "", rct1, "Static", SS_WHITERECT, 80, 8, 80, 80
CONTROL "", rct2, "Static", SS_GRAYRECT, 160, 12, 4, 80
CONTROL "", rct3, "Static", SS_GRAYRECT, 84, 88, 80, 4
GROUPBOX "Papier", grp2, 8, 96, 224, 56, BS_GROUPBOX
LTEXT "&Größe:", stc2, 16, 112, 36, 8
COMBOBOX cmb2, 64, 110, 160, 160, CBS_SIMPLE|CBS_DROPDOWN|CBS_SORT|WS_GROUP|WS_TABSTOP|WS_VSCROLL
@ -402,7 +402,6 @@ Bitte geben sie einen Wert zwischen %d und %d an."
PD32_DEFAULT_PRINTER "Standard Drucker; "
PD32_NR_OF_DOCUMENTS_IN_QUEUE "Es sind %d Dokumente in der Queue"
PD32_PRINT_ALL_X_PAGES "&Alle %d Seiten"
PD32_MARGINS_IN_INCHES "Ränder [inches/zoll]"
PD32_MARGINS_IN_MILIMETERS "Ränder [mm]"
PD32_MILIMETERS "mm"

View file

@ -300,9 +300,9 @@ STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Setup Page"
FONT 8, "MS Shell Dlg"
BEGIN
CONTROL "", rct1, 130, 0x00020006, 80, 8, 80, 80, SS_WHITERECT
CONTROL "", rct2, 130, 0x00020005, 160, 12, 4, 80, SS_GRAYRECT
CONTROL "", rct3, 130, 0x00020005, 84, 88, 80, 4, SS_GRAYRECT
CONTROL "", rct1, "Static", SS_WHITERECT, 80, 8, 80, 80
CONTROL "", rct2, "Static", SS_GRAYRECT, 160, 12, 4, 80
CONTROL "", rct3, "Static", SS_GRAYRECT, 84, 88, 80, 4
GROUPBOX "Paper", grp2, 8, 96, 224, 56, BS_GROUPBOX
LTEXT "&Size:", stc2, 16, 112, 36, 8
COMBOBOX cmb2, 64, 110, 160, 160, CBS_SIMPLE|CBS_DROPDOWN|CBS_SORT|WS_GROUP|WS_TABSTOP|WS_VSCROLL
@ -408,7 +408,6 @@ supported by your printer.\nPlease enter a value between 1 and %d."
PD32_DEFAULT_PRINTER "Default Printer; "
PD32_NR_OF_DOCUMENTS_IN_QUEUE "There are %d documents in the queue"
PD32_PRINT_ALL_X_PAGES "&All %d pages"
PD32_MARGINS_IN_INCHES "Margins [inches]"
PD32_MARGINS_IN_MILIMETERS "Margins [mm]"
PD32_MILIMETERS "mm"
@ -461,6 +460,15 @@ STRINGTABLE DISCARDABLE /* Color names */
IDS_COLOR_WHITE "White"
}
STRINGTABLE DISCARDABLE
{
IDS_FONT_SIZE "Select a font size between %d and %d points."
IDS_SAVE_BUTTON "&Save"
IDS_SAVE_IN "Save &in:"
IDS_SAVE "Save"
IDS_SAVE_AS "Save as"
IDS_OPEN_FILE "Open File"
}
/****************************************************************/
/* English neutral resources

View file

@ -1,6 +1,6 @@
/*
* Copyright 1995 Jon Tombs
* Copyright 2004 José Manuel Ferrer Ortiz
* Copyright 2004, 2005 José Manuel Ferrer Ortiz
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@ -139,7 +139,7 @@ FONT 8, "MS Shell Dlg"
CHECKBOX "&Subrayado", chx2, 10,94,50,10, BS_AUTOCHECKBOX
LTEXT "&Color:", stc4 ,6,110,30,9
COMBOBOX cmb4,6,120,84,100,CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | CBS_HASSTRINGS |
CBS_AUTOHSCROLL | WS_BORDER | WS_VSCROLL | WS_TABSTOP
CBS_AUTOHSCROLL | WS_BORDER | WS_VSCROLL | WS_TABSTOP
GROUPBOX "Ejemplo",grp2,98,72,120,36,WS_GROUP
CTEXT "AaBbYyZzÑñ",stc5,103,80,109,24,SS_NOPREFIX | NOT WS_VISIBLE
LTEXT "Codificación:",stc7 ,98,114,80,9
@ -155,7 +155,7 @@ FONT 8, "MS Shell Dlg"
{
LTEXT "Colores &básicos:", 1088, 4, 4, 140, 10
LTEXT "Colores person&alizados:", 1089, 4, 106, 140, 10
LTEXT "Color|Sól&ido", 1090, 150, 151, 48, 10
LTEXT "Color | Sól&ido", 1090, 150, 151, 48, 10
LTEXT "&Rojo:", 726 /*1094*/,249,126,24,10
EDITTEXT 706, 275,124,21,12, WS_BORDER | WS_GROUP | WS_TABSTOP
LTEXT "&Verde:",727/*1095*/,249,140,24,10
@ -178,7 +178,7 @@ FONT 8, "MS Shell Dlg"
PUSHBUTTON "A&yuda", pshHelp,100,166, 44, 14
PUSHBUTTON "Añadir a &colores personalizados", 712/*1024*/, 152, 166, 142, 14, WS_GROUP | WS_TABSTOP
PUSHBUTTON "&Definir colores personalizados >>", 719/*1025*/, 4, 150, 142, 14, WS_GROUP | WS_TABSTOP
PUSHBUTTON "&i",713,300,200,4,14 /* just a dummy: 'i' is like &i in "sol&id" */
PUSHBUTTON "&i",713,300,200,4,14 /* just a dummy: 'i' is like &i in "sol&id" */
}
@ -267,7 +267,7 @@ FONT 8, "MS Shell Dlg"
BEGIN
DEFPUSHBUTTON "Aceptar",IDOK,180,156,48,14,WS_GROUP
PUSHBUTTON "Cancelar",IDCANCEL,232,156,48,14
/* PUSHBUTTON "Network...", psh5, 284,156,48,14 */
/* PUSHBUTTON "Red...", psh5, 284,156,48,14 */
GROUPBOX "Impresora", grp4, 8, 4, 272,84, WS_GROUP
PUSHBUTTON "&Propiedades", psh2, 212, 17, 60,14, WS_GROUP
@ -299,9 +299,9 @@ STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Página de configuración"
FONT 8, "MS Shell Dlg"
BEGIN
CONTROL "", rct1, 130, 0x00020006, 80, 8, 80, 80, SS_WHITERECT
CONTROL "", rct2, 130, 0x00020005, 160, 12, 4, 80, SS_GRAYRECT
CONTROL "", rct3, 130, 0x00020005, 84, 88, 80, 4, SS_GRAYRECT
CONTROL "", rct1, "Static", SS_WHITERECT, 80, 8, 80, 80
CONTROL "", rct2, "Static", SS_GRAYRECT, 160, 12, 4, 80
CONTROL "", rct3, "Static", SS_GRAYRECT, 84, 88, 80, 4
GROUPBOX "Papel", grp2, 8, 96, 224, 56, BS_GROUPBOX
LTEXT "&Tamaño:", stc2, 16, 112, 36, 8
COMBOBOX cmb2, 64, 110, 160, 160, CBS_SIMPLE|CBS_DROPDOWN|CBS_SORT|WS_GROUP|WS_TABSTOP|WS_VSCROLL
@ -409,7 +409,6 @@ desconocido."
PD32_DEFAULT_PRINTER "Impresora por defecto; "
PD32_NR_OF_DOCUMENTS_IN_QUEUE "Hay %d documentos en la cola"
PD32_PRINT_ALL_X_PAGES "&Todas las %d páginas"
PD32_MARGINS_IN_INCHES "Márgenes [pulgadas]"
PD32_MARGINS_IN_MILIMETERS "Márgenes [mm]"
PD32_MILIMETERS "mm"
@ -418,7 +417,7 @@ desconocido."
PD32_PRINTER_STATUS_PAUSED "Pausada; "
PD32_PRINTER_STATUS_ERROR "Error; "
PD32_PRINTER_STATUS_PENDING_DELETION "Borrado pendiente; "
PD32_PRINTER_STATUS_PAPER_JAM "Paper jam; "
PD32_PRINTER_STATUS_PAPER_JAM "Papel atascado; "
PD32_PRINTER_STATUS_PAPER_OUT "Sin papel; "
PD32_PRINTER_STATUS_MANUAL_FEED "Ponga papel a mano; "
PD32_PRINTER_STATUS_PAPER_PROBLEM "Problema con el papel; "
@ -451,7 +450,7 @@ STRINGTABLE DISCARDABLE /* Color names */
IDS_COLOR_OLIVE "Oliva"
IDS_COLOR_NAVY "Azul marino"
IDS_COLOR_PURPLE "Morado"
IDS_COLOR_TEAL "Teal"
IDS_COLOR_TEAL "Turquesa"
IDS_COLOR_GRAY "Gris"
IDS_COLOR_SILVER "Plateado"
IDS_COLOR_RED "Rojo"
@ -462,3 +461,8 @@ STRINGTABLE DISCARDABLE /* Color names */
IDS_COLOR_AQUA "Agua"
IDS_COLOR_WHITE "Blanco"
}
STRINGTABLE DISCARDABLE
{
IDS_FONT_SIZE "Elija un tamaño de fuente entre %d and %d puntos."
}

View file

@ -303,9 +303,9 @@ STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Mise en page"
FONT 8, "MS Shell Dlg"
BEGIN
CONTROL "", rct1, 130, 0x00020006, 80, 8, 80, 80, SS_WHITERECT
CONTROL "", rct2, 130, 0x00020005, 160, 12, 4, 80, SS_GRAYRECT
CONTROL "", rct3, 130, 0x00020005, 84, 88, 80, 4, SS_GRAYRECT
CONTROL "", rct1, "Static", SS_WHITERECT, 80, 8, 80, 80
CONTROL "", rct2, "Static", SS_GRAYRECT, 160, 12, 4, 80
CONTROL "", rct3, "Static", SS_GRAYRECT, 84, 88, 80, 4
GROUPBOX "Papier", grp2, 8, 96, 224, 56, BS_GROUPBOX
LTEXT "&Taille:", stc2, 16, 112, 36, 8
COMBOBOX cmb2, 64, 110, 160, 160, CBS_SIMPLE|CBS_DROPDOWN|CBS_SORT|WS_GROUP|WS_TABSTOP|WS_VSCROLL
@ -411,7 +411,6 @@ Veuillez indiquer un nombre de copies entre 1 et %d."
PD32_DEFAULT_PRINTER "Imprimante par défaut; "
PD32_NR_OF_DOCUMENTS_IN_QUEUE "Il y a %d documents dans la file d'attente"
PD32_PRINT_ALL_X_PAGES "&Toutes les %d pages"
PD32_MARGINS_IN_INCHES "Marges [pouces]"
PD32_MARGINS_IN_MILIMETERS "Marges [mm]"
PD32_MILIMETERS "mm"

View file

@ -300,9 +300,9 @@ STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Setup di Pagina"
FONT 8, "MS Shell Dlg"
BEGIN
CONTROL "", rct1, 130, 0x00020006, 80, 8, 80, 80, SS_WHITERECT
CONTROL "", rct2, 130, 0x00020005, 160, 12, 4, 80, SS_GRAYRECT
CONTROL "", rct3, 130, 0x00020005, 84, 88, 80, 4, SS_GRAYRECT
CONTROL "", rct1, "Static", SS_WHITERECT, 80, 8, 80, 80
CONTROL "", rct2, "Static", SS_GRAYRECT, 160, 12, 4, 80
CONTROL "", rct3, "Static", SS_GRAYRECT, 84, 88, 80, 4
GROUPBOX "Carta", grp2, 8, 96, 224, 56, BS_GROUPBOX
LTEXT "&Dimensione:", stc2, 16, 112, 36, 8
COMBOBOX cmb2, 64, 110, 160, 160, CBS_SIMPLE|CBS_DROPDOWN|CBS_SORT|WS_GROUP|WS_TABSTOP|WS_VSCROLL
@ -407,7 +407,6 @@ supportato dalla stampante.\nInserire un valore compreso tra 1 e %d"
PD32_DEFAULT_PRINTER "Stampante predefinita; "
PD32_NR_OF_DOCUMENTS_IN_QUEUE "Ci sono %d documenti nella coda di stampa"
PD32_PRINT_ALL_X_PAGES "&Tutte le %d pagine"
PD32_MARGINS_IN_INCHES "Margini [pollici]"
PD32_MARGINS_IN_MILIMETERS "Margini [mm]"
PD32_MILIMETERS "mm"

View file

@ -251,7 +251,7 @@ FONT 8, "MS Shell Dlg"
EDITTEXT edt3, 240,106, 32,12, WS_GROUP | ES_NUMBER
GROUPBOX "Afdrukbereik", grp1, 8,92, 144,64, WS_GROUP
CONTROL "&Alle xx", rad1,"Button",BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,16,106,64,12
CONTROL "&Alle", rad1,"Button",BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,16,106,64,12
CONTROL "&Pagina's", rad3,"Button",BS_AUTORADIOBUTTON,16,122,36,12
CONTROL "Sele&ctie", rad2,"Button",BS_AUTORADIOBUTTON,16,138,64,12
EDITTEXT edt1, 74,122, 26,12, WS_GROUP | ES_NUMBER
@ -289,7 +289,6 @@ gespecifieerde fout"
PD32_DEFAULT_PRINTER "Default Printer, "
PD32_NR_OF_DOCUMENTS_IN_QUEUE "Er staan %d documenten in de \
wachtrij"
PD32_PRINT_ALL_X_PAGES "&Alle %d pagina's"
PD32_MARGINS_IN_INCHES "Marges [inch]"
PD32_MARGINS_IN_MILIMETERS "Marges [mm]"
PD32_MILIMETERS "mm"

View file

@ -302,9 +302,9 @@ STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Ustawienia Strony"
FONT 8, "MS Shell Dlg"
BEGIN
CONTROL "", rct1, 130, 0x00020006, 80, 8, 80, 80, SS_WHITERECT
CONTROL "", rct2, 130, 0x00020005, 160, 12, 4, 80, SS_GRAYRECT
CONTROL "", rct3, 130, 0x00020005, 84, 88, 80, 4, SS_GRAYRECT
CONTROL "", rct1, "Static", SS_WHITERECT, 80, 8, 80, 80
CONTROL "", rct2, "Static", SS_GRAYRECT, 160, 12, 4, 80
CONTROL "", rct3, "Static", SS_GRAYRECT, 84, 88, 80, 4
GROUPBOX "Papier", grp2, 8, 96, 224, 56, BS_GROUPBOX
LTEXT "&Rozmiar:", stc2, 16, 112, 36, 8
COMBOBOX cmb2, 64, 110, 160, 160, CBS_SIMPLE|CBS_DROPDOWN|CBS_SORT|WS_GROUP|WS_TABSTOP|WS_VSCROLL
@ -405,7 +405,6 @@ STRINGTABLE DISCARDABLE
PD32_DEFAULT_PRINTER "Domyœlna Drukarka; "
PD32_NR_OF_DOCUMENTS_IN_QUEUE "W kolejce znajduj¹ siê %d dokumenty"
PD32_PRINT_ALL_X_PAGES "&Wszystkie %d strony"
PD32_MARGINS_IN_INCHES "Marginesy [cale]"
PD32_MARGINS_IN_MILIMETERS "Marginesy [mm]"
PD32_MILIMETERS "mm"
@ -437,6 +436,16 @@ STRINGTABLE DISCARDABLE
PD32_PRINTER_STATUS_POWER_SAVE "Tryb oszczêdzania energii; "
}
STRINGTABLE DISCARDABLE
{
IDS_FONT_SIZE "Wybierz czcionkê o rozmiarze pomiêdzy %d a %d punktami."
IDS_SAVE_BUTTON "&Zapisz"
IDS_SAVE_IN "Zapisz &w:"
IDS_SAVE "Zapisz"
IDS_SAVE_AS "Zapisz jako"
IDS_OPEN_FILE "Otwórz Plik"
}
STRINGTABLE DISCARDABLE /* Color names */
{
IDS_COLOR_BLACK "Czarny"

View file

@ -301,9 +301,9 @@ STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Configurações de Página"
FONT 8, "MS Shell Dlg"
BEGIN
CONTROL "", rct1, 130, 0x00020006, 80, 8, 80, 80, SS_WHITERECT
CONTROL "", rct2, 130, 0x00020005, 160, 12, 4, 80, SS_GRAYRECT
CONTROL "", rct3, 130, 0x00020005, 84, 88, 80, 4, SS_GRAYRECT
CONTROL "", rct1, "Static", SS_WHITERECT, 80, 8, 80, 80
CONTROL "", rct2, "Static", SS_GRAYRECT, 160, 12, 4, 80
CONTROL "", rct3, "Static", SS_GRAYRECT, 84, 88, 80, 4
GROUPBOX "Papel", grp2, 8, 96, 224, 56, BS_GROUPBOX
LTEXT "&Tamanho:", stc2, 16, 112, 36, 8
COMBOBOX cmb2, 64, 110, 160, 160, CBS_SIMPLE|CBS_DROPDOWN|CBS_SORT|WS_GROUP|WS_TABSTOP|WS_VSCROLL
@ -407,7 +407,6 @@ pela sua impressora.\nPor favor entre um valor entre 1 e %d."
PD32_DEFAULT_PRINTER "Impressora Padrão; "
PD32_NR_OF_DOCUMENTS_IN_QUEUE "Existem %d documentos na fila"
PD32_PRINT_ALL_X_PAGES "&Todas %d páginas"
PD32_MARGINS_IN_INCHES "Margens [polegadas]"
PD32_MARGINS_IN_MILIMETERS "Margens [mm]"
PD32_MILIMETERS "mm"

View file

@ -376,7 +376,6 @@ STRINGTABLE DISCARDABLE
PD32_DEFAULT_PRINTER "Ïðèíòåð ïî óìîë÷àíèþ; "
PD32_NR_OF_DOCUMENTS_IN_QUEUE "%d äîêóìåíòîâ â î÷åðåäè"
PD32_PRINT_ALL_X_PAGES "&Âñå %d ñòðàíèö"
PD32_MARGINS_IN_INCHES "Ãðàíèöû [äþéìû)"
PD32_MARGINS_IN_MILIMETERS "Ãðàíèöû [ìì]"
PD32_MILIMETERS "ìì"

View file

@ -300,9 +300,9 @@ STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Priprava strani"
FONT 8, "MS Shell Dlg"
BEGIN
CONTROL "", rct1, 130, 0x00020006, 80, 8, 80, 80, SS_WHITERECT
CONTROL "", rct2, 130, 0x00020005, 160, 12, 4, 80, SS_GRAYRECT
CONTROL "", rct3, 130, 0x00020005, 84, 88, 80, 4, SS_GRAYRECT
CONTROL "", rct1, "Static", SS_WHITERECT, 80, 8, 80, 80
CONTROL "", rct2, "Static", SS_GRAYRECT, 160, 12, 4, 80
CONTROL "", rct3, "Static", SS_GRAYRECT, 84, 88, 80, 4
GROUPBOX "Papir", grp2, 8, 96, 224, 56, BS_GROUPBOX
LTEXT "Veli&kost:", stc2, 16, 112, 36, 8
COMBOBOX cmb2, 64, 110, 160, 160, CBS_SIMPLE|CBS_DROPDOWN|CBS_SORT|WS_GROUP|WS_TABSTOP|WS_VSCROLL
@ -405,7 +405,6 @@ Vnesite
PD32_DEFAULT_PRINTER "Privzeti tiskalnik; "
PD32_NR_OF_DOCUMENTS_IN_QUEUE "%d èakajoèih dok."
PD32_PRINT_ALL_X_PAGES "&Vse strani -- %d"
PD32_MARGINS_IN_INCHES "Robovi [palci]"
PD32_MARGINS_IN_MILIMETERS "Robovi [mm]"
PD32_MILIMETERS "mm"

View file

@ -378,7 +378,6 @@ supported by your printer.\nPlease enter a value between 1 and %d"
PD32_DEFAULT_PRINTER "Implicitná tlaèiareò; "
PD32_NR_OF_DOCUMENTS_IN_QUEUE "There are %d documents in queue"
PD32_PRINT_ALL_X_PAGES "&Všetky %d strany"
PD32_MARGINS_IN_INCHES "Okraje [palce]"
PD32_MARGINS_IN_MILIMETERS "Okraje [mm]"
PD32_MILIMETERS "mm"

View file

@ -293,9 +293,9 @@ STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Utskriftsformat"
FONT 8, "MS Shell Dlg"
BEGIN
CONTROL "", rct1, 130, 0x00020006, 80, 8, 80, 80, SS_WHITERECT
CONTROL "", rct2, 130, 0x00020005, 160, 12, 4, 80, SS_GRAYRECT
CONTROL "", rct3, 130, 0x00020005, 84, 88, 80, 4, SS_GRAYRECT
CONTROL "", rct1, "Static", SS_WHITERECT, 80, 8, 80, 80
CONTROL "", rct2, "Static", SS_GRAYRECT, 160, 12, 4, 80
CONTROL "", rct3, "Static", SS_GRAYRECT, 84, 88, 80, 4
GROUPBOX "Papper", grp2, 8, 96, 224, 56, BS_GROUPBOX
LTEXT "&Storlek:", stc2, 16, 112, 36, 8
COMBOBOX cmb2, 64, 110, 160, 160,CBS_SIMPLE|CBS_DROPDOWN|CBS_SORT|WS_GROUP|WS_TABSTOP|WS_VSCROLL
@ -398,7 +398,6 @@ pappersgr
PD32_DEFAULT_PRINTER "Standardskrivare; "
PD32_NR_OF_DOCUMENTS_IN_QUEUE "Det är %d dokument i kön"
PD32_PRINT_ALL_X_PAGES "&Alla %d sidor"
PD32_MARGINS_IN_INCHES "Marginaler [inches]"
PD32_MARGINS_IN_MILIMETERS "Marginaler [millimeter]"
PD32_MILIMETERS "millimeter"

View file

@ -297,9 +297,9 @@ STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "»ÃѺáµè§"
FONT 8, "MS Shell Dlg"
BEGIN
CONTROL "", rct1, 130, 0x00020006, 80, 8, 80, 80, SS_WHITERECT
CONTROL "", rct2, 130, 0x00020005, 160, 12, 4, 80, SS_GRAYRECT
CONTROL "", rct3, 130, 0x00020005, 84, 88, 80, 4, SS_GRAYRECT
CONTROL "", rct1, "Static", SS_WHITERECT, 80, 8, 80, 80
CONTROL "", rct2, "Static", SS_GRAYRECT, 160, 12, 4, 80
CONTROL "", rct3, "Static", SS_GRAYRECT, 84, 88, 80, 4
GROUPBOX "¡ÃдÒÉ", grp2, 8, 96, 224, 56, BS_GROUPBOX
LTEXT "¢¹Ò´:", stc2, 16, 112, 36, 8
COMBOBOX cmb2, 64, 110, 160, 160, CBS_SIMPLE|CBS_DROPDOWN|CBS_SORT|WS_GROUP|WS_TABSTOP|WS_VSCROLL
@ -402,7 +402,6 @@ supported by your printer.\nPlease enter a value between 1 and %d."
PD32_DEFAULT_PRINTER "à¤Ã×èͧ¾ÔÁ¾ì»¡µÔ; "
PD32_NR_OF_DOCUMENTS_IN_QUEUE "ÁÕ %d á¿éÁÃÍÍÂÙè"
PD32_PRINT_ALL_X_PAGES "·Ø¡ %d ˹éÒ"
PD32_MARGINS_IN_INCHES "¢Íº¡ÃдÒÉ [¹ÔéÇ]"
PD32_MARGINS_IN_MILIMETERS "¢Íº¡ÃдÒÉ [ÁÁ.]"
PD32_MILIMETERS "ÁÁ."

View file

@ -376,7 +376,6 @@ STRINGTABLE DISCARDABLE
PD32_DEFAULT_PRINTER "Ïðèíòåð çà îáóìîâëåííÿì; "
PD32_NR_OF_DOCUMENTS_IN_QUEUE "%d äîêóìåíò³â ó ÷åðç³"
PD32_PRINT_ALL_X_PAGES "&Âñ³ %d ñòîð³íîê"
PD32_MARGINS_IN_INCHES "Ìåæ³ [äþéìè]"
PD32_MARGINS_IN_MILIMETERS "Ìåæ³ [ìì]"
PD32_MILIMETERS "ìì"

View file

@ -1057,11 +1057,10 @@ LRESULT CC_WMCommand( HWND hDlg, WPARAM wParam, LPARAM lParam, WORD notifyCode,
*/
LRESULT CC_WMPaint( HWND hDlg, WPARAM wParam, LPARAM lParam )
{
HDC hdc;
PAINTSTRUCT ps;
LCCPRIV lpp = (LCCPRIV)GetWindowLongA(hDlg, DWL_USER);
hdc = BeginPaint(hDlg, &ps);
BeginPaint(hDlg, &ps);
/* we have to paint dialog children except text and buttons */
CC_PaintPredefColorArray(hDlg, 6, 8);
CC_PaintUserColorArray(hDlg, 2, 8, lpp->lpcc->lpCustColors);
@ -1072,7 +1071,7 @@ LRESULT CC_WMPaint( HWND hDlg, WPARAM wParam, LPARAM lParam )
CC_PaintColorGraph(hDlg);
EndPaint(hDlg, &ps);
return TRUE;
return TRUE;
}
/***********************************************************************
@ -1289,7 +1288,8 @@ BOOL WINAPI ChooseColorW( LPCHOOSECOLORW lpChCol )
{
HRSRC hResInfo;
HGLOBAL hDlgTmpl;
if (!(hResInfo = FindResourceA(COMDLG32_hInstance, "CHOOSE_COLOR", (LPSTR)RT_DIALOG)))
static const WCHAR wszCHOOSE_COLOR[] = {'C','H','O','O','S','E','_','C','O','L','O','R',0};
if (!(hResInfo = FindResourceW(COMDLG32_hInstance, wszCHOOSE_COLOR, (LPWSTR)RT_DIALOG)))
{
COMDLG32_SetCommDlgExtendedError(CDERR_FINDRESFAILURE);
return FALSE;

View file

@ -314,7 +314,7 @@ BOOL WINAPI GetFileDialog95A(LPOPENFILENAMEA ofn,UINT iDlgType)
ZeroMemory(&fodInfos, sizeof(FileOpenDlgInfos));
/* Pass in the original ofn */
fodInfos.ofnInfos = ofn;
fodInfos.ofnInfos = (LPOPENFILENAMEW)ofn;
/* save current directory */
if (ofn->Flags & OFN_NOCHANGEDIR)
@ -445,13 +445,13 @@ BOOL WINAPI GetFileDialog95W(LPOPENFILENAMEW ofn,UINT iDlgType)
{
BOOL ret;
FileOpenDlgInfos fodInfos;
LPSTR lpstrSavDir = NULL;
LPWSTR lpstrSavDir = NULL;
/* Initialize FileOpenDlgInfos structure */
ZeroMemory(&fodInfos, sizeof(FileOpenDlgInfos));
/* Pass in the original ofn */
fodInfos.ofnInfos = (LPOPENFILENAMEA) ofn;
fodInfos.ofnInfos = ofn;
fodInfos.title = ofn->lpstrTitle;
fodInfos.defext = ofn->lpstrDefExt;
@ -479,8 +479,8 @@ BOOL WINAPI GetFileDialog95W(LPOPENFILENAMEW ofn,UINT iDlgType)
/* save current directory */
if (ofn->Flags & OFN_NOCHANGEDIR)
{
lpstrSavDir = MemAlloc(MAX_PATH);
GetCurrentDirectoryA(MAX_PATH, lpstrSavDir);
lpstrSavDir = MemAlloc(MAX_PATH*sizeof(WCHAR));
GetCurrentDirectoryW(MAX_PATH, lpstrSavDir);
}
fodInfos.unicode = TRUE;
@ -500,7 +500,7 @@ BOOL WINAPI GetFileDialog95W(LPOPENFILENAMEW ofn,UINT iDlgType)
if (lpstrSavDir)
{
SetCurrentDirectoryA(lpstrSavDir);
SetCurrentDirectoryW(lpstrSavDir);
MemFree(lpstrSavDir);
}
@ -729,12 +729,12 @@ HWND CreateTemplateDialog(FileOpenDlgInfos *fodInfos, HWND hwnd)
hinst = fodInfos->ofnInfos->hInstance;
if(fodInfos->unicode)
{
LPOPENFILENAMEW ofn = (LPOPENFILENAMEW) fodInfos->ofnInfos;
LPOPENFILENAMEW ofn = fodInfos->ofnInfos;
hRes = FindResourceW( hinst, ofn->lpTemplateName, (LPWSTR)RT_DIALOG);
}
else
{
LPOPENFILENAMEA ofn = fodInfos->ofnInfos;
LPOPENFILENAMEA ofn = (LPOPENFILENAMEA)fodInfos->ofnInfos;
hRes = FindResourceA( hinst, ofn->lpTemplateName, (LPSTR)RT_DIALOG);
}
if (!hRes)
@ -807,7 +807,7 @@ HRESULT SendCustomDlgNotificationMessage(HWND hwndParentDlg, UINT uCode)
ofnNotify.hdr.hwndFrom=hwndParentDlg;
ofnNotify.hdr.idFrom=0;
ofnNotify.hdr.code = uCode;
ofnNotify.lpOFN = (LPOPENFILENAMEW) fodInfos->ofnInfos;
ofnNotify.lpOFN = fodInfos->ofnInfos;
ofnNotify.pszFile = NULL;
ret = SendMessageW(fodInfos->DlgInfos.hwndCustomDlg,WM_NOTIFY,0,(LPARAM)&ofnNotify);
}
@ -817,7 +817,7 @@ HRESULT SendCustomDlgNotificationMessage(HWND hwndParentDlg, UINT uCode)
ofnNotify.hdr.hwndFrom=hwndParentDlg;
ofnNotify.hdr.idFrom=0;
ofnNotify.hdr.code = uCode;
ofnNotify.lpOFN = fodInfos->ofnInfos;
ofnNotify.lpOFN = (LPOPENFILENAMEA)fodInfos->ofnInfos;
ofnNotify.pszFile = NULL;
ret = SendMessageA(fodInfos->DlgInfos.hwndCustomDlg,WM_NOTIFY,0,(LPARAM)&ofnNotify);
}
@ -1164,7 +1164,9 @@ static LRESULT FILEDLG95_InitControls(HWND hwnd)
}
else if (fodInfos->DlgInfos.dwDlgProp & FODPROP_SAVEDLG)
{
SetWindowTextA(hwnd,"Save");
WCHAR buf[16];
LoadStringW(COMDLG32_hInstance, IDS_SAVE, buf, sizeof(buf)/sizeof(WCHAR));
SetWindowTextW(hwnd, buf);
}
/* Initialise the file name edit control */
@ -1388,11 +1390,14 @@ static LRESULT FILEDLG95_InitControls(HWND hwnd)
(rectDlg.bottom-rectDlg.top) - (rectHelp.bottom - rectCancel.bottom),
SWP_NOACTIVATE|SWP_NOMOVE|SWP_NOZORDER);
}
/* change Open to Save FIXME: use resources */
/* change Open to Save */
if (fodInfos->DlgInfos.dwDlgProp & FODPROP_SAVEDLG)
{
SetDlgItemTextA(hwnd,IDOK,"&Save");
SetDlgItemTextA(hwnd,IDC_LOOKINSTATIC,"Save &in");
WCHAR buf[16];
LoadStringW(COMDLG32_hInstance, IDS_SAVE_BUTTON, buf, sizeof(buf)/sizeof(WCHAR));
SetDlgItemTextW(hwnd, IDOK, buf);
LoadStringW(COMDLG32_hInstance, IDS_SAVE_IN, buf, sizeof(buf)/sizeof(WCHAR));
SetDlgItemTextW(hwnd, IDC_LOOKINSTATIC, buf);
}
return 0;
}
@ -1582,12 +1587,12 @@ BOOL FILEDLG95_OnOpenMultipleFiles(HWND hwnd, LPWSTR lpstrFileList, UINT nFileCo
if(fodInfos->unicode)
{
LPOPENFILENAMEW ofn = (LPOPENFILENAMEW) fodInfos->ofnInfos;
LPOPENFILENAMEW ofn = fodInfos->ofnInfos;
ofn->lpstrFile[0] = '\0';
}
else
{
LPOPENFILENAMEA ofn = fodInfos->ofnInfos;
LPOPENFILENAMEA ofn = (LPOPENFILENAMEA) fodInfos->ofnInfos;
ofn->lpstrFile[0] = '\0';
}
@ -1640,13 +1645,13 @@ BOOL FILEDLG95_OnOpenMultipleFiles(HWND hwnd, LPWSTR lpstrFileList, UINT nFileCo
}
if(fodInfos->unicode)
{
LPOPENFILENAMEW ofn = (LPOPENFILENAMEW) fodInfos->ofnInfos;
LPOPENFILENAMEW ofn = fodInfos->ofnInfos;
strcpyW( ofn->lpstrFile, lpstrPathSpec);
memcpy( ofn->lpstrFile + nSizePath, lpstrFileList, sizeUsed*sizeof(WCHAR) );
}
else
{
LPOPENFILENAMEA ofn = fodInfos->ofnInfos;
LPOPENFILENAMEA ofn = (LPOPENFILENAMEA)fodInfos->ofnInfos;
if (ofn->lpstrFile != NULL)
{
@ -1684,14 +1689,14 @@ BOOL FILEDLG95_OnOpenMultipleFiles(HWND hwnd, LPWSTR lpstrFileList, UINT nFileCo
#define ONOPEN_SEARCH 3
static void FILEDLG95_OnOpenMessage(HWND hwnd, int idCaption, int idText)
{
char strMsgTitle[MAX_PATH];
char strMsgText [MAX_PATH];
WCHAR strMsgTitle[MAX_PATH];
WCHAR strMsgText [MAX_PATH];
if (idCaption)
LoadStringA(COMDLG32_hInstance, idCaption, strMsgTitle, sizeof(strMsgTitle));
LoadStringW(COMDLG32_hInstance, idCaption, strMsgTitle, sizeof(strMsgTitle)/sizeof(WCHAR));
else
strMsgTitle[0] = '\0';
LoadStringA(COMDLG32_hInstance, idText, strMsgText, sizeof(strMsgText));
MessageBoxA(hwnd,strMsgText, strMsgTitle, MB_OK | MB_ICONHAND);
LoadStringW(COMDLG32_hInstance, idText, strMsgText, sizeof(strMsgText)/sizeof(WCHAR));
MessageBoxW(hwnd,strMsgText, strMsgTitle, MB_OK | MB_ICONHAND);
}
BOOL FILEDLG95_OnOpen(HWND hwnd)
@ -2027,7 +2032,7 @@ BOOL FILEDLG95_OnOpen(HWND hwnd)
{
if(fodInfos->unicode)
{
LPOPENFILENAMEW ofn = (LPOPENFILENAMEW) fodInfos->ofnInfos;
LPOPENFILENAMEW ofn = fodInfos->ofnInfos;
strncpyW(ofn->lpstrFile, lpstrPathAndFile, ofn->nMaxFile);
if (ofn->Flags & OFN_ALLOWMULTISELECT)
@ -2035,7 +2040,7 @@ BOOL FILEDLG95_OnOpen(HWND hwnd)
}
else
{
LPOPENFILENAMEA ofn = fodInfos->ofnInfos;
LPOPENFILENAMEA ofn = (LPOPENFILENAMEA)fodInfos->ofnInfos;
WideCharToMultiByte(CP_ACP, 0, lpstrPathAndFile, -1,
ofn->lpstrFile, ofn->nMaxFile, NULL, NULL);
@ -2058,12 +2063,12 @@ BOOL FILEDLG95_OnOpen(HWND hwnd)
LPWSTR lpstrFileTitle = PathFindFileNameW(lpstrPathAndFile);
if(fodInfos->unicode)
{
LPOPENFILENAMEW ofn = (LPOPENFILENAMEW) fodInfos->ofnInfos;
LPOPENFILENAMEW ofn = fodInfos->ofnInfos;
strncpyW(ofn->lpstrFileTitle, lpstrFileTitle, ofn->nMaxFileTitle);
}
else
{
LPOPENFILENAMEA ofn = fodInfos->ofnInfos;
LPOPENFILENAMEA ofn = (LPOPENFILENAMEA)fodInfos->ofnInfos;
WideCharToMultiByte(CP_ACP, 0, lpstrFileTitle, -1,
ofn->lpstrFileTitle, ofn->nMaxFileTitle, NULL, NULL);
}
@ -2072,7 +2077,7 @@ BOOL FILEDLG95_OnOpen(HWND hwnd)
/* copy currently selected filter to lpstrCustomFilter */
if (fodInfos->ofnInfos->lpstrCustomFilter)
{
LPOPENFILENAMEA ofn = fodInfos->ofnInfos;
LPOPENFILENAMEA ofn = (LPOPENFILENAMEA)fodInfos->ofnInfos;
int len = WideCharToMultiByte(CP_ACP, 0, fodInfos->ShellInfos.lpstrCurrentFilter, -1,
NULL, 0, NULL, NULL);
if (len + strlen(ofn->lpstrCustomFilter) + 1 <= ofn->nMaxCustFilter)
@ -3208,7 +3213,6 @@ HRESULT GetName(LPSHELLFOLDER lpsf, LPITEMIDLIST pidl,DWORD dwFlags,LPSTR lpstrF
if(!lpsf)
{
HRESULT hRes;
SHGetDesktopFolder(&lpsf);
hRes = GetName(lpsf,pidl,dwFlags,lpstrFileName);
IShellFolder_Release(lpsf);
@ -3358,10 +3362,7 @@ static void *MemAlloc(UINT size)
static void MemFree(void *mem)
{
if(mem)
{
HeapFree(GetProcessHeap(),0,mem);
}
HeapFree(GetProcessHeap(),0,mem);
}
/*

View file

@ -586,11 +586,8 @@ static LRESULT FD31_DiskChange( PFD31_DATA lfs )
static LRESULT FD31_FileTypeChange( PFD31_DATA lfs )
{
LONG lRet;
WCHAR diskname[BUFFILE];
LPWSTR pstr;
diskname[0] = 0;
lRet = SendDlgItemMessageW(lfs->hwnd, cmb1, CB_GETCURSEL, 0, 0);
if (lRet == LB_ERR)
return TRUE;
@ -705,7 +702,6 @@ static LPWSTR FD31_DupToW(LPCSTR str, DWORD size)
*/
void FD31_MapOfnStructA(LPOPENFILENAMEA ofnA, LPOPENFILENAMEW ofnW, BOOL open)
{
LPCSTR str;
UNICODE_STRING usBuffer;
ofnW->lStructSize = sizeof(OPENFILENAMEW);
@ -727,13 +723,18 @@ void FD31_MapOfnStructA(LPOPENFILENAMEA ofnA, LPOPENFILENAMEW ofnW, BOOL open)
RtlCreateUnicodeStringFromAsciiz (&usBuffer,ofnA->lpstrInitialDir);
ofnW->lpstrInitialDir = usBuffer.Buffer;
}
if (ofnA->lpstrTitle)
str = ofnA->lpstrTitle;
else
/* Allocates default title (FIXME : get it from resource) */
str = open ? "Open File" : "Save as";
RtlCreateUnicodeStringFromAsciiz (&usBuffer,str);
ofnW->lpstrTitle = usBuffer.Buffer;
if (ofnA->lpstrTitle) {
RtlCreateUnicodeStringFromAsciiz (&usBuffer, ofnA->lpstrTitle);
ofnW->lpstrTitle = usBuffer.Buffer;
} else {
WCHAR buf[16];
int len;
LoadStringW(COMDLG32_hInstance, open ? IDS_OPEN_FILE : IDS_SAVE_AS,
buf, sizeof(buf)/sizeof(WCHAR));
len = lstrlenW(buf)+1;
ofnW->lpstrTitle = HeapAlloc(GetProcessHeap(), 0, len*sizeof(WCHAR));
memcpy((void*)ofnW->lpstrTitle, buf, len*sizeof(WCHAR));
}
ofnW->Flags = ofnA->Flags;
ofnW->nFileOffset = ofnA->nFileOffset;
ofnW->nFileExtension = ofnA->nFileExtension;
@ -757,12 +758,12 @@ void FD31_MapOfnStructA(LPOPENFILENAMEA ofnA, LPOPENFILENAMEW ofnW, BOOL open)
*/
void FD31_FreeOfnW(LPOPENFILENAMEW ofnW)
{
if (ofnW->lpstrFilter) HeapFree(GetProcessHeap(), 0, (LPWSTR) ofnW->lpstrFilter);
if (ofnW->lpstrCustomFilter) HeapFree(GetProcessHeap(), 0, ofnW->lpstrCustomFilter);
if (ofnW->lpstrFile) HeapFree(GetProcessHeap(), 0, ofnW->lpstrFile);
if (ofnW->lpstrFileTitle) HeapFree(GetProcessHeap(), 0, ofnW->lpstrFileTitle);
if (ofnW->lpstrInitialDir) HeapFree(GetProcessHeap(), 0, (LPWSTR) ofnW->lpstrInitialDir);
if (ofnW->lpstrTitle) HeapFree(GetProcessHeap(), 0, (LPWSTR) ofnW->lpstrTitle);
HeapFree(GetProcessHeap(), 0, (LPWSTR) ofnW->lpstrFilter);
HeapFree(GetProcessHeap(), 0, ofnW->lpstrCustomFilter);
HeapFree(GetProcessHeap(), 0, ofnW->lpstrFile);
HeapFree(GetProcessHeap(), 0, ofnW->lpstrFileTitle);
HeapFree(GetProcessHeap(), 0, (LPWSTR) ofnW->lpstrInitialDir);
HeapFree(GetProcessHeap(), 0, (LPWSTR) ofnW->lpstrTitle);
if ((ofnW->lpTemplateName) && (HIWORD(ofnW->lpTemplateName)))
HeapFree(GetProcessHeap(), 0, (LPWSTR) ofnW->lpTemplateName);
}

View file

@ -216,10 +216,11 @@ HRESULT WINAPI IShellBrowserImpl_QueryInterface(IShellBrowser *iface,
ULONG WINAPI IShellBrowserImpl_AddRef(IShellBrowser * iface)
{
IShellBrowserImpl *This = (IShellBrowserImpl *)iface;
ULONG ref = InterlockedIncrement(&This->ref);
TRACE("(%p,%lu)\n", This, This->ref);
TRACE("(%p,%lu)\n", This, ref - 1);
return ++(This->ref);
return ref;
}
/**************************************************************************
@ -228,16 +229,17 @@ ULONG WINAPI IShellBrowserImpl_AddRef(IShellBrowser * iface)
ULONG WINAPI IShellBrowserImpl_Release(IShellBrowser * iface)
{
IShellBrowserImpl *This = (IShellBrowserImpl *)iface;
ULONG ref = InterlockedDecrement(&This->ref);
TRACE("(%p,%lu)\n", This, This->ref);
TRACE("(%p,%lu)\n", This, ref + 1);
if (!--(This->ref))
if (!ref)
{
COMDLG32_SHFree(This);
TRACE("-- destroyed\n");
return 0;
}
return This->ref;
return ref;
}
/*

View file

@ -56,7 +56,7 @@
typedef struct
{
LPOPENFILENAMEA ofnInfos;
LPOPENFILENAMEW ofnInfos;
BOOL unicode;
LPWSTR initdir;
LPWSTR filename;

View file

@ -36,7 +36,10 @@
WINE_DEFAULT_DEBUG_CHANNEL(commdlg);
#define WINE_FONTDATA "__WINE_FONTDLGDATA"
static const WCHAR strWineFontData[] = {'_','_','W','I','N','E','_','F','O','N','T','D','L','G','D','A','T','A',0};
static const WCHAR strWineFontData_a[] =
{'_','_','W','I','N','E','_','F','O','N','T','D','L','G','D','A','T','A','_','A',0};
static const WCHAR chooseFontW[] = {'C','H','O','O','S','E','_','F','O','N','T',0};
#include "cdlg.h"
@ -44,11 +47,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(commdlg);
static HIMAGELIST himlTT = 0;
#define TTBITMAP_XSIZE 20 /* x-size of the bitmaps */
INT_PTR CALLBACK FormatCharDlgProcA(HWND hDlg, UINT uMsg, WPARAM wParam,
LPARAM lParam);
INT_PTR CALLBACK FormatCharDlgProcW(HWND hDlg, UINT uMsg, WPARAM wParam,
LPARAM lParam);
INT_PTR CALLBACK FormatCharDlgProcA(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
INT_PTR CALLBACK FormatCharDlgProcW(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
/* There is a table here of all charsets, and the sample text for each.
* There is a second table that translates a charset into an index into
@ -168,8 +168,7 @@ BOOL WINAPI ChooseFontW(LPCHOOSEFONTW lpChFont)
HINSTANCE hDlginst;
HGLOBAL hDlgTmpl;
static const WCHAR chooseFontW[] = {'C','H','O','O','S','E','_',
'F','O','N','T',0};
TRACE("(%p)\n", lpChFont);
if ( (lpChFont->Flags&CF_ENABLETEMPLATEHANDLE)!=0 )
{
@ -221,6 +220,8 @@ BOOL WINAPI ChooseFontA(LPCHOOSEFONTA lpChFont)
HINSTANCE hDlginst;
HGLOBAL hDlgTmpl;
TRACE("(%p)\n", lpChFont);
if ( (lpChFont->Flags&CF_ENABLETEMPLATEHANDLE)!=0 )
{
template=(LPCVOID)lpChFont->hInstance;
@ -238,7 +239,7 @@ BOOL WINAPI ChooseFontA(LPCHOOSEFONTA lpChFont)
} else
{
hDlginst=COMDLG32_hInstance;
if (!(hResInfo = FindResourceA(hDlginst, "CHOOSE_FONT", (LPSTR)RT_DIALOG)))
if (!(hResInfo = FindResourceW(hDlginst, chooseFontW, (LPWSTR)RT_DIALOG)))
{
COMDLG32_SetCommDlgExtendedError(CDERR_FINDRESFAILURE);
return FALSE;
@ -253,7 +254,6 @@ BOOL WINAPI ChooseFontA(LPCHOOSEFONTA lpChFont)
}
if (TRACE_ON(commdlg))
_dump_cf_flags(lpChFont->Flags);
if (lpChFont->Flags & (CF_SELECTSCRIPT | CF_NOVERTFONTS ))
FIXME(": unimplemented flag (ignored)\n");
@ -261,7 +261,6 @@ BOOL WINAPI ChooseFontA(LPCHOOSEFONTA lpChFont)
lpChFont->hwndOwner, FormatCharDlgProcA, (LPARAM)lpChFont );
}
#define TEXT_EXTRAS 4
#define TEXT_COLORS 16
@ -276,7 +275,7 @@ static const COLORREF textcolors[TEXT_COLORS]=
/***********************************************************************
* CFn_HookCallChk32 [internal]
*/
static BOOL CFn_HookCallChk32(LPCHOOSEFONTA lpcf)
static BOOL CFn_HookCallChk32(LPCHOOSEFONTW lpcf)
{
if (lpcf)
if(lpcf->Flags & CF_ENABLEHOOK)
@ -288,14 +287,14 @@ static BOOL CFn_HookCallChk32(LPCHOOSEFONTA lpcf)
/*************************************************************************
* AddFontFamily [internal]
*/
INT AddFontFamily(const ENUMLOGFONTEXA *lpElfex, const NEWTEXTMETRICEXA *lpNTM,
UINT nFontType, LPCHOOSEFONTA lpcf, HWND hwnd, LPCFn_ENUMSTRUCT e)
INT AddFontFamily(const ENUMLOGFONTEXW *lpElfex, const NEWTEXTMETRICEXW *lpNTM,
UINT nFontType, LPCHOOSEFONTW lpcf, HWND hwnd, LPCFn_ENUMSTRUCT e)
{
int i;
WORD w;
const LOGFONTA *lplf = &(lpElfex->elfLogFont);
const LOGFONTW *lplf = &(lpElfex->elfLogFont);
TRACE("font=%s (nFontType=%d)\n", lplf->lfFaceName,nFontType);
TRACE("font=%s (nFontType=%d)\n", debugstr_w(lplf->lfFaceName), nFontType);
if (lpcf->Flags & CF_FIXEDPITCHONLY)
if (!(lplf->lfPitchAndFamily & FIXED_PITCH))
@ -309,14 +308,14 @@ INT AddFontFamily(const ENUMLOGFONTEXA *lpElfex, const NEWTEXTMETRICEXA *lpNTM,
if (e) e->added++;
i=SendMessageA(hwnd, CB_FINDSTRINGEXACT, 0, (LPARAM)lplf->lfFaceName);
i=SendMessageW(hwnd, CB_FINDSTRINGEXACT, 0, (LPARAM)lplf->lfFaceName);
if (i == CB_ERR) {
i = SendMessageA(hwnd, CB_ADDSTRING, 0, (LPARAM)lplf->lfFaceName);
i = SendMessageW(hwnd, CB_ADDSTRING, 0, (LPARAM)lplf->lfFaceName);
if( i != CB_ERR) {
/* store some important font information */
w = (lplf->lfPitchAndFamily) << 8 |
(HIWORD(lpNTM->ntmTm.ntmFlags) & 0xff);
SendMessageA(hwnd, CB_SETITEMDATA, i, MAKELONG(nFontType,w));
SendMessageW(hwnd, CB_SETITEMDATA, i, MAKELONG(nFontType,w));
}
}
return 1;
@ -325,13 +324,13 @@ INT AddFontFamily(const ENUMLOGFONTEXA *lpElfex, const NEWTEXTMETRICEXA *lpNTM,
/*************************************************************************
* FontFamilyEnumProc32 [internal]
*/
static INT WINAPI FontFamilyEnumProc(const ENUMLOGFONTEXA *lpElfex,
const TEXTMETRICA *metrics, DWORD dwFontType, LPARAM lParam)
static INT WINAPI FontFamilyEnumProc(const ENUMLOGFONTEXW *lpElfex,
const TEXTMETRICW *metrics, DWORD dwFontType, LPARAM lParam)
{
LPCFn_ENUMSTRUCT e;
e=(LPCFn_ENUMSTRUCT)lParam;
return AddFontFamily( lpElfex, (NEWTEXTMETRICEXA *) metrics,
dwFontType, e->lpcf32a, e->hWnd1, e);
return AddFontFamily( lpElfex, (NEWTEXTMETRICEXW *) metrics,
dwFontType, e->lpcf32w, e->hWnd1, e);
}
/*************************************************************************
@ -339,42 +338,48 @@ static INT WINAPI FontFamilyEnumProc(const ENUMLOGFONTEXA *lpElfex,
*
* Fill font style information into combobox (without using font.c directly)
*/
static int SetFontStylesToCombo2(HWND hwnd, HDC hdc, const LOGFONTA *lplf)
static int SetFontStylesToCombo2(HWND hwnd, HDC hdc, const LOGFONTW *lplf)
{
#define FSTYLES 4
struct FONTSTYLE
{
int italic;
int weight;
const char *stname;
const WCHAR *stname;
};
static const WCHAR strRegular[] = {'R','e','g','u','l','a','r',0};
static const WCHAR strItalic[] = {'I','t','a','l','i','c',0};
static const WCHAR strBold[] = {'B','o','l','d',0};
static const WCHAR strBoldItalic[] = {'B','o','l','d',' ','I','t','a','l','i','c',0};
static const struct FONTSTYLE fontstyles[FSTYLES]={
{ 0,FW_NORMAL,"Regular"}, { 1,FW_NORMAL,"Italic"},
{ 0,FW_BOLD,"Bold"}, { 1,FW_BOLD,"Bold Italic"}
{ 0, FW_NORMAL, strRegular },
{ 1, FW_NORMAL, strItalic },
{ 0, FW_BOLD, strBold },
{ 1, FW_BOLD, strBoldItalic }
};
HFONT hf;
TEXTMETRICA tm;
TEXTMETRICW tm;
int i,j;
LOGFONTA lf;
LOGFONTW lf;
memcpy(&lf, lplf, sizeof(LOGFONTA));
memcpy(&lf, lplf, sizeof(LOGFONTW));
for (i=0;i<FSTYLES;i++)
{
lf.lfItalic=fontstyles[i].italic;
lf.lfWeight=fontstyles[i].weight;
hf=CreateFontIndirectA(&lf);
hf=CreateFontIndirectW(&lf);
hf=SelectObject(hdc,hf);
GetTextMetricsA(hdc,&tm);
GetTextMetricsW(hdc,&tm);
hf=SelectObject(hdc,hf);
DeleteObject(hf);
/* font successful created ? */
if (tm.tmWeight==fontstyles[i].weight &&
((tm.tmItalic != 0)==fontstyles[i].italic))
{
j=SendMessageA(hwnd,CB_ADDSTRING,0,(LPARAM)fontstyles[i].stname );
j=SendMessageW(hwnd,CB_ADDSTRING,0,(LPARAM)fontstyles[i].stname );
if (j==CB_ERR) return 1;
j=SendMessageA(hwnd, CB_SETITEMDATA, j,
j=SendMessageW(hwnd, CB_SETITEMDATA, j,
MAKELONG(fontstyles[i].weight,fontstyles[i].italic));
if (j==CB_ERR) return 1;
}
@ -385,20 +390,21 @@ static int SetFontStylesToCombo2(HWND hwnd, HDC hdc, const LOGFONTA *lplf)
/*************************************************************************
* AddFontSizeToCombo3 [internal]
*/
static int AddFontSizeToCombo3(HWND hwnd, UINT h, LPCHOOSEFONTA lpcf)
static int AddFontSizeToCombo3(HWND hwnd, UINT h, LPCHOOSEFONTW lpcf)
{
int j;
char buffer[20];
WCHAR buffer[20];
static const WCHAR strFormat[] = {'%','2','d',0};
if ( (!(lpcf->Flags & CF_LIMITSIZE)) ||
((lpcf->Flags & CF_LIMITSIZE) && (h >= lpcf->nSizeMin) && (h <= lpcf->nSizeMax)))
{
sprintf(buffer, "%2d", h);
j=SendMessageA(hwnd, CB_FINDSTRINGEXACT, -1, (LPARAM)buffer);
wsprintfW(buffer, strFormat, h);
j=SendMessageW(hwnd, CB_FINDSTRINGEXACT, -1, (LPARAM)buffer);
if (j==CB_ERR)
{
j=SendMessageA(hwnd, CB_ADDSTRING, 0, (LPARAM)buffer);
if (j!=CB_ERR) j = SendMessageA(hwnd, CB_SETITEMDATA, j, h);
j=SendMessageW(hwnd, CB_ADDSTRING, 0, (LPARAM)buffer);
if (j!=CB_ERR) j = SendMessageW(hwnd, CB_SETITEMDATA, j, h);
if (j==CB_ERR) return 1;
}
}
@ -408,9 +414,9 @@ static int AddFontSizeToCombo3(HWND hwnd, UINT h, LPCHOOSEFONTA lpcf)
/*************************************************************************
* SetFontSizesToCombo3 [internal]
*/
static int SetFontSizesToCombo3(HWND hwnd, LPCHOOSEFONTA lpcf)
static int SetFontSizesToCombo3(HWND hwnd, LPCHOOSEFONTW lpcf)
{
static const char sizes[]={8,9,10,11,12,14,16,18,20,22,24,26,28,36,48,72};
static const BYTE sizes[]={8,9,10,11,12,14,16,18,20,22,24,26,28,36,48,72};
int i;
for (i = 0; i < sizeof(sizes)/sizeof(sizes[0]); i++)
@ -421,7 +427,7 @@ static int SetFontSizesToCombo3(HWND hwnd, LPCHOOSEFONTA lpcf)
/*************************************************************************
* CFn_GetDC [internal]
*/
inline HDC CFn_GetDC(LPCHOOSEFONTA lpcf)
inline HDC CFn_GetDC(LPCHOOSEFONTW lpcf)
{
HDC ret = ((lpcf->Flags & CF_PRINTERFONTS) && lpcf->hDC) ?
lpcf->hDC :
@ -433,7 +439,7 @@ inline HDC CFn_GetDC(LPCHOOSEFONTA lpcf)
/*************************************************************************
* CFn_ReleaseDC [internal]
*/
inline void CFn_ReleaseDC(LPCHOOSEFONTA lpcf, HDC hdc)
inline void CFn_ReleaseDC(LPCHOOSEFONTW lpcf, HDC hdc)
{
if(!((lpcf->Flags & CF_PRINTERFONTS) && lpcf->hDC))
ReleaseDC(0, hdc);
@ -442,19 +448,19 @@ inline void CFn_ReleaseDC(LPCHOOSEFONTA lpcf, HDC hdc)
/***********************************************************************
* AddFontStyle [internal]
*/
INT AddFontStyle( const ENUMLOGFONTEXA *lpElfex, const NEWTEXTMETRICEXA *lpNTM,
UINT nFontType, LPCHOOSEFONTA lpcf, HWND hcmb2, HWND hcmb3,
INT AddFontStyle( const ENUMLOGFONTEXW *lpElfex, const NEWTEXTMETRICEXW *lpNTM,
UINT nFontType, LPCHOOSEFONTW lpcf, HWND hcmb2, HWND hcmb3,
HWND hDlg, BOOL iswin16)
{
int i;
const LOGFONTA *lplf = &(lpElfex->elfLogFont);
const LOGFONTW *lplf = &(lpElfex->elfLogFont);
HWND hcmb5;
HDC hdc;
TRACE("(nFontType=%d)\n",nFontType);
TRACE(" %s h=%ld w=%ld e=%ld o=%ld wg=%ld i=%d u=%d s=%d"
" ch=%d op=%d cp=%d q=%d pf=%xh\n",
lplf->lfFaceName,lplf->lfHeight,lplf->lfWidth,
debugstr_w(lplf->lfFaceName),lplf->lfHeight,lplf->lfWidth,
lplf->lfEscapement,lplf->lfOrientation,
lplf->lfWeight,lplf->lfItalic,lplf->lfUnderline,
lplf->lfStrikeOut,lplf->lfCharSet, lplf->lfOutPrecision,
@ -467,10 +473,10 @@ INT AddFontStyle( const ENUMLOGFONTEXA *lpElfex, const NEWTEXTMETRICEXA *lpNTM,
72, GetDeviceCaps(hdc, LOGPIXELSY));
CFn_ReleaseDC(lpcf, hdc);
i = AddFontSizeToCombo3(hcmb3, points, lpcf);
if( i) return 0;
if(i) return 0;
} else if (SetFontSizesToCombo3(hcmb3, lpcf)) return 0;
if (!SendMessageA(hcmb2, CB_GETCOUNT, 0, 0))
if (!SendMessageW(hcmb2, CB_GETCOUNT, 0, 0))
{
if(!(hdc = CFn_GetDC(lpcf))) return 0;
i=SetFontStylesToCombo2(hcmb2,hdc,lplf);
@ -479,13 +485,13 @@ INT AddFontStyle( const ENUMLOGFONTEXA *lpElfex, const NEWTEXTMETRICEXA *lpNTM,
return 0;
}
if( iswin16 || !( hcmb5 = GetDlgItem(hDlg, cmb5))) return 1;
i = SendMessageA( hcmb5, CB_FINDSTRINGEXACT, 0,
i = SendMessageW( hcmb5, CB_FINDSTRINGEXACT, 0,
(LPARAM)lpElfex->elfScript);
if( i == CB_ERR) {
i = SendMessageA( hcmb5, CB_ADDSTRING, 0,
i = SendMessageW( hcmb5, CB_ADDSTRING, 0,
(LPARAM)lpElfex->elfScript);
if( i != CB_ERR)
SendMessageA( hcmb5, CB_SETITEMDATA, i, lplf->lfCharSet);
SendMessageW( hcmb5, CB_SETITEMDATA, i, lplf->lfCharSet);
}
return 1 ;
}
@ -495,14 +501,14 @@ static INT CFn_FitFontSize( HWND hDlg, int points)
int i,n;
int ret = 0;
/* look for fitting font size in combobox3 */
n=SendDlgItemMessageA(hDlg, cmb3, CB_GETCOUNT, 0, 0);
n=SendDlgItemMessageW(hDlg, cmb3, CB_GETCOUNT, 0, 0);
for (i=0;i<n;i++)
{
if (points == (int)SendDlgItemMessageA
if (points == (int)SendDlgItemMessageW
(hDlg,cmb3, CB_GETITEMDATA,i,0))
{
SendDlgItemMessageA(hDlg,cmb3,CB_SETCURSEL,i,0);
SendMessageA(hDlg, WM_COMMAND,
SendDlgItemMessageW(hDlg,cmb3,CB_SETCURSEL,i,0);
SendMessageW(hDlg, WM_COMMAND,
MAKEWPARAM(cmb3, CBN_SELCHANGE),
(LPARAM)GetDlgItem(hDlg,cmb3));
ret = 1;
@ -519,11 +525,11 @@ static INT CFn_FitFontStyle( HWND hDlg, LONG packedstyle )
/* look for fitting font style in combobox2 */
for (i=0;i<TEXT_EXTRAS;i++)
{
id =SendDlgItemMessageA(hDlg, cmb2, CB_GETITEMDATA, i, 0);
id = SendDlgItemMessageW(hDlg, cmb2, CB_GETITEMDATA, i, 0);
if (packedstyle == id)
{
SendDlgItemMessageA(hDlg, cmb2, CB_SETCURSEL, i, 0);
SendMessageA(hDlg, WM_COMMAND, MAKEWPARAM(cmb2, CBN_SELCHANGE),
SendDlgItemMessageW(hDlg, cmb2, CB_SETCURSEL, i, 0);
SendMessageW(hDlg, WM_COMMAND, MAKEWPARAM(cmb2, CBN_SELCHANGE),
(LPARAM)GetDlgItem(hDlg,cmb2));
ret = 1;
break;
@ -537,21 +543,21 @@ static INT CFn_FitCharSet( HWND hDlg, int charset )
{
int i,n,cs;
/* look for fitting char set in combobox5 */
n=SendDlgItemMessageA(hDlg, cmb5, CB_GETCOUNT, 0, 0);
n=SendDlgItemMessageW(hDlg, cmb5, CB_GETCOUNT, 0, 0);
for (i=0;i<n;i++)
{
cs =SendDlgItemMessageA(hDlg, cmb5, CB_GETITEMDATA, i, 0);
cs =SendDlgItemMessageW(hDlg, cmb5, CB_GETITEMDATA, i, 0);
if (charset == cs)
{
SendDlgItemMessageA(hDlg, cmb5, CB_SETCURSEL, i, 0);
SendMessageA(hDlg, WM_COMMAND, MAKEWPARAM(cmb5, CBN_SELCHANGE),
SendDlgItemMessageW(hDlg, cmb5, CB_SETCURSEL, i, 0);
SendMessageW(hDlg, WM_COMMAND, MAKEWPARAM(cmb5, CBN_SELCHANGE),
(LPARAM)GetDlgItem(hDlg,cmb2));
return 1;
}
}
/* no charset fits: select the first one in the list */
SendDlgItemMessageA(hDlg, cmb5, CB_SETCURSEL, 0, 0);
SendMessageA(hDlg, WM_COMMAND, MAKEWPARAM(cmb5, CBN_SELCHANGE),
SendDlgItemMessageW(hDlg, cmb5, CB_SETCURSEL, 0, 0);
SendMessageW(hDlg, WM_COMMAND, MAKEWPARAM(cmb5, CBN_SELCHANGE),
(LPARAM)GetDlgItem(hDlg,cmb2));
return 0;
}
@ -559,42 +565,43 @@ static INT CFn_FitCharSet( HWND hDlg, int charset )
/***********************************************************************
* FontStyleEnumProc32 [internal]
*/
static INT WINAPI FontStyleEnumProc( const ENUMLOGFONTEXA *lpElfex,
const TEXTMETRICA *metrics, DWORD dwFontType, LPARAM lParam )
static INT WINAPI FontStyleEnumProc( const ENUMLOGFONTEXW *lpElfex,
const TEXTMETRICW *metrics, DWORD dwFontType, LPARAM lParam )
{
LPCFn_ENUMSTRUCT s=(LPCFn_ENUMSTRUCT)lParam;
HWND hcmb2=s->hWnd1;
HWND hcmb3=s->hWnd2;
HWND hDlg=GetParent(hcmb3);
return AddFontStyle( lpElfex, (const NEWTEXTMETRICEXA *) metrics,
dwFontType, s->lpcf32a, hcmb2, hcmb3, hDlg, FALSE);
return AddFontStyle( lpElfex, (const NEWTEXTMETRICEXW *) metrics,
dwFontType, s->lpcf32w, hcmb2, hcmb3, hDlg, FALSE);
}
/***********************************************************************
* CFn_WMInitDialog [internal]
*/
LRESULT CFn_WMInitDialog(HWND hDlg, WPARAM wParam, LPARAM lParam,
LPCHOOSEFONTA lpcf)
LPCHOOSEFONTW lpcf)
{
HDC hdc;
int i,j,init=0;
long pstyle;
CFn_ENUMSTRUCT s;
LPLOGFONTA lpxx;
HCURSOR hcursor=SetCursor(LoadCursorA(0,(LPSTR)IDC_WAIT));
LPLOGFONTW lpxx;
HCURSOR hcursor=SetCursor(LoadCursorW(0,(LPWSTR)IDC_WAIT));
static const WCHAR strColorName[] = {'[','c','o','l','o','r',' ','n','a','m','e',']',0};
SetPropA(hDlg, WINE_FONTDATA, (HANDLE)lParam);
SetPropW(hDlg, strWineFontData, (HANDLE)lParam);
lpxx=lpcf->lpLogFont;
TRACE("WM_INITDIALOG lParam=%08lX\n", lParam);
if (lpcf->lStructSize != sizeof(CHOOSEFONTA))
if (lpcf->lStructSize != sizeof(CHOOSEFONTW))
{
ERR("structure size failure !!!\n");
EndDialog (hDlg, 0);
return FALSE;
}
if (!himlTT)
himlTT = ImageList_LoadImageA( COMDLG32_hInstance, MAKEINTRESOURCEA(38),
himlTT = ImageList_LoadImageW( COMDLG32_hInstance, MAKEINTRESOURCEW(38),
TTBITMAP_XSIZE, 0, CLR_DEFAULT, IMAGE_BITMAP, 0);
if (!(lpcf->Flags & CF_SHOWHELP) || !IsWindow(lpcf->hwndOwner))
@ -605,18 +612,18 @@ LRESULT CFn_WMInitDialog(HWND hDlg, WPARAM wParam, LPARAM lParam,
{
for (i=0;i<TEXT_COLORS;i++)
{
char name[30];
WCHAR name[30];
if( LoadStringA(COMDLG32_hInstance, IDS_COLOR_BLACK+i, name,
if( LoadStringW(COMDLG32_hInstance, IDS_COLOR_BLACK+i, name,
sizeof(name)/sizeof(*name) )==0 )
{
strcpy( name, "[color name]" );
memcpy(name, strColorName, sizeof(strColorName));
}
j=SendDlgItemMessageA(hDlg, cmb4, CB_ADDSTRING, 0, (LPARAM)name);
SendDlgItemMessageA(hDlg, cmb4, CB_SETITEMDATA, j, textcolors[j]);
j=SendDlgItemMessageW(hDlg, cmb4, CB_ADDSTRING, 0, (LPARAM)name);
SendDlgItemMessageW(hDlg, cmb4, CB_SETITEMDATA, j, textcolors[j]);
/* look for a fitting value in color combobox */
if (textcolors[j]==lpcf->rgbColors)
SendDlgItemMessageA(hDlg,cmb4, CB_SETCURSEL,j,0);
SendDlgItemMessageW(hDlg,cmb4, CB_SETCURSEL,j,0);
}
}
else
@ -633,14 +640,14 @@ LRESULT CFn_WMInitDialog(HWND hDlg, WPARAM wParam, LPARAM lParam,
return FALSE;
}
s.hWnd1=GetDlgItem(hDlg,cmb1);
s.lpcf32a=lpcf;
s.lpcf32w=lpcf;
do {
LOGFONTA elf;
LOGFONTW elf;
s.added = 0;
elf.lfCharSet = DEFAULT_CHARSET; /* enum all charsets */
elf.lfPitchAndFamily = 0;
elf.lfFaceName[0] = '\0'; /* enum all fonts */
if (!EnumFontFamiliesExA(hdc, &elf, (FONTENUMPROCA)FontFamilyEnumProc, (LPARAM)&s, 0))
if (!EnumFontFamiliesExW(hdc, &elf, (FONTENUMPROCW)FontFamilyEnumProc, (LPARAM)&s, 0))
{
TRACE("EnumFontFamiliesEx returns 0\n");
break;
@ -663,7 +670,7 @@ LRESULT CFn_WMInitDialog(HWND hDlg, WPARAM wParam, LPARAM lParam,
if (lpcf->Flags & CF_INITTOLOGFONTSTRUCT)
{
/* look for fitting font name in combobox1 */
j=SendDlgItemMessageA(hDlg,cmb1,CB_FINDSTRING,-1,(LONG)lpxx->lfFaceName);
j=SendDlgItemMessageW(hDlg,cmb1,CB_FINDSTRING,-1,(LONG)lpxx->lfFaceName);
if (j!=CB_ERR)
{
INT height = lpxx->lfHeight < 0 ? -lpxx->lfHeight :
@ -673,8 +680,8 @@ LRESULT CFn_WMInitDialog(HWND hDlg, WPARAM wParam, LPARAM lParam,
points = MulDiv( height, 72, GetDeviceCaps(hdc, LOGPIXELSY));
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),
SendDlgItemMessageW(hDlg, cmb1, CB_SETCURSEL, j, 0);
SendMessageW(hDlg, WM_COMMAND, MAKEWPARAM(cmb1, CBN_SELCHANGE),
(LPARAM)GetDlgItem(hDlg,cmb1));
init=1;
/* look for fitting font style in combobox2 */
@ -686,17 +693,17 @@ LRESULT CFn_WMInitDialog(HWND hDlg, WPARAM wParam, LPARAM lParam,
}
if (!init)
{
SendDlgItemMessageA(hDlg,cmb1,CB_SETCURSEL,0,0);
SendMessageA(hDlg, WM_COMMAND, MAKEWPARAM(cmb1, CBN_SELCHANGE),
SendDlgItemMessageW(hDlg,cmb1,CB_SETCURSEL,0,0);
SendMessageW(hDlg, WM_COMMAND, MAKEWPARAM(cmb1, CBN_SELCHANGE),
(LPARAM)GetDlgItem(hDlg,cmb1));
}
if (lpcf->Flags & CF_USESTYLE && lpcf->lpszStyle)
{
j=SendDlgItemMessageA(hDlg,cmb2,CB_FINDSTRING,-1,(LONG)lpcf->lpszStyle);
j=SendDlgItemMessageW(hDlg,cmb2,CB_FINDSTRING,-1,(LONG)lpcf->lpszStyle);
if (j!=CB_ERR)
{
j=SendDlgItemMessageA(hDlg,cmb2,CB_SETCURSEL,j,0);
SendMessageA(hDlg,WM_COMMAND,cmb2,
j=SendDlgItemMessageW(hDlg,cmb2,CB_SETCURSEL,j,0);
SendMessageW(hDlg,WM_COMMAND,cmb2,
MAKELONG(HWND_16(GetDlgItem(hDlg,cmb2)),CBN_SELCHANGE));
}
}
@ -716,18 +723,18 @@ LRESULT CFn_WMMeasureItem(HWND hDlg, WPARAM wParam, LPARAM lParam)
TEXTMETRICW tm;
LPMEASUREITEMSTRUCT lpmi=(LPMEASUREITEMSTRUCT)lParam;
if (!himlTT)
himlTT = ImageList_LoadImageA( COMDLG32_hInstance, MAKEINTRESOURCEA(38),
himlTT = ImageList_LoadImageW( COMDLG32_hInstance, MAKEINTRESOURCEW(38),
TTBITMAP_XSIZE, 0, CLR_DEFAULT, IMAGE_BITMAP, 0);
ImageList_GetIconSize( himlTT, 0, &lpmi->itemHeight);
lpmi->itemHeight += 2;
/* use MAX of bitmap height and tm.tmHeight .*/
hdc=GetDC( hDlg);
hdc=GetDC(hDlg);
if(!hdc) return 0;
hfontprev = SelectObject( hdc, GetStockObject( SYSTEM_FONT));
GetTextMetricsW( hdc, &tm);
GetTextMetricsW(hdc, &tm);
if( tm.tmHeight > lpmi->itemHeight) lpmi->itemHeight = tm.tmHeight;
SelectObject( hdc, hfontprev);
ReleaseDC( hDlg, hdc);
SelectObject(hdc, hfontprev);
ReleaseDC(hDlg, hdc);
return 0;
}
@ -738,7 +745,7 @@ LRESULT CFn_WMMeasureItem(HWND hDlg, WPARAM wParam, LPARAM lParam)
LRESULT CFn_WMDrawItem(HWND hDlg, WPARAM wParam, LPARAM lParam)
{
HBRUSH hBrush;
char buffer[40];
WCHAR buffer[40];
COLORREF cr, oldText=0, oldBk=0;
RECT rect;
int nFontType;
@ -771,11 +778,11 @@ LRESULT CFn_WMDrawItem(HWND hDlg, WPARAM wParam, LPARAM lParam)
{
case cmb1:
/* TRACE(commdlg,"WM_Drawitem cmb1\n"); */
SendMessageA(lpdi->hwndItem, CB_GETLBTEXT, lpdi->itemID,
SendMessageW(lpdi->hwndItem, CB_GETLBTEXT, lpdi->itemID,
(LPARAM)buffer);
TextOutA(lpdi->hDC, lpdi->rcItem.left + TTBITMAP_XSIZE + 10,
lpdi->rcItem.top, buffer, strlen(buffer));
nFontType = SendMessageA(lpdi->hwndItem, CB_GETITEMDATA, lpdi->itemID,0L);
TextOutW(lpdi->hDC, lpdi->rcItem.left + TTBITMAP_XSIZE + 10,
lpdi->rcItem.top, buffer, lstrlenW(buffer));
nFontType = SendMessageW(lpdi->hwndItem, CB_GETITEMDATA, lpdi->itemID,0L);
idx = -1;
if (nFontType & TRUETYPE_FONTTYPE) {
idx = 0; /* picture: TT */
@ -795,19 +802,19 @@ LRESULT CFn_WMDrawItem(HWND hDlg, WPARAM wParam, LPARAM lParam)
case cmb3:
/* TRACE(commdlg,"WM_DRAWITEN cmb2,cmb3\n"); */
case cmb5:
SendMessageA(lpdi->hwndItem, CB_GETLBTEXT, lpdi->itemID,
SendMessageW(lpdi->hwndItem, CB_GETLBTEXT, lpdi->itemID,
(LPARAM)buffer);
TextOutA(lpdi->hDC, lpdi->rcItem.left,
lpdi->rcItem.top, buffer, strlen(buffer));
TextOutW(lpdi->hDC, lpdi->rcItem.left,
lpdi->rcItem.top, buffer, lstrlenW(buffer));
break;
case cmb4:
/* TRACE(commdlg,"WM_DRAWITEM cmb4 (=COLOR)\n"); */
SendMessageA(lpdi->hwndItem, CB_GETLBTEXT, lpdi->itemID,
(LPARAM)buffer);
TextOutA(lpdi->hDC, lpdi->rcItem.left + 25+5,
lpdi->rcItem.top, buffer, strlen(buffer));
cr = SendMessageA(lpdi->hwndItem, CB_GETITEMDATA, lpdi->itemID,0L);
SendMessageW(lpdi->hwndItem, CB_GETLBTEXT, lpdi->itemID,
(LPARAM)buffer);
TextOutW(lpdi->hDC, lpdi->rcItem.left + 25+5,
lpdi->rcItem.top, buffer, lstrlenW(buffer));
cr = SendMessageW(lpdi->hwndItem, CB_GETITEMDATA, lpdi->itemID,0L);
hBrush = CreateSolidBrush(cr);
if (hBrush)
{
@ -840,12 +847,12 @@ LRESULT CFn_WMDrawItem(HWND hDlg, WPARAM wParam, LPARAM lParam)
* CFn_WMCommand [internal]
*/
LRESULT CFn_WMCommand(HWND hDlg, WPARAM wParam, LPARAM lParam,
LPCHOOSEFONTA lpcf)
LPCHOOSEFONTW lpcf)
{
int i;
long l;
HDC hdc;
LPLOGFONTA lpxx=lpcf->lpLogFont;
LPLOGFONTW lpxx=lpcf->lpLogFont;
TRACE("WM_COMMAND wParam=%08lX lParam=%08lX\n", (LONG)wParam, lParam);
switch (LOWORD(wParam))
@ -862,33 +869,33 @@ LRESULT CFn_WMCommand(HWND hDlg, WPARAM wParam, LPARAM lParam,
EndDialog (hDlg, 0);
return TRUE;
}
idx = SendDlgItemMessageA(hDlg, cmb3, CB_GETCURSEL, 0, 0);
pointsize = (int)SendDlgItemMessageA( hDlg, cmb3, CB_GETITEMDATA,
idx = SendDlgItemMessageW(hDlg, cmb3, CB_GETCURSEL, 0, 0);
pointsize = (int)SendDlgItemMessageW( hDlg, cmb3, CB_GETITEMDATA,
idx, 0);
idx = SendDlgItemMessageA(hDlg, cmb2, CB_GETCURSEL, 0, 0);
pstyle = SendDlgItemMessageA(hDlg, cmb2, CB_GETITEMDATA, idx, 0);
idx = SendDlgItemMessageA(hDlg, cmb5, CB_GETCURSEL, 0, 0);
charset = SendDlgItemMessageA(hDlg, cmb5, CB_GETITEMDATA, idx, 0);
idx = SendDlgItemMessageW(hDlg, cmb2, CB_GETCURSEL, 0, 0);
pstyle = SendDlgItemMessageW(hDlg, cmb2, CB_GETITEMDATA, idx, 0);
idx = SendDlgItemMessageW(hDlg, cmb5, CB_GETCURSEL, 0, 0);
charset = SendDlgItemMessageW(hDlg, cmb5, CB_GETITEMDATA, idx, 0);
SendDlgItemMessageA(hDlg, cmb2, CB_RESETCONTENT, 0, 0);
SendDlgItemMessageA(hDlg, cmb3, CB_RESETCONTENT, 0, 0);
SendDlgItemMessageA(hDlg, cmb5, CB_RESETCONTENT, 0, 0);
i=SendDlgItemMessageA(hDlg, cmb1, CB_GETCURSEL, 0, 0);
SendDlgItemMessageW(hDlg, cmb2, CB_RESETCONTENT, 0, 0);
SendDlgItemMessageW(hDlg, cmb3, CB_RESETCONTENT, 0, 0);
SendDlgItemMessageW(hDlg, cmb5, CB_RESETCONTENT, 0, 0);
i=SendDlgItemMessageW(hDlg, cmb1, CB_GETCURSEL, 0, 0);
if (i!=CB_ERR)
{
HCURSOR hcursor=SetCursor(LoadCursorA(0,(LPSTR)IDC_WAIT));
HCURSOR hcursor=SetCursor(LoadCursorW(0,(LPWSTR)IDC_WAIT));
CFn_ENUMSTRUCT s;
LOGFONTA enumlf;
SendDlgItemMessageA(hDlg, cmb1, CB_GETLBTEXT, i,
LOGFONTW enumlf;
SendDlgItemMessageW(hDlg, cmb1, CB_GETLBTEXT, i,
(LPARAM)enumlf.lfFaceName);
TRACE("WM_COMMAND/cmb1 =>%s\n",enumlf.lfFaceName);
TRACE("WM_COMMAND/cmb1 =>%s\n", debugstr_w(enumlf.lfFaceName));
s.hWnd1=GetDlgItem(hDlg, cmb2);
s.hWnd2=GetDlgItem(hDlg, cmb3);
s.lpcf32a=lpcf;
s.lpcf32w=lpcf;
enumlf.lfCharSet = DEFAULT_CHARSET; /* enum all charsets */
enumlf.lfPitchAndFamily = 0;
EnumFontFamiliesExA(hdc, &enumlf,
(FONTENUMPROCA)FontStyleEnumProc, (LPARAM)&s, 0);
EnumFontFamiliesExW(hdc, &enumlf,
(FONTENUMPROCW)FontStyleEnumProc, (LPARAM)&s, 0);
CFn_FitFontStyle(hDlg, pstyle);
if( pointsize != CB_ERR) CFn_FitFontSize(hDlg, pointsize);
if( charset != CB_ERR) CFn_FitCharSet( hDlg, charset );
@ -903,37 +910,37 @@ LRESULT CFn_WMCommand(HWND hDlg, WPARAM wParam, LPARAM lParam,
case cmb5:
if (HIWORD(wParam)==CBN_SELCHANGE || HIWORD(wParam)== BN_CLICKED )
{
char str[256];
WCHAR str[256];
WINDOWINFO wininfo;
TRACE("WM_COMMAND/cmb2,3 =%08lX\n", lParam);
i=SendDlgItemMessageA(hDlg,cmb1,CB_GETCURSEL,0,0);
i=SendDlgItemMessageW(hDlg,cmb1,CB_GETCURSEL,0,0);
if (i==CB_ERR)
i=GetDlgItemTextA( hDlg, cmb1, str, 256 );
i=GetDlgItemTextW( hDlg, cmb1, str, 256 );
else
{
SendDlgItemMessageA(hDlg,cmb1,CB_GETLBTEXT,i,
SendDlgItemMessageW(hDlg,cmb1,CB_GETLBTEXT,i,
(LPARAM)str);
l=SendDlgItemMessageA(hDlg,cmb1,CB_GETITEMDATA,i,0);
l=SendDlgItemMessageW(hDlg,cmb1,CB_GETITEMDATA,i,0);
lpcf->nFontType = LOWORD(l);
/* FIXME: lpcf->nFontType |= .... SIMULATED_FONTTYPE and so */
/* same value reported to the EnumFonts
call back with the extra FONTTYPE_... bits added */
lpxx->lfPitchAndFamily = HIWORD(l) >> 8;
}
strcpy(lpxx->lfFaceName,str);
i=SendDlgItemMessageA(hDlg, cmb2, CB_GETCURSEL, 0, 0);
lstrcpyW(lpxx->lfFaceName,str);
i=SendDlgItemMessageW(hDlg, cmb2, CB_GETCURSEL, 0, 0);
if (i!=CB_ERR)
{
l=SendDlgItemMessageA(hDlg, cmb2, CB_GETITEMDATA, i, 0);
l=SendDlgItemMessageW(hDlg, cmb2, CB_GETITEMDATA, i, 0);
if (0!=(lpxx->lfItalic=HIWORD(l)))
lpcf->nFontType |= ITALIC_FONTTYPE;
if ((lpxx->lfWeight=LOWORD(l)) > FW_MEDIUM)
lpcf->nFontType |= BOLD_FONTTYPE;
}
i=SendDlgItemMessageA(hDlg, cmb3, CB_GETCURSEL, 0, 0);
i=SendDlgItemMessageW(hDlg, cmb3, CB_GETCURSEL, 0, 0);
if( i != CB_ERR)
lpcf->iPointSize = 10 * LOWORD(SendDlgItemMessageA(hDlg, cmb3,
lpcf->iPointSize = 10 * LOWORD(SendDlgItemMessageW(hDlg, cmb3,
CB_GETITEMDATA , i, 0));
else
lpcf->iPointSize = 100;
@ -945,9 +952,9 @@ LRESULT CFn_WMCommand(HWND hDlg, WPARAM wParam, LPARAM lParam,
CFn_ReleaseDC(lpcf, hdc);
} else
lpxx->lfHeight = -lpcf->iPointSize / 10;
i=SendDlgItemMessageA(hDlg, cmb5, CB_GETCURSEL, 0, 0);
i=SendDlgItemMessageW(hDlg, cmb5, CB_GETCURSEL, 0, 0);
if (i!=CB_ERR)
lpxx->lfCharSet=SendDlgItemMessageA(hDlg, cmb5, CB_GETITEMDATA, i, 0);
lpxx->lfCharSet=SendDlgItemMessageW(hDlg, cmb5, CB_GETITEMDATA, i, 0);
else
lpxx->lfCharSet = DEFAULT_CHARSET;
lpxx->lfStrikeOut=IsDlgButtonChecked(hDlg,chx1);
@ -968,7 +975,7 @@ LRESULT CFn_WMCommand(HWND hDlg, WPARAM wParam, LPARAM lParam,
break;
case cmb4:
i=SendDlgItemMessageA(hDlg, cmb4, CB_GETCURSEL, 0, 0);
i=SendDlgItemMessageW(hDlg, cmb4, CB_GETCURSEL, 0, 0);
if (i!=CB_ERR)
{
WINDOWINFO wininfo;
@ -985,9 +992,9 @@ LRESULT CFn_WMCommand(HWND hDlg, WPARAM wParam, LPARAM lParam,
break;
case psh15:
i=RegisterWindowMessageA( HELPMSGSTRINGA );
i=RegisterWindowMessageW( HELPMSGSTRINGW );
if (lpcf->hwndOwner)
SendMessageA(lpcf->hwndOwner, i, 0, (LPARAM)GetPropA(hDlg, WINE_FONTDATA));
SendMessageW(lpcf->hwndOwner, i, 0, (LPARAM)GetPropW(hDlg, strWineFontData));
/* if (CFn_HookCallChk(lpcf))
CallWindowProc16(lpcf->lpfnHook,hDlg,WM_COMMAND,psh15,(LPARAM)lpcf);*/
break;
@ -1000,10 +1007,11 @@ LRESULT CFn_WMCommand(HWND hDlg, WPARAM wParam, LPARAM lParam,
EndDialog(hDlg, TRUE);
else
{
char buffer[80];
sprintf(buffer,"Select a font size between %d and %d points.",
lpcf->nSizeMin,lpcf->nSizeMax);
MessageBoxA(hDlg, buffer, NULL, MB_OK);
WCHAR buffer[80];
WCHAR format[80];
LoadStringW(COMDLG32_hInstance, IDS_FONT_SIZE, format, sizeof(format)/sizeof(WCHAR));
wsprintfW(buffer, format, lpcf->nSizeMin,lpcf->nSizeMax);
MessageBoxW(hDlg, buffer, NULL, MB_OK);
}
return(TRUE);
case IDCANCEL:
@ -1013,18 +1021,44 @@ LRESULT CFn_WMCommand(HWND hDlg, WPARAM wParam, LPARAM lParam,
return(FALSE);
}
LRESULT CFn_WMDestroy(HWND hwnd, WPARAM wParam, LPARAM lParam)
LRESULT CFn_WMDestroy(HWND hwnd, WPARAM wParam, LPARAM lParam, LPCHOOSEFONTW lpcfw)
{
LPCHOOSEFONTA lpcfa;
LPCSTR lpTemplateName;
LPSTR lpszStyle;
LPLOGFONTA lpLogFonta;
int len;
lpcfa = GetPropW(hwnd, strWineFontData_a);
lpLogFonta = lpcfa->lpLogFont;
lpTemplateName = lpcfa->lpTemplateName;
lpszStyle = lpcfa->lpszStyle;
memcpy(lpcfa, lpcfw, sizeof(CHOOSEFONTA));
lpcfa->lpLogFont = lpLogFonta;
lpcfa->lpTemplateName = lpTemplateName;
lpcfa->lpszStyle = lpszStyle;
memcpy(lpcfa->lpLogFont, lpcfw->lpLogFont, sizeof(LOGFONTA));
WideCharToMultiByte(CP_ACP, 0, lpcfw->lpLogFont->lfFaceName,
LF_FACESIZE, lpcfa->lpLogFont->lfFaceName, LF_FACESIZE, 0, 0);
if(lpcfw->lpszStyle) {
len = WideCharToMultiByte(CP_ACP, 0, lpcfw->lpszStyle, -1, NULL, -1, 0, 0);
WideCharToMultiByte(CP_ACP, 0, lpcfw->lpszStyle, -1, lpcfa->lpszStyle, len, 0, 0);
HeapFree(GetProcessHeap(), 0, lpcfw->lpszStyle);
}
HeapFree(GetProcessHeap(), 0, (LPBYTE)lpcfw->lpTemplateName);
HeapFree(GetProcessHeap(), 0, lpcfw->lpLogFont);
HeapFree(GetProcessHeap(), 0, lpcfw);
return TRUE;
}
LRESULT CFn_WMPaint(HWND hDlg, WPARAM wParam, LPARAM lParam,
LPCHOOSEFONTA lpcf )
LRESULT CFn_WMPaint(HWND hDlg, WPARAM wParam, LPARAM lParam, LPCHOOSEFONTW lpcf)
{
WINDOWINFO info;
info.cbSize=sizeof(info);
if( GetWindowInfo( GetDlgItem( hDlg, stc5), &info ) )
{
PAINTSTRUCT ps;
@ -1032,7 +1066,7 @@ LRESULT CFn_WMPaint(HWND hDlg, WPARAM wParam, LPARAM lParam,
HPEN hOrigPen;
HFONT hOrigFont;
COLORREF rgbPrev;
LOGFONTA lf = *(lpcf->lpLogFont);
LOGFONTW lf = *(lpcf->lpLogFont);
MapWindowPoints( 0, hDlg, (LPPOINT) &info.rcWindow, 2);
hdc = BeginPaint( hDlg, &ps );
@ -1058,7 +1092,7 @@ LRESULT CFn_WMPaint(HWND hDlg, WPARAM wParam, LPARAM lParam,
info.rcWindow.bottom--;
info.rcWindow.top++;
info.rcWindow.left++;
hOrigFont = SelectObject( hdc, CreateFontIndirectA( &lf ) );
hOrigFont = SelectObject( hdc, CreateFontIndirectW( &lf ) );
rgbPrev=SetTextColor( hdc, lpcf->rgbColors );
DrawTextW( hdc,
@ -1077,29 +1111,50 @@ LRESULT CFn_WMPaint(HWND hDlg, WPARAM wParam, LPARAM lParam,
INT_PTR CALLBACK FormatCharDlgProcA(HWND hDlg, UINT uMsg, WPARAM wParam,
LPARAM lParam)
{
LPCHOOSEFONTA lpcf;
LPCHOOSEFONTW lpcfw;
LPCHOOSEFONTA lpcfa;
INT_PTR res = FALSE;
int len;
if (uMsg!=WM_INITDIALOG)
{
lpcf=(LPCHOOSEFONTA)GetPropA(hDlg, WINE_FONTDATA);
if (!lpcf && uMsg != WM_MEASUREITEM)
if (uMsg!=WM_INITDIALOG) {
lpcfw = (LPCHOOSEFONTW)GetPropW(hDlg, strWineFontData);
if (!lpcfw)
return FALSE;
if (CFn_HookCallChk32(lpcf))
res=CallWindowProcA((WNDPROC)lpcf->lpfnHook, hDlg, uMsg, wParam, lParam);
if (CFn_HookCallChk32(lpcfw))
res=CallWindowProcA((WNDPROC)lpcfw->lpfnHook, hDlg, uMsg, wParam, lParam);
if (res)
return res;
}
else
{
lpcf=(LPCHOOSEFONTA)lParam;
if (!CFn_WMInitDialog(hDlg, wParam, lParam, lpcf))
} else {
lpcfa=(LPCHOOSEFONTA)lParam;
SetPropW(hDlg, strWineFontData_a, (HANDLE)lParam);
lpcfw = HeapAlloc(GetProcessHeap(), 0, sizeof(CHOOSEFONTW));
memcpy(lpcfw, lpcfa, sizeof(CHOOSEFONTA));
lpcfw->lpLogFont = HeapAlloc(GetProcessHeap(), 0, sizeof(LOGFONTW));
memcpy(lpcfw->lpLogFont, lpcfa->lpLogFont, sizeof(LOGFONTA));
MultiByteToWideChar(CP_ACP, 0, lpcfa->lpLogFont->lfFaceName,
LF_FACESIZE, lpcfw->lpLogFont->lfFaceName, LF_FACESIZE);
if(lpcfa->lpszStyle) {
len = MultiByteToWideChar(CP_ACP, 0, lpcfa->lpszStyle, -1, NULL, 0);
lpcfw->lpszStyle = HeapAlloc(GetProcessHeap(), 0, len*sizeof(WCHAR));
MultiByteToWideChar(CP_ACP, 0, lpcfa->lpszStyle, -1, lpcfw->lpszStyle, len);
}
if(lpcfa->lpTemplateName) {
len = MultiByteToWideChar(CP_ACP, 0, lpcfa->lpTemplateName, -1, NULL, 0);
lpcfw->lpTemplateName = HeapAlloc(GetProcessHeap(), 0, len*sizeof(WCHAR));
MultiByteToWideChar(CP_ACP, 0, lpcfa->lpTemplateName,
-1, (LPWSTR)lpcfw->lpTemplateName, len);
}
if (!CFn_WMInitDialog(hDlg, wParam, lParam, lpcfw))
{
TRACE("CFn_WMInitDialog returned FALSE\n");
return FALSE;
}
if (CFn_HookCallChk32(lpcf))
return CallWindowProcA((WNDPROC)lpcf->lpfnHook,hDlg,WM_INITDIALOG,wParam,lParam);
if (CFn_HookCallChk32(lpcfw))
return CallWindowProcA((WNDPROC)lpcfa->lpfnHook,hDlg,WM_INITDIALOG,wParam,lParam);
}
switch (uMsg)
{
@ -1108,16 +1163,15 @@ INT_PTR CALLBACK FormatCharDlgProcA(HWND hDlg, UINT uMsg, WPARAM wParam,
case WM_DRAWITEM:
return CFn_WMDrawItem(hDlg, wParam, lParam);
case WM_COMMAND:
return CFn_WMCommand(hDlg, wParam, lParam, lpcf);
return CFn_WMCommand(hDlg, wParam, lParam, lpcfw);
case WM_DESTROY:
return CFn_WMDestroy(hDlg, wParam, lParam);
return CFn_WMDestroy(hDlg, wParam, lParam, lpcfw);
case WM_CHOOSEFONT_GETLOGFONT:
TRACE("WM_CHOOSEFONT_GETLOGFONT lParam=%08lX\n",
lParam);
TRACE("WM_CHOOSEFONT_GETLOGFONT lParam=%08lX\n", lParam);
FIXME("current logfont back to caller\n");
break;
case WM_PAINT:
return CFn_WMPaint(hDlg, wParam, lParam, lpcf);
return CFn_WMPaint(hDlg, wParam, lParam, lpcfw);
}
return res;
}
@ -1128,29 +1182,29 @@ INT_PTR CALLBACK FormatCharDlgProcA(HWND hDlg, UINT uMsg, WPARAM wParam,
INT_PTR CALLBACK FormatCharDlgProcW(HWND hDlg, UINT uMsg, WPARAM wParam,
LPARAM lParam)
{
LPCHOOSEFONTW lpcf32w;
LPCHOOSEFONTW lpcf;
INT_PTR res = FALSE;
if (uMsg!=WM_INITDIALOG)
{
lpcf32w=(LPCHOOSEFONTW)GetPropA(hDlg, WINE_FONTDATA);
if (!lpcf32w)
lpcf=(LPCHOOSEFONTW)GetPropW(hDlg, strWineFontData);
if (!lpcf)
return FALSE;
if (CFn_HookCallChk32((LPCHOOSEFONTA)lpcf32w))
res=CallWindowProcW((WNDPROC)lpcf32w->lpfnHook, hDlg, uMsg, wParam, lParam);
if (CFn_HookCallChk32(lpcf))
res=CallWindowProcW((WNDPROC)lpcf->lpfnHook, hDlg, uMsg, wParam, lParam);
if (res)
return res;
}
else
{
lpcf32w=(LPCHOOSEFONTW)lParam;
if (!CFn_WMInitDialog(hDlg, wParam, lParam, (LPCHOOSEFONTA)lpcf32w))
lpcf=(LPCHOOSEFONTW)lParam;
if (!CFn_WMInitDialog(hDlg, wParam, lParam, lpcf))
{
TRACE("CFn_WMInitDialog returned FALSE\n");
return FALSE;
}
if (CFn_HookCallChk32((LPCHOOSEFONTA)lpcf32w))
return CallWindowProcW((WNDPROC)lpcf32w->lpfnHook,hDlg,WM_INITDIALOG,wParam,lParam);
if (CFn_HookCallChk32(lpcf))
return CallWindowProcW((WNDPROC)lpcf->lpfnHook,hDlg,WM_INITDIALOG,wParam,lParam);
}
switch (uMsg)
{
@ -1159,14 +1213,15 @@ INT_PTR CALLBACK FormatCharDlgProcW(HWND hDlg, UINT uMsg, WPARAM wParam,
case WM_DRAWITEM:
return CFn_WMDrawItem(hDlg, wParam, lParam);
case WM_COMMAND:
return CFn_WMCommand(hDlg, wParam, lParam, (LPCHOOSEFONTW)lpcf32w);
return CFn_WMCommand(hDlg, wParam, lParam, lpcf);
case WM_DESTROY:
return CFn_WMDestroy(hDlg, wParam, lParam);
return TRUE;
case WM_CHOOSEFONT_GETLOGFONT:
TRACE("WM_CHOOSEFONT_GETLOGFONT lParam=%08lX\n",
lParam);
TRACE("WM_CHOOSEFONT_GETLOGFONT lParam=%08lX\n", lParam);
FIXME("current logfont back to caller\n");
break;
case WM_PAINT:
return CFn_WMPaint(hDlg, wParam, lParam, lpcf);
}
return res;
}

View file

@ -41,7 +41,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(commdlg);
#include "cdlg.h"
#include "cdlg16.h"
static void FONT_LogFont16To32A( const LPLOGFONT16 font16, LPLOGFONTA font32 )
static void FONT_LogFont16To32W( const LPLOGFONT16 font16, LPLOGFONTW font32 )
{
font32->lfHeight = font16->lfHeight;
font32->lfWidth = font16->lfWidth;
@ -56,35 +56,50 @@ static void FONT_LogFont16To32A( const LPLOGFONT16 font16, LPLOGFONTA font32 )
font32->lfClipPrecision = font16->lfClipPrecision;
font32->lfQuality = font16->lfQuality;
font32->lfPitchAndFamily = font16->lfPitchAndFamily;
lstrcpynA( font32->lfFaceName, font16->lfFaceName, LF_FACESIZE );
MultiByteToWideChar(CP_ACP, 0, font16->lfFaceName,
LF_FACESIZE, font32->lfFaceName, LF_FACESIZE);
};
static void FONT_Metrics16To32A( const TEXTMETRIC16 *pm16,
NEWTEXTMETRICEXA *pnm32a)
static void FONT_Metrics16To32W( const TEXTMETRIC16 *pm16,
NEWTEXTMETRICEXW *pnm32w)
{
ZeroMemory( pnm32a, sizeof(NEWTEXTMETRICEXA));
ZeroMemory( pnm32w, sizeof(NEWTEXTMETRICEXW));
/* NOTE: only the fields used by AddFontStyle() are filled in */
pnm32a->ntmTm.tmHeight = pm16->tmHeight;
pnm32a->ntmTm.tmExternalLeading = pm16->tmExternalLeading;
pnm32w->ntmTm.tmHeight = pm16->tmHeight;
pnm32w->ntmTm.tmExternalLeading = pm16->tmExternalLeading;
};
static void CFn_CHOOSEFONT16to32A(LPCHOOSEFONT16 chf16, LPCHOOSEFONTA chf32a)
static void CFn_CHOOSEFONT16to32W(LPCHOOSEFONT16 chf16, LPCHOOSEFONTW chf32w)
{
chf32a->lStructSize=sizeof(CHOOSEFONTA);
chf32a->hwndOwner=HWND_32(chf16->hwndOwner);
chf32a->hDC=HDC_32(chf16->hDC);
chf32a->iPointSize=chf16->iPointSize;
chf32a->Flags=chf16->Flags;
chf32a->rgbColors=chf16->rgbColors;
chf32a->lCustData=chf16->lCustData;
chf32a->lpfnHook=NULL;
chf32a->lpTemplateName=MapSL(chf16->lpTemplateName);
chf32a->hInstance=HINSTANCE_32(chf16->hInstance);
chf32a->lpszStyle=MapSL(chf16->lpszStyle);
chf32a->nFontType=chf16->nFontType;
chf32a->nSizeMax=chf16->nSizeMax;
chf32a->nSizeMin=chf16->nSizeMin;
FONT_LogFont16To32A(MapSL(chf16->lpLogFont), chf32a->lpLogFont);
int len;
if(chf16->lpTemplateName)
{
len = MultiByteToWideChar(CP_ACP, 0, (LPBYTE)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);
}
if(chf16->lpszStyle)
{
len = MultiByteToWideChar(CP_ACP, 0, (LPBYTE)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);
}
chf32w->lStructSize=sizeof(CHOOSEFONTW);
chf32w->hwndOwner=HWND_32(chf16->hwndOwner);
chf32w->hDC=HDC_32(chf16->hDC);
chf32w->iPointSize=chf16->iPointSize;
chf32w->Flags=chf16->Flags;
chf32w->rgbColors=chf16->rgbColors;
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);
};
/***********************************************************************
@ -110,12 +125,12 @@ INT16 WINAPI FontFamilyEnumProc16( SEGPTR logfont, SEGPTR metrics,
LPCHOOSEFONT16 lpcf=(LPCHOOSEFONT16)GetWindowLongA(hDlg, DWL_USER);
LOGFONT16 *lplf = MapSL( logfont );
TEXTMETRIC16 *lpmtrx16 = MapSL(metrics);
ENUMLOGFONTEXA elf32a;
NEWTEXTMETRICEXA nmtrx32a;
FONT_LogFont16To32A(lplf, &(elf32a.elfLogFont));
FONT_Metrics16To32A(lpmtrx16, &nmtrx32a);
return AddFontFamily(&elf32a, &nmtrx32a, nFontType,
(LPCHOOSEFONTA)lpcf->lpTemplateName, hwnd,NULL);
ENUMLOGFONTEXW elf32w;
NEWTEXTMETRICEXW nmtrx32w;
FONT_LogFont16To32W(lplf, &(elf32w.elfLogFont));
FONT_Metrics16To32W(lpmtrx16, &nmtrx32w);
return AddFontFamily(&elf32w, &nmtrx32w, nFontType,
(LPCHOOSEFONTW)lpcf->lpTemplateName, hwnd,NULL);
}
/***********************************************************************
@ -130,12 +145,12 @@ INT16 WINAPI FontStyleEnumProc16( SEGPTR logfont, SEGPTR metrics,
LPCHOOSEFONT16 lpcf=(LPCHOOSEFONT16)GetWindowLongA(hDlg, DWL_USER);
LOGFONT16 *lplf = MapSL(logfont);
TEXTMETRIC16 *lpmtrx16 = MapSL(metrics);
ENUMLOGFONTEXA elf32a;
NEWTEXTMETRICEXA nmtrx32a;
FONT_LogFont16To32A(lplf, &(elf32a.elfLogFont));
FONT_Metrics16To32A(lpmtrx16, &nmtrx32a);
return AddFontStyle(&elf32a, &nmtrx32a, nFontType,
(LPCHOOSEFONTA)lpcf->lpTemplateName, hcmb2, hcmb3, hDlg, TRUE);
ENUMLOGFONTEXW elf32w;
NEWTEXTMETRICEXW nmtrx32w;
FONT_LogFont16To32W(lplf, &(elf32w.elfLogFont));
FONT_Metrics16To32W(lpmtrx16, &nmtrx32w);
return AddFontStyle(&elf32w, &nmtrx32w, nFontType,
(LPCHOOSEFONTW)lpcf->lpTemplateName, hcmb2, hcmb3, hDlg, TRUE);
}
/***********************************************************************
@ -149,13 +164,13 @@ BOOL16 WINAPI ChooseFont16(LPCHOOSEFONT16 lpChFont)
BOOL16 bRet = FALSE;
LPCVOID template;
FARPROC16 ptr;
CHOOSEFONTA cf32a;
LOGFONTA lf32a;
CHOOSEFONTW cf32w;
LOGFONTW lf32w;
LOGFONT16 *font16;
SEGPTR lpTemplateName;
cf32a.lpLogFont=&lf32a;
CFn_CHOOSEFONT16to32A(lpChFont, &cf32a);
cf32w.lpLogFont=&lf32w;
CFn_CHOOSEFONT16to32W(lpChFont, &cf32w);
TRACE("ChooseFont\n");
if (!lpChFont) return FALSE;
@ -228,7 +243,7 @@ BOOL16 WINAPI ChooseFont16(LPCHOOSEFONT16 lpChFont)
/* lpTemplateName is not used in the dialog */
lpTemplateName=lpChFont->lpTemplateName;
lpChFont->lpTemplateName=(SEGPTR)&cf32a;
lpChFont->lpTemplateName=(SEGPTR)&cf32w;
ptr = GetProcAddress16(GetModuleHandle16("COMMDLG"), (LPCSTR) 16);
hInst = GetWindowLongPtrA(HWND_32(lpChFont->hwndOwner), GWLP_HINSTANCE);
@ -242,27 +257,32 @@ 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;
lpChFont->iPointSize = cf32w.iPointSize;
lpChFont->Flags = cf32w.Flags;
lpChFont->rgbColors = cf32w.rgbColors;
lpChFont->lCustData = cf32w.lCustData;
lpChFont->nFontType = cf32w.nFontType;
font16 = MapSL(lpChFont->lpLogFont);
font16->lfHeight = cf32a.lpLogFont->lfHeight;
font16->lfWidth = cf32a.lpLogFont->lfWidth;
font16->lfEscapement = cf32a.lpLogFont->lfEscapement;
font16->lfOrientation = cf32a.lpLogFont->lfOrientation;
font16->lfWeight = cf32a.lpLogFont->lfWeight;
font16->lfItalic = cf32a.lpLogFont->lfItalic;
font16->lfUnderline = cf32a.lpLogFont->lfUnderline;
font16->lfStrikeOut = cf32a.lpLogFont->lfStrikeOut;
font16->lfCharSet = cf32a.lpLogFont->lfCharSet;
font16->lfOutPrecision = cf32a.lpLogFont->lfOutPrecision;
font16->lfClipPrecision = cf32a.lpLogFont->lfClipPrecision;
font16->lfQuality = cf32a.lpLogFont->lfQuality;
font16->lfPitchAndFamily = cf32a.lpLogFont->lfPitchAndFamily;
lstrcpynA( font16->lfFaceName, cf32a.lpLogFont->lfFaceName, LF_FACESIZE );
font16->lfHeight = cf32w.lpLogFont->lfHeight;
font16->lfWidth = cf32w.lpLogFont->lfWidth;
font16->lfEscapement = cf32w.lpLogFont->lfEscapement;
font16->lfOrientation = cf32w.lpLogFont->lfOrientation;
font16->lfWeight = cf32w.lpLogFont->lfWeight;
font16->lfItalic = cf32w.lpLogFont->lfItalic;
font16->lfUnderline = cf32w.lpLogFont->lfUnderline;
font16->lfStrikeOut = cf32w.lpLogFont->lfStrikeOut;
font16->lfCharSet = cf32w.lpLogFont->lfCharSet;
font16->lfOutPrecision = cf32w.lpLogFont->lfOutPrecision;
font16->lfClipPrecision = cf32w.lpLogFont->lfClipPrecision;
font16->lfQuality = cf32w.lpLogFont->lfQuality;
font16->lfPitchAndFamily = cf32w.lpLogFont->lfPitchAndFamily;
WideCharToMultiByte(CP_ACP, 0, cf32w.lpLogFont->lfFaceName,
LF_FACESIZE, font16->lfFaceName, LF_FACESIZE, 0, 0);
HeapFree(GetProcessHeap(), 0, (LPBYTE)cf32w.lpTemplateName);
HeapFree(GetProcessHeap(), 0, cf32w.lpszStyle);
return bRet;
}
@ -291,7 +311,7 @@ BOOL16 CALLBACK FormatCharDlgProc16(HWND16 hDlg16, UINT16 message,
else
{
lpcf=(LPCHOOSEFONT16)lParam;
if (!CFn_WMInitDialog(hDlg, wParam, lParam, (LPCHOOSEFONTA)lpcf->lpTemplateName))
if (!CFn_WMInitDialog(hDlg, wParam, lParam, (LPCHOOSEFONTW)lpcf->lpTemplateName))
{
TRACE("CFn_WMInitDialog returned FALSE\n");
return FALSE;
@ -337,17 +357,16 @@ BOOL16 CALLBACK FormatCharDlgProc16(HWND16 hDlg16, UINT16 message,
break;
case WM_COMMAND:
res=CFn_WMCommand(hDlg, MAKEWPARAM( wParam, HIWORD(lParam) ), LOWORD(lParam),
(LPCHOOSEFONTA)lpcf->lpTemplateName);
(LPCHOOSEFONTW)lpcf->lpTemplateName);
break;
case WM_DESTROY:
res=CFn_WMDestroy(hDlg, wParam, lParam);
break;
return TRUE;
case WM_CHOOSEFONT_GETLOGFONT:
TRACE("WM_CHOOSEFONT_GETLOGFONT lParam=%08lX\n", lParam);
FIXME("current logfont back to caller\n");
break;
case WM_PAINT:
res= CFn_WMPaint(hDlg, wParam, lParam, (LPCHOOSEFONTA)lpcf->lpTemplateName);
res= CFn_WMPaint(hDlg, wParam, lParam, (LPCHOOSEFONTW)lpcf->lpTemplateName);
break;
}
return res;

View file

@ -479,8 +479,8 @@ static BOOL PRINTDLG_PaperSizeA(
out:
GlobalUnlock(pdlga->hDevNames);
GlobalUnlock(pdlga->hDevMode);
if (Names) HeapFree(GetProcessHeap(),0,Names);
if (points) HeapFree(GetProcessHeap(),0,points);
HeapFree(GetProcessHeap(),0,Names);
HeapFree(GetProcessHeap(),0,points);
return retval;
}
@ -537,8 +537,8 @@ static BOOL PRINTDLG_PaperSizeW(
out:
GlobalUnlock(pdlga->hDevNames);
GlobalUnlock(pdlga->hDevMode);
if (Names) HeapFree(GetProcessHeap(),0,Names);
if (points) HeapFree(GetProcessHeap(),0,points);
HeapFree(GetProcessHeap(),0,Names);
HeapFree(GetProcessHeap(),0,points);
return retval;
}
@ -860,10 +860,8 @@ BOOL PRINTDLG_ChangePrinterA(HWND hDlg, char *name,
DWORD needed;
HANDLE hprn;
if(PrintStructures->lpPrinterInfo)
HeapFree(GetProcessHeap(),0, PrintStructures->lpPrinterInfo);
if(PrintStructures->lpDriverInfo)
HeapFree(GetProcessHeap(),0, PrintStructures->lpDriverInfo);
HeapFree(GetProcessHeap(),0, PrintStructures->lpPrinterInfo);
HeapFree(GetProcessHeap(),0, PrintStructures->lpDriverInfo);
if(!OpenPrinterA(name, &hprn, NULL)) {
ERR("Can't open printer %s\n", name);
return FALSE;
@ -883,10 +881,8 @@ BOOL PRINTDLG_ChangePrinterA(HWND hDlg, char *name,
PRINTDLG_UpdatePrinterInfoTextsA(hDlg, PrintStructures->lpPrinterInfo);
if(PrintStructures->lpDevMode) {
HeapFree(GetProcessHeap(), 0, PrintStructures->lpDevMode);
PrintStructures->lpDevMode = NULL;
}
HeapFree(GetProcessHeap(), 0, PrintStructures->lpDevMode);
PrintStructures->lpDevMode = NULL;
dmSize = DocumentPropertiesA(0, 0, name, NULL, NULL, 0);
if(dmSize == -1) {
@ -928,15 +924,6 @@ BOOL PRINTDLG_ChangePrinterA(HWND hDlg, char *name,
if (lppd->Flags & PD_PAGENUMS)
CheckRadioButton(hDlg, rad1, rad3, rad3);
}
/* "All xxx pages"... */
{
char resourcestr[64];
char result[64];
LoadStringA(COMDLG32_hInstance, PD32_PRINT_ALL_X_PAGES,
resourcestr, 49);
sprintf(result,resourcestr,lppd->nMaxPage - lppd->nMinPage + 1);
SendDlgItemMessageA(hDlg, rad1, WM_SETTEXT, 0, (LPARAM) result);
}
/* Collate pages
*
@ -1022,10 +1009,8 @@ static BOOL PRINTDLG_ChangePrinterW(HWND hDlg, WCHAR *name,
DWORD needed;
HANDLE hprn;
if(PrintStructures->lpPrinterInfo)
HeapFree(GetProcessHeap(),0, PrintStructures->lpPrinterInfo);
if(PrintStructures->lpDriverInfo)
HeapFree(GetProcessHeap(),0, PrintStructures->lpDriverInfo);
HeapFree(GetProcessHeap(),0, PrintStructures->lpPrinterInfo);
HeapFree(GetProcessHeap(),0, PrintStructures->lpDriverInfo);
if(!OpenPrinterW(name, &hprn, NULL)) {
ERR("Can't open printer %s\n", debugstr_w(name));
return FALSE;
@ -1045,10 +1030,8 @@ static BOOL PRINTDLG_ChangePrinterW(HWND hDlg, WCHAR *name,
PRINTDLG_UpdatePrinterInfoTextsW(hDlg, PrintStructures->lpPrinterInfo);
if(PrintStructures->lpDevMode) {
HeapFree(GetProcessHeap(), 0, PrintStructures->lpDevMode);
PrintStructures->lpDevMode = NULL;
}
HeapFree(GetProcessHeap(), 0, PrintStructures->lpDevMode);
PrintStructures->lpDevMode = NULL;
dmSize = DocumentPropertiesW(0, 0, name, NULL, NULL, 0);
if(dmSize == -1) {
@ -1090,15 +1073,6 @@ static BOOL PRINTDLG_ChangePrinterW(HWND hDlg, WCHAR *name,
if (lppd->Flags & PD_PAGENUMS)
CheckRadioButton(hDlg, rad1, rad3, rad3);
}
/* "All xxx pages"... */
{
WCHAR resourcestr[64];
WCHAR result[64];
LoadStringW(COMDLG32_hInstance, PD32_PRINT_ALL_X_PAGES,
resourcestr, 49);
wsprintfW(result,resourcestr,lppd->nMaxPage - lppd->nMinPage + 1);
SendDlgItemMessageW(hDlg, rad1, WM_SETTEXT, 0, (LPARAM) result);
}
/* Collate pages
*
@ -1412,7 +1386,7 @@ LRESULT PRINTDLG_WMCommandA(HWND hDlg, WPARAM wParam,
switch (LOWORD(wParam)) {
case IDOK:
TRACE(" OK button was hit\n");
if (PRINTDLG_UpdatePrintDlgA(hDlg, PrintStructures)!=TRUE) {
if (!PRINTDLG_UpdatePrintDlgA(hDlg, PrintStructures)) {
FIXME("Update printdlg was not successful!\n");
return(FALSE);
}
@ -1589,7 +1563,7 @@ static LRESULT PRINTDLG_WMCommandW(HWND hDlg, WPARAM wParam,
switch (LOWORD(wParam)) {
case IDOK:
TRACE(" OK button was hit\n");
if (PRINTDLG_UpdatePrintDlgW(hDlg, PrintStructures)!=TRUE) {
if (!PRINTDLG_UpdatePrintDlgW(hDlg, PrintStructures)) {
FIXME("Update printdlg was not successful!\n");
return(FALSE);
}