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
bdbab217
Commit
bdbab217
authored
Dec 15, 2006
by
Clinton Stimpson
Committed by
Alexandre Julliard
Dec 18, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
usp10: Implement ScriptStringXtoCP.
parent
857e330e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
5 deletions
+48
-5
usp10.c
dlls/usp10/tests/usp10.c
+2
-2
usp10.c
dlls/usp10/usp10.c
+46
-3
No files found.
dlls/usp10/tests/usp10.c
View file @
bdbab217
...
...
@@ -829,7 +829,7 @@ static void test_ScriptStringXtoCP_CPtoX(HDC hdc)
hr
=
ScriptStringXtoCP
(
ssa
,
X
,
&
Ch
,
&
iTrailing
);
ok
(
hr
==
S_OK
,
"ScriptStringXtoCP should return S_OK not %08x
\n
"
,
hr
);
todo_wine
ok
(
Cp
==
Ch
,
"ScriptStringXtoCP should return Ch = %d not %d for X = %d
\n
"
,
Cp
,
Ch
,
X
);
todo_wine
ok
(
iTrailing
==
TRUE
,
"ScriptStringXtoCP should return iTrailing = 1 not %d for X = %d
\n
"
,
ok
(
iTrailing
==
TRUE
,
"ScriptStringXtoCP should return iTrailing = 1 not %d for X = %d
\n
"
,
iTrailing
,
X
);
/*
...
...
@@ -861,7 +861,7 @@ static void test_ScriptStringXtoCP_CPtoX(HDC hdc)
hr
=
ScriptStringXtoCP
(
ssa
,
X
,
&
Ch
,
&
iTrailing
);
ok
(
hr
==
S_OK
,
"ScriptStringXtoCP should return S_OK not %08x
\n
"
,
hr
);
todo_wine
ok
(
Cp
-
1
==
Ch
,
"ScriptStringXtoCP should return Ch = %d not %d for X = %d
\n
"
,
Cp
-
1
,
Ch
,
X
);
todo_wine
ok
(
iTrailing
==
TRUE
,
"ScriptStringXtoCP should return iTrailing = 1 not %d for X = %d
\n
"
,
ok
(
iTrailing
==
TRUE
,
"ScriptStringXtoCP should return iTrailing = 1 not %d for X = %d
\n
"
,
iTrailing
,
X
);
/*
...
...
dlls/usp10/usp10.c
View file @
bdbab217
...
...
@@ -585,12 +585,55 @@ HRESULT WINAPI ScriptStringCPtoX(SCRIPT_STRING_ANALYSIS ssa, int icp, BOOL fTrai
*/
HRESULT
WINAPI
ScriptStringXtoCP
(
SCRIPT_STRING_ANALYSIS
ssa
,
int
iX
,
int
*
piCh
,
int
*
piTrailing
)
{
FIXME
(
"(%p), %d, (%p), (%p): stub
\n
"
,
ssa
,
iX
,
piCh
,
piTrailing
);
*
piCh
=
0
;
/* Set a reasonable value */
*
piTrailing
=
0
;
StringAnalysis
*
analysis
=
ssa
;
int
i
;
int
j
;
int
runningX
=
0
;
int
runningCp
=
0
;
int
width
;
TRACE
(
"(%p), %d, (%p), (%p)
\n
"
,
ssa
,
iX
,
piCh
,
piTrailing
);
if
(
!
ssa
||
!
piCh
||
!
piTrailing
)
{
return
1
;
}
/* out of range */
if
(
iX
<
0
)
{
*
piCh
=
-
1
;
*
piTrailing
=
TRUE
;
return
S_OK
;
}
for
(
i
=
0
;
i
<
analysis
->
numItems
;
i
++
)
{
for
(
j
=
0
;
j
<
analysis
->
glyphs
[
i
].
numGlyphs
;
j
++
)
{
width
=
analysis
->
glyphs
[
i
].
piAdvance
[
j
];
if
(
iX
<
(
runningX
+
width
))
{
*
piCh
=
runningCp
;
if
((
iX
-
runningX
)
>
width
/
2
)
*
piTrailing
=
TRUE
;
else
*
piTrailing
=
FALSE
;
return
S_OK
;
}
runningX
+=
width
;
runningCp
++
;
}
}
/* out of range */
*
piCh
=
analysis
->
pItem
[
analysis
->
numItems
].
iCharPos
;
*
piTrailing
=
FALSE
;
return
S_OK
;
}
/***********************************************************************
* ScriptStringFree (USP10.@)
*
...
...
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