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
e0829eb7
Commit
e0829eb7
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 ScriptStringCPtoX.
parent
bdbab217
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
12 deletions
+45
-12
usp10.c
dlls/usp10/tests/usp10.c
+6
-10
usp10.c
dlls/usp10/usp10.c
+39
-2
No files found.
dlls/usp10/tests/usp10.c
View file @
e0829eb7
...
...
@@ -795,10 +795,7 @@ static void test_ScriptStringXtoCP_CPtoX(HDC hdc)
ok
(
hr
==
S_OK
,
"ScriptStringCPtoX should return S_OK not %08x
\n
"
,
hr
);
hr
=
ScriptStringXtoCP
(
ssa
,
X
,
&
Ch
,
&
iTrailing
);
ok
(
hr
==
S_OK
,
"ScriptStringXtoCP should return S_OK not %08x
\n
"
,
hr
);
if
(
Cp
==
0
)
ok
(
Cp
==
Ch
,
"ScriptStringXtoCP should return Ch = %d not %d for X = %d
\n
"
,
Cp
,
Ch
,
X
);
else
todo_wine
ok
(
Cp
==
Ch
,
"ScriptStringXtoCP should return Ch = %d not %d for X = %d
\n
"
,
Cp
,
Ch
,
X
);
ok
(
iTrailing
==
FALSE
,
"ScriptStringXtoCP should return iTrailing = 0 not %d for X = %d
\n
"
,
iTrailing
,
X
);
fTrailing
=
TRUE
;
...
...
@@ -812,11 +809,10 @@ static void test_ScriptStringXtoCP_CPtoX(HDC hdc)
* one input to ScriptStringCPtoX. This means that the Cp to X position and back
* again works
*/
todo_wine
ok
(
Cp
+
1
==
Ch
,
"ScriptStringXtoCP should return Ch = %d not %d for X = %d
\n
"
,
Cp
+
1
,
Ch
,
X
);
ok
(
Cp
+
1
==
Ch
,
"ScriptStringXtoCP should return Ch = %d not %d for X = %d
\n
"
,
Cp
+
1
,
Ch
,
X
);
ok
(
iTrailing
==
FALSE
,
"ScriptStringXtoCP should return iTrailing = 0 not %d for X = %d
\n
"
,
iTrailing
,
X
);
}
/*
* This test is to check that if the X position is just inside the trailing edge of the
* character then iTrailing will indicate the trailing edge, ie. TRUE
...
...
@@ -828,7 +824,7 @@ static void test_ScriptStringXtoCP_CPtoX(HDC hdc)
X
--
;
/* put X just inside the trailing edge */
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
);
ok
(
Cp
==
Ch
,
"ScriptStringXtoCP should return Ch = %d not %d for X = %d
\n
"
,
Cp
,
Ch
,
X
);
ok
(
iTrailing
==
TRUE
,
"ScriptStringXtoCP should return iTrailing = 1 not %d for X = %d
\n
"
,
iTrailing
,
X
);
...
...
@@ -844,7 +840,7 @@ static void test_ScriptStringXtoCP_CPtoX(HDC hdc)
X
++
;
/* put X just outside the trailing edge */
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
);
ok
(
Cp
+
1
==
Ch
,
"ScriptStringXtoCP should return Ch = %d not %d for X = %d
\n
"
,
Cp
+
1
,
Ch
,
X
);
ok
(
iTrailing
==
FALSE
,
"ScriptStringXtoCP should return iTrailing = 0 not %d for X = %d
\n
"
,
iTrailing
,
X
);
...
...
@@ -860,7 +856,7 @@ static void test_ScriptStringXtoCP_CPtoX(HDC hdc)
X
--
;
/* put X just outside the leading edge */
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
);
ok
(
Cp
-
1
==
Ch
,
"ScriptStringXtoCP should return Ch = %d not %d for X = %d
\n
"
,
Cp
-
1
,
Ch
,
X
);
ok
(
iTrailing
==
TRUE
,
"ScriptStringXtoCP should return iTrailing = 1 not %d for X = %d
\n
"
,
iTrailing
,
X
);
...
...
@@ -887,13 +883,13 @@ static void test_ScriptStringXtoCP_CPtoX(HDC hdc)
fTrailing
=
FALSE
;
Cp
=
String_len
+
1
;
hr
=
ScriptStringCPtoX
(
ssa
,
Cp
,
fTrailing
,
&
X
);
todo_wine
ok
(
hr
==
E_INVALIDARG
,
"ScriptStringCPtoX should return E_INVALIDARG not %08x
\n
"
,
hr
);
ok
(
hr
==
E_INVALIDARG
,
"ScriptStringCPtoX should return E_INVALIDARG not %08x
\n
"
,
hr
);
hr
=
ScriptStringFree
(
&
ssa
);
/*
* ScriptStringCPtoX should free ssa, hence ScriptStringFree should fail
*/
todo_wine
ok
(
hr
==
E_INVALIDARG
,
"ScriptStringFree should return E_INVALIDARG not %08x
\n
"
,
hr
);
ok
(
hr
==
E_INVALIDARG
,
"ScriptStringFree should return E_INVALIDARG not %08x
\n
"
,
hr
);
}
}
...
...
dlls/usp10/usp10.c
View file @
e0829eb7
...
...
@@ -574,9 +574,46 @@ HRESULT WINAPI ScriptStringOut(SCRIPT_STRING_ANALYSIS ssa,
*/
HRESULT
WINAPI
ScriptStringCPtoX
(
SCRIPT_STRING_ANALYSIS
ssa
,
int
icp
,
BOOL
fTrailing
,
int
*
pX
)
{
FIXME
(
"(%p), %d, %d, (%p): stub
\n
"
,
ssa
,
icp
,
fTrailing
,
pX
);
*
pX
=
0
;
/* Set a reasonable value */
int
i
,
j
;
int
runningX
=
0
;
int
runningCp
=
0
;
StringAnalysis
*
analysis
=
ssa
;
TRACE
(
"(%p), %d, %d, (%p)
\n
"
,
ssa
,
icp
,
fTrailing
,
pX
);
if
(
!
ssa
||
!
pX
)
{
return
1
;
}
/* icp out of range */
if
(
icp
<
0
)
{
analysis
->
invalid
=
TRUE
;
return
E_INVALIDARG
;
}
for
(
i
=
0
;
i
<
analysis
->
numItems
;
i
++
)
{
for
(
j
=
0
;
j
<
analysis
->
glyphs
[
i
].
numGlyphs
;
j
++
)
{
if
(
runningCp
==
icp
&&
fTrailing
==
FALSE
)
{
*
pX
=
runningX
;
return
S_OK
;
}
runningX
+=
analysis
->
glyphs
[
i
].
piAdvance
[
j
];
if
(
runningCp
==
icp
&&
fTrailing
==
TRUE
)
{
*
pX
=
runningX
;
return
S_OK
;
}
runningCp
++
;
}
}
/* icp out of range */
analysis
->
invalid
=
TRUE
;
return
E_INVALIDARG
;
}
/***********************************************************************
...
...
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