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
70c22221
Commit
70c22221
authored
Dec 26, 2011
by
Akihiro Sagawa
Committed by
Alexandre Julliard
Dec 27, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Avoid making a DBCS character in range.
parent
a6530f40
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
11 deletions
+37
-11
font.c
dlls/gdi32/font.c
+14
-4
font.c
dlls/gdi32/tests/font.c
+23
-7
No files found.
dlls/gdi32/font.c
View file @
70c22221
...
...
@@ -1596,13 +1596,15 @@ UINT WINAPI GetOutlineTextMetricsW(
static
LPSTR
FONT_GetCharsByRangeA
(
HDC
hdc
,
UINT
firstChar
,
UINT
lastChar
,
PINT
pByteLen
)
{
INT
i
,
count
=
lastChar
-
firstChar
+
1
;
UINT
mbcp
;
UINT
c
;
LPSTR
str
;
if
(
count
<=
0
)
return
NULL
;
switch
(
GdiGetCodePage
(
hdc
))
mbcp
=
GdiGetCodePage
(
hdc
);
switch
(
mbcp
)
{
case
932
:
case
936
:
...
...
@@ -1617,6 +1619,7 @@ static LPSTR FONT_GetCharsByRangeA(HDC hdc, UINT firstChar, UINT lastChar, PINT
default:
if
(
lastChar
>
0xff
)
return
NULL
;
mbcp
=
0
;
break
;
}
...
...
@@ -1626,9 +1629,16 @@ static LPSTR FONT_GetCharsByRangeA(HDC hdc, UINT firstChar, UINT lastChar, PINT
for
(
i
=
0
,
c
=
firstChar
;
c
<=
lastChar
;
i
++
,
c
++
)
{
if
(
c
>
0xff
)
str
[
i
++
]
=
(
BYTE
)(
c
>>
8
);
str
[
i
]
=
(
BYTE
)
c
;
if
(
mbcp
)
{
if
(
c
>
0xff
)
str
[
i
++
]
=
(
BYTE
)(
c
>>
8
);
if
(
c
<=
0xff
&&
IsDBCSLeadByteEx
(
mbcp
,
c
))
str
[
i
]
=
0x1f
;
/* FIXME: use default character */
else
str
[
i
]
=
(
BYTE
)
c
;
}
else
str
[
i
]
=
(
BYTE
)
c
;
}
str
[
i
]
=
'\0'
;
...
...
dlls/gdi32/tests/font.c
View file @
70c22221
...
...
@@ -957,7 +957,8 @@ static void test_GetCharABCWidths(void)
{
0xffffff
,
0xffffff
},
{
0x1000000
,
0x1000000
},
{
0xffffff
,
0x1000000
},
{
0xffffffff
,
0xffffffff
}
{
0xffffffff
,
0xffffffff
},
{
0x00
,
0xff
}
};
static
const
struct
{
...
...
@@ -967,12 +968,18 @@ static void test_GetCharABCWidths(void)
BOOL
r
[
sizeof
range
/
sizeof
range
[
0
]];
}
c
[]
=
{
{
ANSI_CHARSET
,
0x30
,
0x30
,
{
TRUE
,
FALSE
,
FALSE
,
FALSE
,
FALSE
,
FALSE
,
FALSE
,
FALSE
,
FALSE
,
FALSE
}},
{
SHIFTJIS_CHARSET
,
0x82a0
,
0x3042
,
{
TRUE
,
TRUE
,
FALSE
,
FALSE
,
TRUE
,
FALSE
,
FALSE
,
FALSE
,
FALSE
,
FALSE
,
FALSE
}},
{
HANGEUL_CHARSET
,
0x8141
,
0xac02
,
{
TRUE
,
TRUE
,
FALSE
,
FALSE
,
TRUE
,
FALSE
,
FALSE
,
FALSE
,
FALSE
,
FALSE
,
FALSE
}},
{
JOHAB_CHARSET
,
0x8446
,
0x3135
,
{
TRUE
,
TRUE
,
FALSE
,
FALSE
,
TRUE
,
FALSE
,
FALSE
,
FALSE
,
FALSE
,
FALSE
,
FALSE
}},
{
GB2312_CHARSET
,
0x8141
,
0x4e04
,
{
TRUE
,
TRUE
,
FALSE
,
FALSE
,
TRUE
,
FALSE
,
FALSE
,
FALSE
,
FALSE
,
FALSE
,
FALSE
}},
{
CHINESEBIG5_CHARSET
,
0xa142
,
0x3001
,
{
TRUE
,
TRUE
,
FALSE
,
FALSE
,
TRUE
,
FALSE
,
FALSE
,
FALSE
,
FALSE
,
FALSE
,
FALSE
}}
{
ANSI_CHARSET
,
0x30
,
0x30
,
{
TRUE
,
FALSE
,
FALSE
,
FALSE
,
FALSE
,
FALSE
,
FALSE
,
FALSE
,
FALSE
,
FALSE
,
FALSE
,
TRUE
}},
{
SHIFTJIS_CHARSET
,
0x82a0
,
0x3042
,
{
TRUE
,
TRUE
,
FALSE
,
FALSE
,
TRUE
,
FALSE
,
FALSE
,
FALSE
,
FALSE
,
FALSE
,
FALSE
,
TRUE
}},
{
HANGEUL_CHARSET
,
0x8141
,
0xac02
,
{
TRUE
,
TRUE
,
FALSE
,
FALSE
,
TRUE
,
FALSE
,
FALSE
,
FALSE
,
FALSE
,
FALSE
,
FALSE
,
TRUE
}},
{
JOHAB_CHARSET
,
0x8446
,
0x3135
,
{
TRUE
,
TRUE
,
FALSE
,
FALSE
,
TRUE
,
FALSE
,
FALSE
,
FALSE
,
FALSE
,
FALSE
,
FALSE
,
TRUE
}},
{
GB2312_CHARSET
,
0x8141
,
0x4e04
,
{
TRUE
,
TRUE
,
FALSE
,
FALSE
,
TRUE
,
FALSE
,
FALSE
,
FALSE
,
FALSE
,
FALSE
,
FALSE
,
TRUE
}},
{
CHINESEBIG5_CHARSET
,
0xa142
,
0x3001
,
{
TRUE
,
TRUE
,
FALSE
,
FALSE
,
TRUE
,
FALSE
,
FALSE
,
FALSE
,
FALSE
,
FALSE
,
FALSE
,
TRUE
}}
};
UINT
i
;
...
...
@@ -1057,9 +1064,18 @@ static void test_GetCharABCWidths(void)
for
(
j
=
0
;
j
<
sizeof
range
/
sizeof
range
[
0
];
++
j
)
{
memset
(
full
,
0xdd
,
sizeof
full
);
ret
=
pGetCharABCWidthsA
(
hdc
,
range
[
j
].
first
,
range
[
j
].
last
,
full
);
ok
(
ret
==
c
[
i
].
r
[
j
],
"GetCharABCWidthsA %x - %x should have %s
\n
"
,
range
[
j
].
first
,
range
[
j
].
last
,
c
[
i
].
r
[
j
]
?
"succeeded"
:
"failed"
);
if
(
ret
)
{
UINT
last
=
range
[
j
].
last
-
range
[
j
].
first
;
ret
=
pGetCharABCWidthsA
(
hdc
,
range
[
j
].
last
,
range
[
j
].
last
,
a
);
ok
(
ret
&&
memcmp
(
&
full
[
last
],
&
a
[
0
],
sizeof
(
ABC
))
==
0
,
"GetCharABCWidthsA %x should match. codepage = %u
\n
"
,
range
[
j
].
last
,
c
[
i
].
cs
);
}
}
hfont
=
SelectObject
(
hdc
,
hfont
);
...
...
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