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
7891f05b
Commit
7891f05b
authored
Oct 29, 2010
by
Aric Stewart
Committed by
Alexandre Julliard
Nov 01, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ups10: Corrected rtl implementation for ScriptStringXtoCP and ScriptStringXtoCP.
parent
5f6ea28c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
15 deletions
+25
-15
usp10.c
dlls/usp10/tests/usp10.c
+5
-11
usp10.c
dlls/usp10/usp10.c
+20
-4
No files found.
dlls/usp10/tests/usp10.c
View file @
7891f05b
...
...
@@ -1363,7 +1363,7 @@ static void test_ScriptStringXtoCP_CPtoX(HDC hdc)
hr
=
ScriptStringCPtoX
(
ssa
,
Cp
,
FALSE
,
&
lead
);
ok
(
hr
==
S_OK
,
"ScriptStringCPtoX should return S_OK not %08x
\n
"
,
hr
);
if
(
rtl
[
Cp
])
todo_wine
ok
(
lead
>
trail
,
"Leading values should be after trialing for rtl chracters(%i)
\n
"
,
Cp
);
ok
(
lead
>
trail
,
"Leading values should be after trialing for rtl chracters(%i)
\n
"
,
Cp
);
else
ok
(
lead
<
trail
,
"Trailing values should be after leading for ltr chracters(%i)
\n
"
,
Cp
);
...
...
@@ -1375,9 +1375,7 @@ static void test_ScriptStringXtoCP_CPtoX(HDC hdc)
if
(
rtl
[
Cp
])
X
--
;
else
X
++
;
hr
=
ScriptStringXtoCP
(
ssa
,
X
,
&
Ch
,
&
iTrailing
);
ok
(
hr
==
S_OK
,
"ScriptStringXtoCP should return S_OK not %08x
\n
"
,
hr
);
if
(
rtl
[
Cp
])
todo_wine
ok
(
Cp
==
Ch
,
"ScriptStringXtoCP should return Ch = %d not %d for X = %d
\n
"
,
Cp
,
Ch
,
trail
);
if
(
rtl
[
Cp
])
todo_wine
ok
(
iTrailing
==
FALSE
,
"ScriptStringXtoCP should return iTrailing = 0 not %d for X = %d
\n
"
,
iTrailing
,
X
);
...
...
@@ -1386,9 +1384,7 @@ static void test_ScriptStringXtoCP_CPtoX(HDC hdc)
if
(
rtl
[
Cp
])
X
++
;
else
X
--
;
hr
=
ScriptStringXtoCP
(
ssa
,
X
,
&
Ch
,
&
iTrailing
);
ok
(
hr
==
S_OK
,
"ScriptStringXtoCP should return S_OK not %08x
\n
"
,
hr
);
if
(
rtl
[
Cp
])
todo_wine
ok
(
Cp
==
Ch
,
"ScriptStringXtoCP should return Ch = %d not %d for X = %d
\n
"
,
Cp
,
Ch
,
trail
);
if
(
rtl
[
Cp
])
todo_wine
ok
(
iTrailing
==
TRUE
,
"ScriptStringXtoCP should return iTrailing = 1 not %d for X = %d
\n
"
,
iTrailing
,
X
);
...
...
@@ -1399,10 +1395,9 @@ static void test_ScriptStringXtoCP_CPtoX(HDC hdc)
X
++
;
hr
=
ScriptStringXtoCP
(
ssa
,
X
,
&
Ch
,
&
iTrailing
);
ok
(
hr
==
S_OK
,
"ScriptStringXtoCP should return S_OK not %08x
\n
"
,
hr
);
if
(
rtl
[
Cp
])
todo_wine
ok
(
Cp
+
1
==
Ch
,
"ScriptStringXtoCP should return Ch = %d not %d for X = %d
\n
"
,
Cp
+
1
,
Ch
,
trail
);
if
(
rtl
[
Cp
+
1
])
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
);
else
ok
(
iTrailing
==
FALSE
,
"ScriptStringXtoCP should return iTrailing = 0 not %d for X = %d
\n
"
,
...
...
@@ -1416,10 +1411,9 @@ static void test_ScriptStringXtoCP_CPtoX(HDC hdc)
X
--
;
hr
=
ScriptStringXtoCP
(
ssa
,
X
,
&
Ch
,
&
iTrailing
);
ok
(
hr
==
S_OK
,
"ScriptStringXtoCP should return S_OK not %08x
\n
"
,
hr
);
if
(
rtl
[
Cp
])
todo_wine
ok
(
Cp
-
1
==
Ch
,
"ScriptStringXtoCP should return Ch = %d not %d for X = %d
\n
"
,
Cp
-
1
,
Ch
,
trail
);
if
(
Cp
!=
0
&&
rtl
[
Cp
-
1
])
todo_wine
ok
(
iTrailing
==
FALSE
,
"ScriptStringXtoCP should return iTrailing = 0 not %d for X = %d
\n
"
,
ok
(
iTrailing
==
FALSE
,
"ScriptStringXtoCP should return iTrailing = 0 not %d for X = %d
\n
"
,
iTrailing
,
X
);
else
ok
(
iTrailing
==
TRUE
,
"ScriptStringXtoCP should return iTrailing = 1 not %d for X = %d
\n
"
,
...
...
@@ -1436,8 +1430,8 @@ static void test_ScriptStringXtoCP_CPtoX(HDC hdc)
X
--
;
hr
=
ScriptStringXtoCP
(
ssa
,
X
,
&
Ch
,
&
iTrailing
);
ok
(
hr
==
S_OK
,
"ScriptStringXtoCP should return S_OK not %08x
\n
"
,
hr
);
todo_wine
ok
(
Ch
==
1
,
"ScriptStringXtoCP should return Ch = 1 not %d for X outside leading edge when rtl
\n
"
,
Ch
);
todo_wine
ok
(
iTrailing
==
FALSE
,
"ScriptStringXtoCP should return iTrailing = 0 not %d for X = outside leading edge when rtl
\n
"
,
ok
(
Ch
==
1
,
"ScriptStringXtoCP should return Ch = 1 not %d for X outside leading edge when rtl
\n
"
,
Ch
);
ok
(
iTrailing
==
FALSE
,
"ScriptStringXtoCP should return iTrailing = 0 not %d for X = outside leading edge when rtl
\n
"
,
iTrailing
);
}
else
...
...
dlls/usp10/usp10.c
View file @
7891f05b
...
...
@@ -936,6 +936,7 @@ HRESULT WINAPI ScriptStringCPtoX(SCRIPT_STRING_ANALYSIS ssa, int icp, BOOL fTrai
int
runningX
=
0
;
int
runningCp
=
0
;
StringAnalysis
*
analysis
=
ssa
;
BOOL
itemTrailing
;
TRACE
(
"(%p), %d, %d, (%p)
\n
"
,
ssa
,
icp
,
fTrailing
,
pX
);
...
...
@@ -950,15 +951,19 @@ HRESULT WINAPI ScriptStringCPtoX(SCRIPT_STRING_ANALYSIS ssa, int icp, BOOL fTrai
for
(
i
=
0
;
i
<
analysis
->
numItems
;
i
++
)
{
if
(
analysis
->
pItem
[
i
].
a
.
fRTL
)
itemTrailing
=
!
fTrailing
;
else
itemTrailing
=
fTrailing
;
for
(
j
=
0
;
j
<
analysis
->
glyphs
[
i
].
numGlyphs
;
j
++
)
{
if
(
runningCp
==
icp
&&
f
Trailing
==
FALSE
)
if
(
runningCp
==
icp
&&
item
Trailing
==
FALSE
)
{
*
pX
=
runningX
;
return
S_OK
;
}
runningX
+=
analysis
->
glyphs
[
i
].
piAdvance
[
j
];
if
(
runningCp
==
icp
&&
f
Trailing
==
TRUE
)
if
(
runningCp
==
icp
&&
item
Trailing
==
TRUE
)
{
*
pX
=
runningX
;
return
S_OK
;
...
...
@@ -992,8 +997,16 @@ HRESULT WINAPI ScriptStringXtoCP(SCRIPT_STRING_ANALYSIS ssa, int iX, int* piCh,
/* out of range */
if
(
iX
<
0
)
{
*
piCh
=
-
1
;
*
piTrailing
=
TRUE
;
if
(
analysis
->
pItem
[
0
].
a
.
fRTL
)
{
*
piCh
=
1
;
*
piTrailing
=
FALSE
;
}
else
{
*
piCh
=
-
1
;
*
piTrailing
=
TRUE
;
}
return
S_OK
;
}
...
...
@@ -1009,6 +1022,9 @@ HRESULT WINAPI ScriptStringXtoCP(SCRIPT_STRING_ANALYSIS ssa, int iX, int* piCh,
*
piTrailing
=
TRUE
;
else
*
piTrailing
=
FALSE
;
if
(
analysis
->
pItem
[
i
].
a
.
fRTL
)
*
piTrailing
=
!*
piTrailing
;
return
S_OK
;
}
runningX
+=
width
;
...
...
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