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
c465209c
Commit
c465209c
authored
Nov 13, 2015
by
Andrew Eikum
Committed by
Alexandre Julliard
Nov 16, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Use font default height if GetTextExtentPoint returns empty rectangle.
Signed-off-by:
Andrew Eikum
<
aeikum@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
6b97ce5b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
27 deletions
+30
-27
text.c
dlls/user32/tests/text.c
+23
-25
text.c
dlls/user32/text.c
+7
-2
No files found.
dlls/user32/tests/text.c
View file @
c465209c
...
...
@@ -604,15 +604,13 @@ static void strfmt( const char *str, char *strout)
#define TABTEST( tabval, tabcount, string, _exp) \
{ int i
,x_act, x_exp
; char strdisp[64];\
{ int i; char strdisp[64];\
for(i=0;i<8;i++) tabs[i]=(i+1)*(tabval); \
extent = GetTabbedTextExtentA( hdc, string, strlen( string), (tabcount), tabs); \
strfmt( string, strdisp); \
/* trace( "Extent is %08lx\n", extent); */
\
x_act = LOWORD( extent); \
x_exp = (_exp); \
ok( x_act == x_exp, "Test case \"%s\". Text extent is %d, expected %d tab %d tabcount %d\n", \
strdisp, x_act, x_exp, tabval, tabcount); \
ok( extent == _exp, "Test case \"%s\". Text extent is 0x%x, expected 0x%x tab %d tabcount %d\n", \
strdisp, extent, _exp, tabval, tabcount); \
} \
...
...
@@ -649,16 +647,16 @@ static void test_TabbedText(void)
tab
=
(
cx
*
4
+
t
);
/* test the special case tabcount =1 and the general array (80 of tabs */
for
(
tabcount
=
1
;
tabcount
<=
8
;
tabcount
+=
7
)
{
TABTEST
(
align
*
tab
,
tabcount
,
"
\t
"
,
tab
)
TABTEST
(
align
*
tab
,
tabcount
,
"xxx
\t
"
,
tab
)
TABTEST
(
align
*
tab
,
tabcount
,
"
\t
x"
,
tab
+
cx
)
TABTEST
(
align
*
tab
,
tabcount
,
"
\t\t
"
,
tab
*
2
)
TABTEST
(
align
*
tab
,
tabcount
,
"
\t
x
\t
"
,
tab
*
2
)
TABTEST
(
align
*
tab
,
tabcount
,
"x
\t
x"
,
tab
+
cx
)
TABTEST
(
align
*
tab
,
tabcount
,
"xx
\t
x"
,
tab
+
cx
)
TABTEST
(
align
*
tab
,
tabcount
,
"xxx
\t
x"
,
tab
+
cx
)
TABTEST
(
align
*
tab
,
tabcount
,
"xxxx
\t
x"
,
t
>
0
?
tab
+
cx
:
2
*
tab
+
cx
)
TABTEST
(
align
*
tab
,
tabcount
,
"xxxxx
\t
x"
,
2
*
tab
+
cx
)
TABTEST
(
align
*
tab
,
tabcount
,
"
\t
"
,
MAKELONG
(
tab
,
cy
)
)
TABTEST
(
align
*
tab
,
tabcount
,
"xxx
\t
"
,
MAKELONG
(
tab
,
cy
)
)
TABTEST
(
align
*
tab
,
tabcount
,
"
\t
x"
,
MAKELONG
(
tab
+
cx
,
cy
)
)
TABTEST
(
align
*
tab
,
tabcount
,
"
\t\t
"
,
MAKELONG
(
tab
*
2
,
cy
)
)
TABTEST
(
align
*
tab
,
tabcount
,
"
\t
x
\t
"
,
MAKELONG
(
tab
*
2
,
cy
)
)
TABTEST
(
align
*
tab
,
tabcount
,
"x
\t
x"
,
MAKELONG
(
tab
+
cx
,
cy
)
)
TABTEST
(
align
*
tab
,
tabcount
,
"xx
\t
x"
,
MAKELONG
(
tab
+
cx
,
cy
)
)
TABTEST
(
align
*
tab
,
tabcount
,
"xxx
\t
x"
,
MAKELONG
(
tab
+
cx
,
cy
)
)
TABTEST
(
align
*
tab
,
tabcount
,
"xxxx
\t
x"
,
MAKELONG
(
t
>
0
?
tab
+
cx
:
2
*
tab
+
cx
,
cy
)
)
TABTEST
(
align
*
tab
,
tabcount
,
"xxxxx
\t
x"
,
MAKELONG
(
2
*
tab
+
cx
,
cy
)
)
}
}
align
=-
1
;
...
...
@@ -667,16 +665,16 @@ static void test_TabbedText(void)
tab
=
(
cx
*
4
+
t
);
/* test the special case tabcount =1 and the general array (8) of tabs */
for
(
tabcount
=
1
;
tabcount
<=
8
;
tabcount
+=
7
)
{
TABTEST
(
align
*
tab
,
tabcount
,
"
\t
"
,
tab
)
TABTEST
(
align
*
tab
,
tabcount
,
"xxx
\t
"
,
tab
)
TABTEST
(
align
*
tab
,
tabcount
,
"
\t
x"
,
tab
)
TABTEST
(
align
*
tab
,
tabcount
,
"
\t\t
"
,
tab
*
2
)
TABTEST
(
align
*
tab
,
tabcount
,
"
\t
x
\t
"
,
tab
*
2
)
TABTEST
(
align
*
tab
,
tabcount
,
"x
\t
x"
,
tab
)
TABTEST
(
align
*
tab
,
tabcount
,
"xx
\t
x"
,
tab
)
TABTEST
(
align
*
tab
,
tabcount
,
"xxx
\t
x"
,
4
*
cx
>=
tab
?
2
*
tab
:
tab
)
TABTEST
(
align
*
tab
,
tabcount
,
"xxxx
\t
x"
,
2
*
tab
)
TABTEST
(
align
*
tab
,
tabcount
,
"xxxxx
\t
x"
,
2
*
tab
)
TABTEST
(
align
*
tab
,
tabcount
,
"
\t
"
,
MAKELONG
(
tab
,
cy
)
)
TABTEST
(
align
*
tab
,
tabcount
,
"xxx
\t
"
,
MAKELONG
(
tab
,
cy
)
)
TABTEST
(
align
*
tab
,
tabcount
,
"
\t
x"
,
MAKELONG
(
tab
,
cy
)
)
TABTEST
(
align
*
tab
,
tabcount
,
"
\t\t
"
,
MAKELONG
(
tab
*
2
,
cy
)
)
TABTEST
(
align
*
tab
,
tabcount
,
"
\t
x
\t
"
,
MAKELONG
(
tab
*
2
,
cy
)
)
TABTEST
(
align
*
tab
,
tabcount
,
"x
\t
x"
,
MAKELONG
(
tab
,
cy
)
)
TABTEST
(
align
*
tab
,
tabcount
,
"xx
\t
x"
,
MAKELONG
(
tab
,
cy
)
)
TABTEST
(
align
*
tab
,
tabcount
,
"xxx
\t
x"
,
MAKELONG
(
4
*
cx
>=
tab
?
2
*
tab
:
tab
,
cy
)
)
TABTEST
(
align
*
tab
,
tabcount
,
"xxxx
\t
x"
,
MAKELONG
(
2
*
tab
,
cy
)
)
TABTEST
(
align
*
tab
,
tabcount
,
"xxxxx
\t
x"
,
MAKELONG
(
2
*
tab
,
cy
)
)
}
}
...
...
dlls/user32/text.c
View file @
c465209c
...
...
@@ -1316,12 +1316,15 @@ static LONG TEXT_TabbedTextOut( HDC hdc, INT x, INT y, LPCWSTR lpstr,
SIZE
extent
;
int
i
,
j
;
int
start
=
x
;
TEXTMETRICW
tm
;
if
(
!
lpstr
||
count
==
0
)
return
0
;
if
(
!
lpTabPos
)
cTabStops
=
0
;
GetTextMetricsW
(
hdc
,
&
tm
);
if
(
cTabStops
==
1
)
{
defWidth
=
*
lpTabPos
;
...
...
@@ -1329,8 +1332,6 @@ static LONG TEXT_TabbedTextOut( HDC hdc, INT x, INT y, LPCWSTR lpstr,
}
else
{
TEXTMETRICW
tm
;
GetTextMetricsW
(
hdc
,
&
tm
);
defWidth
=
8
*
tm
.
tmAveCharWidth
;
}
...
...
@@ -1398,6 +1399,10 @@ static LONG TEXT_TabbedTextOut( HDC hdc, INT x, INT y, LPCWSTR lpstr,
count
-=
j
;
lpstr
+=
j
;
}
if
(
!
extent
.
cy
)
extent
.
cy
=
tm
.
tmHeight
;
return
MAKELONG
(
x
-
start
,
extent
.
cy
);
}
...
...
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