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
39a5b076
Commit
39a5b076
authored
Dec 11, 2006
by
Clinton Stimpson
Committed by
Alexandre Julliard
Dec 12, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
usp10: Add tests and fix for ScriptXtoCP .
parent
aa8392c9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
3 deletions
+23
-3
usp10.c
dlls/usp10/tests/usp10.c
+19
-0
usp10.c
dlls/usp10/usp10.c
+4
-3
No files found.
dlls/usp10/tests/usp10.c
View file @
39a5b076
...
...
@@ -574,6 +574,25 @@ static void test_ScriptXtoX(void)
ok
(
hr
==
S_OK
,
"ScriptXtoCP should return S_OK not %08x
\n
"
,
hr
);
ok
(
piCP
==
4
,
"iX=%d should return piCP=4 not %d
\n
"
,
iX
,
piCP
);
iX
=
0
;
cChars
=
10
;
cGlyphs
=
10
;
hr
=
ScriptXtoCP
(
iX
,
cChars
,
cGlyphs
,
pwLogClust
,
psva
,
piAdvance
,
&
psa
,
&
piCP
,
&
piTrailing
);
ok
(
hr
==
S_OK
,
"ScriptXtoCP should return S_OK not %08x
\n
"
,
hr
);
ok
(
piCP
==
0
,
"iX=%d should return piCP=0 not %d
\n
"
,
iX
,
piCP
);
iX
=
195
;
cChars
=
10
;
cGlyphs
=
10
;
hr
=
ScriptXtoCP
(
iX
,
cChars
,
cGlyphs
,
pwLogClust
,
psva
,
piAdvance
,
&
psa
,
&
piCP
,
&
piTrailing
);
ok
(
hr
==
S_OK
,
"ScriptXtoCP should return S_OK not %08x
\n
"
,
hr
);
ok
(
piCP
==
0
,
"iX=%d should return piCP=0 not %d
\n
"
,
iX
,
piCP
);
iX
=
196
;
cChars
=
10
;
cGlyphs
=
10
;
hr
=
ScriptXtoCP
(
iX
,
cChars
,
cGlyphs
,
pwLogClust
,
psva
,
piAdvance
,
&
psa
,
&
piCP
,
&
piTrailing
);
ok
(
hr
==
S_OK
,
"ScriptXtoCP should return S_OK not %08x
\n
"
,
hr
);
ok
(
piCP
==
1
,
"iX=%d should return piCP=1 not %d
\n
"
,
iX
,
piCP
);
iCP
=
5
;
fTrailing
=
FALSE
;
cChars
=
10
;
...
...
dlls/usp10/usp10.c
View file @
39a5b076
...
...
@@ -561,7 +561,7 @@ HRESULT WINAPI ScriptXtoCP(int iX,
int
*
piTrailing
)
{
int
item
;
int
iPosX
=
1
;
int
iPosX
;
float
fMaxPosX
=
1
;
float
fAvePosX
;
TRACE
(
"(%d,%d,%d,%p,%p,%p,%p,%p,%p)
\n
"
,
...
...
@@ -585,8 +585,9 @@ HRESULT WINAPI ScriptXtoCP(int iX,
}
fAvePosX
=
fMaxPosX
/
cGlyphs
;
for
(
item
=
0
;
item
<
cGlyphs
&&
iPosX
<
iX
;
item
++
)
iPosX
=
fAvePosX
*
(
item
+
1
);
iPosX
=
fAvePosX
;
for
(
item
=
1
;
item
<
cGlyphs
&&
iPosX
<
iX
;
item
++
)
iPosX
+=
fAvePosX
;
if
(
iPosX
-
iX
>
fAvePosX
/
2
)
*
piTrailing
=
0
;
else
...
...
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