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
65710af2
Commit
65710af2
authored
Nov 08, 2011
by
Aric Stewart
Committed by
Alexandre Julliard
Nov 09, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
usp10: Better understand and handle numbers level in RTL runs.
parent
2781ac1e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
4 deletions
+28
-4
usp10.c
dlls/usp10/tests/usp10.c
+1
-1
usp10.c
dlls/usp10/usp10.c
+27
-3
No files found.
dlls/usp10/tests/usp10.c
View file @
65710af2
...
...
@@ -153,7 +153,7 @@ static void test_ScriptItemize( void )
/* Arabic, English*/
static
const
WCHAR
test2
[]
=
{
'1'
,
'2'
,
'3'
,
'-'
,
'5'
,
'2'
,
0x064a
,
0x064f
,
0x0633
,
0x0627
,
0x0648
,
0x0650
,
0x064a
,
'7'
,
'1'
,
'.'
,
0
};
static
const
itemTest
t21
[
7
]
=
{{{
0
,
0
,
0
,
0
,
0
},
0
,
0
,
0
,
0
,
0
},{{
0
,
0
,
0
,
0
,
0
},
3
,
0
,
0
,
0
,
0
},{{
0
,
0
,
0
,
0
,
0
},
4
,
0
,
0
,
0
,
0
},{{
0
,
0
,
0
,
0
,
0
},
6
,
1
,
1
,
1
,
arab_tag
},{{
0
,
0
,
0
,
0
,
0
},
13
,
0
,
0
,
0
,
0
},{{
0
,
0
,
0
,
0
,
0
},
15
,
0
,
0
,
0
,
0
},{{
0
,
0
,
0
,
0
,
0
},
16
,
0
,
0
,
0
,
-
1
}};
static
const
itemTest
t22
[
5
]
=
{{{
0
,
0
,
0
,
1
,
0
},
0
,
0
,
0
,
2
,
0
},{{
0
,
0
,
0
,
0
,
0
},
6
,
1
,
1
,
1
,
arab_tag
},{{
0
,
0
,
1
,
0
,
0
},
13
,
0
,
1
,
2
,
0
},{{
0
,
0
,
0
,
0
,
0
},
15
,
0
,
0
,
0
,
0
},{{
0
,
0
,
0
,
0
,
0
},
16
,
0
,
0
,
0
,
-
1
}};
static
const
itemTest
t22
[
5
]
=
{{{
0
,
0
,
0
,
0
,
0
},
0
,
0
,
0
,
2
,
0
},{{
0
,
0
,
0
,
0
,
0
},
6
,
1
,
1
,
1
,
arab_tag
},{{
0
,
0
,
1
,
0
,
0
},
13
,
0
,
1
,
2
,
0
},{{
0
,
0
,
0
,
0
,
0
},
15
,
0
,
0
,
0
,
0
},{{
0
,
0
,
0
,
0
,
0
},
16
,
0
,
0
,
0
,
-
1
}};
static
const
itemTest
t23
[
5
]
=
{{{
0
,
0
,
1
,
0
,
0
},
0
,
0
,
1
,
2
,
0
},{{
0
,
0
,
0
,
0
,
0
},
6
,
1
,
1
,
1
,
arab_tag
},{{
0
,
0
,
1
,
0
,
0
},
13
,
0
,
1
,
2
,
0
},{{
0
,
0
,
0
,
0
,
0
},
15
,
1
,
1
,
1
,
0
},{{
0
,
0
,
0
,
0
,
0
},
16
,
0
,
0
,
0
,
-
1
}};
static
const
WCHAR
test2b
[]
=
{
'A'
,
'B'
,
'C'
,
'-'
,
'D'
,
'E'
,
'F'
,
' '
,
0x0621
,
0x0623
,
0x0624
,
0
};
...
...
dlls/usp10/usp10.c
View file @
65710af2
...
...
@@ -806,10 +806,34 @@ HRESULT WINAPI ScriptItemizeOpenType(const WCHAR *pwcInChars, int cInChars, int
}
else
{
if
(
!
psControl
->
fMergeNeutralItems
)
BOOL
inNumber
=
FALSE
;
static
WCHAR
math_punc
[]
=
{
'#'
,
'$'
,
'%'
,
'+'
,
','
,
'-'
,
'.'
,
'/'
,
':'
,
0x2212
,
0x2044
,
0x00a0
,
0
};
strength
=
heap_alloc_zero
(
cInChars
*
sizeof
(
WORD
));
if
(
!
strength
)
{
heap_free
(
levels
);
return
E_OUTOFMEMORY
;
}
BIDI_GetStrengths
(
pwcInChars
,
cInChars
,
psControl
,
strength
);
/* Script_Numeric and select puncuation at level 0 get bumped to level 2 */
for
(
i
=
0
;
i
<
cInChars
;
i
++
)
{
if
((
levels
[
i
]
==
0
||
(
odd
(
psState
->
uBidiLevel
)
&&
levels
[
i
]
==
psState
->
uBidiLevel
+
1
))
&&
inNumber
&&
strchrW
(
math_punc
,
pwcInChars
[
i
]))
levels
[
i
]
=
2
;
else
if
((
levels
[
i
]
==
0
||
(
odd
(
psState
->
uBidiLevel
)
&&
levels
[
i
]
==
psState
->
uBidiLevel
+
1
))
&&
get_char_script
(
pwcInChars
[
i
])
==
Script_Numeric
)
{
levels
[
i
]
=
2
;
inNumber
=
TRUE
;
}
else
inNumber
=
FALSE
;
}
if
(
psControl
->
fMergeNeutralItems
)
{
strength
=
heap_alloc_zero
(
cInChars
*
sizeof
(
WORD
)
);
BIDI_GetStrengths
(
pwcInChars
,
cInChars
,
psControl
,
strength
)
;
HeapFree
(
GetProcessHeap
(),
0
,
strength
);
strength
=
NULL
;
}
}
}
...
...
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