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
af3dfc19
Commit
af3dfc19
authored
Apr 19, 2010
by
Aric Stewart
Committed by
Alexandre Julliard
Apr 19, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
usp10: Improve support for Syriac in ScriptItemize.
parent
4459c5b6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
82 additions
and
2 deletions
+82
-2
usp10.c
dlls/usp10/tests/usp10.c
+68
-0
usp10.c
dlls/usp10/usp10.c
+14
-2
No files found.
dlls/usp10/tests/usp10.c
View file @
af3dfc19
...
...
@@ -55,6 +55,10 @@ static void test_ScriptItemize( void )
static
const
WCHAR
test7
[]
=
{
'p'
,
'a'
,
'r'
,
't'
,
' '
,
'o'
,
'n'
,
'e'
,
' '
,
0x05d7
,
0x05dc
,
0x05e7
,
' '
,
0x05e9
,
0x05ea
,
0x05d9
,
0x05d9
,
0x05dd
,
' '
,
'p'
,
'a'
,
'r'
,
't'
,
' '
,
't'
,
'h'
,
'r'
,
'e'
,
'e'
,
0
};
static
const
WCHAR
test8
[]
=
{
0x0633
,
0x0644
,
0x0627
,
0x0645
,
0
};
/* Syriac (Like Arabic )*/
static
const
WCHAR
test9
[]
=
{
0x0710
,
0x0712
,
0x0712
,
0x0714
,
'.'
,
0
};
static
const
WCHAR
test10
[]
=
{
0x0717
,
0x0718
,
0x071a
,
0x071b
,
0
};
SCRIPT_ITEM
items
[
15
];
SCRIPT_CONTROL
Control
;
SCRIPT_STATE
State
;
...
...
@@ -407,6 +411,70 @@ static void test_ScriptItemize( void )
ok
(
items
[
0
].
a
.
fRTL
==
1
,
"Wrong fRTL
\n
"
);
ok
(
items
[
0
].
a
.
fLayoutRTL
==
1
,
"Wrong fLayoutRTL
\n
"
);
ok
(
items
[
0
].
a
.
s
.
uBidiLevel
==
1
,
"Wrong BidiLevel
\n
"
);
hr
=
ScriptItemize
(
test9
,
5
,
10
,
NULL
,
NULL
,
items
,
&
nItems
);
ok
(
!
hr
,
"ScriptItemize should return S_OK not %08x
\n
"
,
hr
);
ok
(
nItems
==
2
,
"Wrong number of items
\n
"
);
ok
(
items
[
0
].
iCharPos
==
0
,
"Wrong CharPos
\n
"
);
ok
(
items
[
0
].
a
.
fRTL
==
1
,
"Wrong fRTL
\n
"
);
ok
(
items
[
0
].
a
.
fLayoutRTL
==
1
,
"Wrong fLayoutRTL
\n
"
);
ok
(
items
[
0
].
a
.
s
.
uBidiLevel
==
1
,
"Wrong BidiLevel
\n
"
);
ok
(
items
[
1
].
iCharPos
==
4
,
"Wrong CharPos
\n
"
);
ok
(
items
[
1
].
a
.
fRTL
==
0
,
"Wrong fRTL
\n
"
);
ok
(
items
[
1
].
a
.
fLayoutRTL
==
0
,
"Wrong fLayoutRTL
\n
"
);
ok
(
items
[
1
].
a
.
s
.
uBidiLevel
==
0
,
"Wrong BidiLevel
\n
"
);
State
.
uBidiLevel
=
0
;
hr
=
ScriptItemize
(
test9
,
5
,
10
,
&
Control
,
&
State
,
items
,
&
nItems
);
ok
(
!
hr
,
"ScriptItemize should return S_OK not %08x
\n
"
,
hr
);
ok
(
nItems
==
2
,
"Wrong number of items
\n
"
);
ok
(
items
[
0
].
iCharPos
==
0
,
"Wrong CharPos
\n
"
);
ok
(
items
[
0
].
a
.
fRTL
==
1
,
"Wrong fRTL
\n
"
);
ok
(
items
[
0
].
a
.
fLayoutRTL
==
1
,
"Wrong fLayoutRTL
\n
"
);
ok
(
items
[
0
].
a
.
s
.
uBidiLevel
==
1
,
"Wrong BidiLevel
\n
"
);
ok
(
items
[
1
].
iCharPos
==
4
,
"Wrong CharPos
\n
"
);
ok
(
items
[
1
].
a
.
fRTL
==
0
,
"Wrong fRTL
\n
"
);
ok
(
items
[
1
].
a
.
fLayoutRTL
==
0
,
"Wrong fLayoutRTL
\n
"
);
ok
(
items
[
1
].
a
.
s
.
uBidiLevel
==
0
,
"Wrong BidiLevel
\n
"
);
State
.
uBidiLevel
=
1
;
hr
=
ScriptItemize
(
test9
,
5
,
10
,
&
Control
,
&
State
,
items
,
&
nItems
);
ok
(
!
hr
,
"ScriptItemize should return S_OK not %08x
\n
"
,
hr
);
ok
(
nItems
==
2
,
"Wrong number of items
\n
"
);
ok
(
items
[
0
].
iCharPos
==
0
,
"Wrong CharPos
\n
"
);
ok
(
items
[
0
].
a
.
fRTL
==
1
,
"Wrong fRTL
\n
"
);
ok
(
items
[
0
].
a
.
fLayoutRTL
==
1
,
"Wrong fLayoutRTL
\n
"
);
ok
(
items
[
0
].
a
.
s
.
uBidiLevel
==
1
,
"Wrong BidiLevel
\n
"
);
ok
(
items
[
1
].
iCharPos
==
4
,
"Wrong CharPos
\n
"
);
todo_wine
ok
(
items
[
1
].
a
.
fRTL
==
1
,
"Wrong fRTL
\n
"
);
todo_wine
ok
(
items
[
1
].
a
.
fLayoutRTL
==
1
,
"Wrong fLayoutRTL
\n
"
);
todo_wine
ok
(
items
[
1
].
a
.
s
.
uBidiLevel
==
1
,
"Wrong BidiLevel
\n
"
);
hr
=
ScriptItemize
(
test10
,
4
,
10
,
NULL
,
NULL
,
items
,
&
nItems
);
ok
(
!
hr
,
"ScriptItemize should return S_OK not %08x
\n
"
,
hr
);
ok
(
nItems
==
1
,
"Wrong number of items
\n
"
);
ok
(
items
[
0
].
iCharPos
==
0
,
"Wrong CharPos
\n
"
);
ok
(
items
[
0
].
a
.
fRTL
==
1
,
"Wrong fRTL
\n
"
);
ok
(
items
[
0
].
a
.
fLayoutRTL
==
1
,
"Wrong fLayoutRTL
\n
"
);
ok
(
items
[
0
].
a
.
s
.
uBidiLevel
==
1
,
"Wrong BidiLevel
\n
"
);
State
.
uBidiLevel
=
0
;
hr
=
ScriptItemize
(
test10
,
4
,
10
,
&
Control
,
&
State
,
items
,
&
nItems
);
ok
(
!
hr
,
"ScriptItemize should return S_OK not %08x
\n
"
,
hr
);
ok
(
nItems
==
1
,
"Wrong number of items
\n
"
);
ok
(
items
[
0
].
iCharPos
==
0
,
"Wrong CharPos
\n
"
);
ok
(
items
[
0
].
a
.
fRTL
==
1
,
"Wrong fRTL
\n
"
);
ok
(
items
[
0
].
a
.
fLayoutRTL
==
1
,
"Wrong fLayoutRTL
\n
"
);
ok
(
items
[
0
].
a
.
s
.
uBidiLevel
==
1
,
"Wrong BidiLevel
\n
"
);
State
.
uBidiLevel
=
1
;
hr
=
ScriptItemize
(
test10
,
4
,
10
,
&
Control
,
&
State
,
items
,
&
nItems
);
ok
(
!
hr
,
"ScriptItemize should return S_OK not %08x
\n
"
,
hr
);
ok
(
nItems
==
1
,
"Wrong number of items
\n
"
);
ok
(
items
[
0
].
iCharPos
==
0
,
"Wrong CharPos
\n
"
);
ok
(
items
[
0
].
a
.
fRTL
==
1
,
"Wrong fRTL
\n
"
);
ok
(
items
[
0
].
a
.
fLayoutRTL
==
1
,
"Wrong fLayoutRTL
\n
"
);
ok
(
items
[
0
].
a
.
s
.
uBidiLevel
==
1
,
"Wrong BidiLevel
\n
"
);
}
...
...
dlls/usp10/usp10.c
View file @
af3dfc19
...
...
@@ -519,8 +519,11 @@ HRESULT WINAPI ScriptItemize(const WCHAR *pwcInChars, int cInChars, int cMaxItem
#define Arabic_stop 0x06ff
#define Hebrew_start 0x0590
#define Hebrew_stop 0x05ff
#define Syriac_start 0x0700
#define Syriac_stop 0x074f
#define Latin_start 0x0001
#define Latin_stop 0x024f
#define Script_Syriac 8
#define Script_Hebrew 7
#define Script_Arabic 6
#define Script_Latin 1
...
...
@@ -574,6 +577,9 @@ HRESULT WINAPI ScriptItemize(const WCHAR *pwcInChars, int cInChars, int cMaxItem
if
(
pwcInChars
[
cnt
]
>=
Hebrew_start
&&
pwcInChars
[
cnt
]
<=
Hebrew_stop
)
pItems
[
index
].
a
.
eScript
=
Script_Hebrew
;
else
if
(
pwcInChars
[
cnt
]
>=
Syriac_start
&&
pwcInChars
[
cnt
]
<=
Syriac_stop
)
pItems
[
index
].
a
.
eScript
=
Script_Syriac
;
else
if
(
pwcInChars
[
cnt
]
>=
Latin_start
&&
pwcInChars
[
cnt
]
<=
Latin_stop
)
pItems
[
index
].
a
.
eScript
=
Script_Latin
;
...
...
@@ -584,7 +590,8 @@ HRESULT WINAPI ScriptItemize(const WCHAR *pwcInChars, int cInChars, int cMaxItem
pItems
[
index
].
a
.
s
.
uBidiLevel
=
levels
[
cnt
];
}
else
if
((
pItems
[
index
].
a
.
eScript
==
Script_Arabic
)
||
(
pItems
[
index
].
a
.
eScript
==
Script_Hebrew
))
(
pItems
[
index
].
a
.
eScript
==
Script_Hebrew
)
||
(
pItems
[
index
].
a
.
eScript
==
Script_Syriac
))
{
pItems
[
index
].
a
.
s
.
uBidiLevel
=
1
;
pItems
[
index
].
a
.
fRTL
=
1
;
...
...
@@ -619,6 +626,10 @@ HRESULT WINAPI ScriptItemize(const WCHAR *pwcInChars, int cInChars, int cMaxItem
||
(
New_Script
==
Script_Hebrew
&&
pwcInChars
[
cnt
]
==
Numeric_space
))
New_Script
=
Script_Hebrew
;
else
if
((
pwcInChars
[
cnt
]
>=
Syriac_start
&&
pwcInChars
[
cnt
]
<=
Syriac_stop
)
||
(
New_Script
==
Script_Syriac
&&
pwcInChars
[
cnt
]
==
Numeric_space
))
New_Script
=
Script_Syriac
;
else
if
((
pwcInChars
[
cnt
]
>=
Latin_start
&&
pwcInChars
[
cnt
]
<=
Latin_stop
)
||
(
New_Script
==
Script_Latin
&&
pwcInChars
[
cnt
]
==
Numeric_space
))
New_Script
=
Script_Latin
;
...
...
@@ -642,7 +653,8 @@ HRESULT WINAPI ScriptItemize(const WCHAR *pwcInChars, int cInChars, int cMaxItem
pItems
[
index
].
a
.
s
.
uBidiLevel
=
levels
[
cnt
];
}
else
if
((
New_Script
==
Script_Arabic
)
||
(
New_Script
==
Script_Hebrew
))
(
New_Script
==
Script_Hebrew
)
||
(
New_Script
==
Script_Syriac
))
{
pItems
[
index
].
a
.
s
.
uBidiLevel
=
1
;
pItems
[
index
].
a
.
fRTL
=
1
;
...
...
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