Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
9bb6932e
Commit
9bb6932e
authored
Feb 19, 2010
by
Vincent Povirk
Committed by
Alexandre Julliard
Feb 22, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comdlg32: Add a test showing the font dialog ignores printer dpi.
parent
11a01507
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
58 additions
and
1 deletion
+58
-1
Makefile.in
dlls/comdlg32/tests/Makefile.in
+1
-1
fontdlg.c
dlls/comdlg32/tests/fontdlg.c
+57
-0
No files found.
dlls/comdlg32/tests/Makefile.in
View file @
9bb6932e
...
...
@@ -3,7 +3,7 @@ TOPOBJDIR = ../../..
SRCDIR
=
@srcdir@
VPATH
=
@srcdir@
TESTDLL
=
comdlg32.dll
IMPORTS
=
comdlg32 user32 gdi32 kernel32
IMPORTS
=
comdlg32
winspool
user32 gdi32 kernel32
C_SRCS
=
\
filedlg.c
\
...
...
dlls/comdlg32/tests/fontdlg.c
View file @
9bb6932e
...
...
@@ -25,6 +25,7 @@
#include "winbase.h"
#include "winerror.h"
#include "wingdi.h"
#include "winspool.h"
#include "winuser.h"
#include "objbase.h"
...
...
@@ -44,6 +45,30 @@ static int get_dpiy(void)
return
result
;
}
static
HDC
get_printer_ic
(
void
)
{
PRINTER_INFO_2A
*
info
;
DWORD
info_size
,
num_printers
=
0
;
BOOL
ret
;
HDC
result
=
NULL
;
EnumPrintersA
(
PRINTER_ENUM_LOCAL
,
NULL
,
2
,
NULL
,
0
,
&
info_size
,
&
num_printers
);
if
(
info_size
==
0
)
return
NULL
;
info
=
HeapAlloc
(
GetProcessHeap
(),
0
,
info_size
);
ret
=
EnumPrintersA
(
PRINTER_ENUM_LOCAL
,
NULL
,
2
,
(
LPBYTE
)
info
,
info_size
,
&
info_size
,
&
num_printers
);
if
(
ret
)
result
=
CreateICA
(
info
->
pDriverName
,
info
->
pPrinterName
,
NULL
,
NULL
);
HeapFree
(
GetProcessHeap
(),
0
,
info
);
return
result
;
}
static
UINT_PTR
CALLBACK
CFHookProcOK
(
HWND
hdlg
,
UINT
msg
,
WPARAM
wparam
,
LPARAM
lparam
)
{
switch
(
msg
)
...
...
@@ -63,6 +88,7 @@ static void test_ChooseFontA(void)
BOOL
ret
;
int
dpiy
=
get_dpiy
();
int
expected_pointsize
,
expected_lfheight
;
HDC
printer_ic
;
memset
(
&
lfa
,
0
,
sizeof
(
LOGFONTA
));
lfa
.
lfHeight
=
-
16
;
...
...
@@ -85,6 +111,37 @@ static void test_ChooseFontA(void)
ok
(
lfa
.
lfHeight
==
expected_lfheight
,
"Expected %i, got %i
\n
"
,
expected_lfheight
,
lfa
.
lfHeight
);
ok
(
lfa
.
lfWeight
==
FW_NORMAL
,
"Expected FW_NORMAL, got %i
\n
"
,
lfa
.
lfWeight
);
ok
(
strcmp
(
lfa
.
lfFaceName
,
"Symbol"
)
==
0
,
"Expected Symbol, got %s
\n
"
,
lfa
.
lfFaceName
);
printer_ic
=
get_printer_ic
();
if
(
!
printer_ic
)
skip
(
"can't get a DC for a local printer
\n
"
);
else
{
memset
(
&
lfa
,
0
,
sizeof
(
LOGFONTA
));
lfa
.
lfHeight
=
-
16
;
lfa
.
lfWeight
=
FW_NORMAL
;
strcpy
(
lfa
.
lfFaceName
,
"Symbol"
);
memset
(
&
cfa
,
0
,
sizeof
(
CHOOSEFONTA
));
cfa
.
lStructSize
=
sizeof
(
cfa
);
cfa
.
lpLogFont
=
&
lfa
;
cfa
.
Flags
=
CF_ENABLEHOOK
|
CF_INITTOLOGFONTSTRUCT
|
CF_PRINTERFONTS
;
cfa
.
hDC
=
printer_ic
;
cfa
.
lpfnHook
=
CFHookProcOK
;
ret
=
ChooseFontA
(
&
cfa
);
expected_pointsize
=
MulDiv
(
16
,
72
,
dpiy
)
*
10
;
expected_lfheight
=
-
MulDiv
(
expected_pointsize
,
dpiy
,
720
);
ok
(
ret
==
TRUE
,
"ChooseFontA returned FALSE
\n
"
);
todo_wine
ok
(
cfa
.
iPointSize
==
expected_pointsize
,
"Expected %i, got %i
\n
"
,
expected_pointsize
,
cfa
.
iPointSize
);
todo_wine
ok
(
lfa
.
lfHeight
==
expected_lfheight
,
"Expected %i, got %i
\n
"
,
expected_lfheight
,
lfa
.
lfHeight
);
ok
(
lfa
.
lfWeight
==
FW_NORMAL
,
"Expected FW_NORMAL, got %i
\n
"
,
lfa
.
lfWeight
);
ok
(
strcmp
(
lfa
.
lfFaceName
,
"Symbol"
)
==
0
,
"Expected Symbol, got %s
\n
"
,
lfa
.
lfFaceName
);
DeleteDC
(
printer_ic
);
}
}
START_TEST
(
fontdlg
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment