Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
cf9cb6c1
Commit
cf9cb6c1
authored
Jul 22, 2013
by
Huw Davies
Committed by
Alexandre Julliard
Jul 22, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Ignore max_extent if nfit is NULL.
parent
b2472c09
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
4 deletions
+24
-4
font.c
dlls/gdi32/font.c
+2
-2
font.c
dlls/gdi32/tests/font.c
+22
-2
No files found.
dlls/gdi32/font.c
View file @
cf9cb6c1
...
...
@@ -1186,7 +1186,7 @@ BOOL WINAPI GetTextExtentExPointI( HDC hdc, const WORD *indices, INT count, INT
for
(
i
=
0
;
i
<
count
;
i
++
)
{
unsigned
int
dx
=
abs
(
INTERNAL_XDSTOWS
(
dc
,
pos
[
i
]
))
+
(
i
+
1
)
*
dc
->
charExtra
;
if
(
dx
>
(
unsigned
int
)
max_ext
)
break
;
if
(
nfit
&&
dx
>
(
unsigned
int
)
max_ext
)
break
;
if
(
dxs
)
dxs
[
i
]
=
dx
;
}
if
(
nfit
)
*
nfit
=
i
;
...
...
@@ -1323,7 +1323,7 @@ BOOL WINAPI GetTextExtentExPointW( HDC hdc, LPCWSTR str, INT count, INT max_ext,
for
(
i
=
0
;
i
<
count
;
i
++
)
{
unsigned
int
dx
=
abs
(
INTERNAL_XDSTOWS
(
dc
,
pos
[
i
]
))
+
(
i
+
1
)
*
dc
->
charExtra
;
if
(
dx
>
(
unsigned
int
)
max_ext
)
break
;
if
(
nfit
&&
dx
>
(
unsigned
int
)
max_ext
)
break
;
if
(
dxs
)
dxs
[
i
]
=
dx
;
}
if
(
nfit
)
*
nfit
=
i
;
...
...
dlls/gdi32/tests/font.c
View file @
cf9cb6c1
...
...
@@ -1207,7 +1207,7 @@ static void test_text_extents(void)
{
static
const
WCHAR
wt
[]
=
{
'O'
,
'n'
,
'e'
,
'\n'
,
't'
,
'w'
,
'o'
,
' '
,
'3'
,
0
};
LPINT
extents
;
INT
i
,
len
,
fit1
,
fit2
;
INT
i
,
len
,
fit1
,
fit2
,
extents2
[
3
]
;
LOGFONTA
lf
;
TEXTMETRICA
tm
;
HDC
hdc
;
...
...
@@ -1269,7 +1269,6 @@ static void test_text_extents(void)
GetTextExtentExPointW
(
hdc
,
wt
,
2
,
0
,
NULL
,
NULL
,
&
sz1
);
ok
(
sz1
.
cx
==
sz2
.
cx
&&
sz1
.
cy
==
sz2
.
cy
,
"GetTextExtentExPointW with lpnFit and alpDx both NULL returns incorrect results
\n
"
);
HeapFree
(
GetProcessHeap
(),
0
,
extents
);
/* extents functions fail with -ve counts (the interesting case being -1) */
ret
=
GetTextExtentPointA
(
hdc
,
"o"
,
-
1
,
&
sz
);
...
...
@@ -1314,6 +1313,27 @@ static void test_text_extents(void)
hfont
=
SelectObject
(
hdc
,
hfont
);
DeleteObject
(
hfont
);
/* non-MM_TEXT mapping mode */
lf
.
lfHeight
=
2000
;
hfont
=
CreateFontIndirectA
(
&
lf
);
hfont
=
SelectObject
(
hdc
,
hfont
);
SetMapMode
(
hdc
,
MM_HIMETRIC
);
ret
=
GetTextExtentExPointW
(
hdc
,
wt
,
3
,
0
,
NULL
,
extents
,
&
sz
);
ok
(
ret
,
"got %d
\n
"
,
ret
);
ok
(
sz
.
cx
==
extents
[
2
],
"got %d vs %d
\n
"
,
sz
.
cx
,
extents
[
2
]);
ret
=
GetTextExtentExPointW
(
hdc
,
wt
,
3
,
extents
[
1
],
&
fit1
,
extents2
,
&
sz2
);
ok
(
ret
,
"got %d
\n
"
,
ret
);
ok
(
fit1
==
2
,
"got %d
\n
"
,
fit1
);
ok
(
sz2
.
cx
==
sz
.
cx
,
"got %d vs %d
\n
"
,
sz2
.
cx
,
sz
.
cx
);
for
(
i
=
0
;
i
<
2
;
i
++
)
ok
(
extents2
[
i
]
==
extents
[
i
],
"%d: %d, %d
\n
"
,
i
,
extents2
[
i
],
extents
[
i
]);
hfont
=
SelectObject
(
hdc
,
hfont
);
DeleteObject
(
hfont
);
HeapFree
(
GetProcessHeap
(),
0
,
extents
);
ReleaseDC
(
NULL
,
hdc
);
}
...
...
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