Commit 4be7accf authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

usp10: Handle C2_ARABICNUMBER as numeric.

I.e., make sure ٬ and ٫ get classified as Script_Arabic_Numeric. Signed-off-by: 's avatarHenri Verbeet <hverbeet@codeweavers.com> Signed-off-by: 's avatarAric Stewart <aric@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent f1628183
......@@ -584,19 +584,19 @@ static const itemTest t74[4] = {{{0,0,0,0,0,0},0,0,0,0,1,latn_tag,FALSE},
{{0,0,0,0,0,0}, 3,0,0,0,1,arab_tag,FALSE},{{0,0,0,0,0,0}, 6,0,0,0,1,arab_tag,FALSE},
{{0,0,0,0,0,0}, 7,0,0,0,1,arab_tag,FALSE},{{0,0,0,0,0,0},10,0,0,0,1,arab_tag,FALSE},
{{0,0,0,0,0,0},11,0,0,0,1,arab_tag,FALSE},{{0,0,0,0,0,0},13,0,0,0,0,-1,FALSE}};
static const itemTest t574[] = {{{0,0,0,0,0,0}, 0,0,1,2,0,arab_tag,FALSE},{{0,0,1,0,0,0}, 2,0,1,2,0,arab_tag,FALSE},
{{0,0,0,0,0,0}, 3,0,1,2,0,arab_tag,FALSE},{{0,0,1,0,0,0}, 6,0,1,2,0,arab_tag,FALSE},
{{0,0,0,0,0,0}, 7,0,1,2,0,arab_tag,FALSE},{{0,0,1,0,0,0},10,0,1,2,0,arab_tag,FALSE},
static const itemTest t574[] = {{{0,0,0,0,0,0}, 0,0,1,2,0,arab_tag,FALSE},{{0,0,0,0,0,0}, 2,0,1,2,0,arab_tag,FALSE},
{{0,0,0,0,0,0}, 3,0,1,2,0,arab_tag,FALSE},{{0,0,0,0,0,0}, 6,0,1,2,0,arab_tag,FALSE},
{{0,0,0,0,0,0}, 7,0,1,2,0,arab_tag,FALSE},{{0,0,0,0,0,0},10,0,1,2,0,arab_tag,FALSE},
{{0,0,0,0,0,0},11,0,1,2,0,arab_tag,FALSE},{{0,0,0,0,0,0},13,0,0,0,0,-1,FALSE}};
/* Arabic numerals and punctuation. */
static const WCHAR test58[] = {0x0661, 0x0662, 0x066c, 0x0663, 0x0664, 0x0665, 0x066c, /* ١٢٬٣٤٥٬ */
0x0666, 0x0667, 0x0668, 0x066b, 0x0669, 0x0660}; /* ٦٧٨٫٩٠ */
static const itemTest t581[] = {{{0,1,0,1,0,0}, 0,0,1,2,0,arab_tag,FALSE},
{{1,1,1,1,1,0},13,0,0,0,0,-1,FALSE}};
{{0,0,0,0,0,0},13,0,0,0,0,-1,FALSE}};
static const itemTest t582[] = {{{0,1,1,1,0,1}, 0,0,0,0,1,arab_tag,FALSE},
{{1,1,1,1,1,0},13,0,0,0,0,-1,FALSE}};
{{0,0,0,0,0,0},13,0,0,0,0,-1,FALSE}};
static const itemTest t583[] = {{{0,0,0,0,0,0}, 0,0,1,2,0,arab_tag,FALSE},
{{1,0,0,1,1,0},13,0,0,0,0,-1,FALSE}};
{{0,0,0,0,0,0},13,0,0,0,0,-1,FALSE}};
SCRIPT_ITEM items[15];
SCRIPT_CONTROL Control;
......@@ -680,7 +680,7 @@ static const itemTest t74[4] = {{{0,0,0,0,0,0},0,0,0,0,1,latn_tag,FALSE},
test_items_ok(test47,26,NULL,NULL,1,t471,FALSE,0);
test_items_ok(test56,6,NULL,NULL,1,t561,FALSE,0);
test_items_ok(test57,13,NULL,NULL,7,t571,FALSE,0);
test_items_ok(test58,13,NULL,NULL,1,t581,TRUE,0);
test_items_ok(test58,13,NULL,NULL,1,t581,FALSE,0);
State.uBidiLevel = 0;
test_items_ok(test1,4,&Control,&State,1,t11,FALSE,0);
......@@ -745,7 +745,7 @@ static const itemTest t74[4] = {{{0,0,0,0,0,0},0,0,0,0,1,latn_tag,FALSE},
test_items_ok(test55,8,&Control,&State,2,t551,FALSE,0);
test_items_ok(test56,6,&Control,&State,1,t561,FALSE,0);
test_items_ok(test57,13,&Control,&State,7,t572,FALSE,0);
test_items_ok(test58,13,&Control,&State,1,t581,TRUE,0);
test_items_ok(test58,13,&Control,&State,1,t581,FALSE,0);
State.uBidiLevel = 1;
test_items_ok(test1,4,&Control,&State,1,t12,FALSE,0);
......@@ -802,7 +802,7 @@ static const itemTest t74[4] = {{{0,0,0,0,0,0},0,0,0,0,1,latn_tag,FALSE},
test_items_ok(test47,26,&Control,&State,1,t472,FALSE,0);
test_items_ok(test56,6,&Control,&State,1,t561,FALSE,0);
test_items_ok(test57,13,&Control,&State,7,t574,FALSE,0);
test_items_ok(test58,13,&Control,&State,1,t583,TRUE,0);
test_items_ok(test58,13,&Control,&State,1,t583,FALSE,0);
State.uBidiLevel = 1;
Control.fMergeNeutralItems = TRUE;
......@@ -860,7 +860,7 @@ static const itemTest t74[4] = {{{0,0,0,0,0,0},0,0,0,0,1,latn_tag,FALSE},
test_items_ok(test47,26,&Control,&State,1,t472,FALSE,0);
test_items_ok(test56,6,&Control,&State,1,t561,FALSE,0);
test_items_ok(test57,13,&Control,&State,7,t574,FALSE,0);
test_items_ok(test58,13,&Control,&State,1,t583,TRUE,0);
test_items_ok(test58,13,&Control,&State,1,t583,FALSE,0);
State.uBidiLevel = 0;
Control.fMergeNeutralItems = FALSE;
......@@ -927,7 +927,7 @@ static const itemTest t74[4] = {{{0,0,0,0,0,0},0,0,0,0,1,latn_tag,FALSE},
test_items_ok(test55,8,&Control,&State,2,t552,FALSE,0);
test_items_ok(test56,6,&Control,&State,1,t562,FALSE,0);
test_items_ok(test57,13,&Control,&State,7,t573,FALSE,0);
test_items_ok(test58,13,&Control,&State,1,t582,TRUE,0);
test_items_ok(test58,13,&Control,&State,1,t582,FALSE,0);
}
static inline void _test_shape_ok(int valid, HDC hdc, LPCWSTR string,
......
......@@ -891,7 +891,7 @@ static inline DWORD decode_surrogate_pair(LPCWSTR str, INT index, INT end)
static WORD get_char_script( LPCWSTR str, INT index, INT end, INT *consumed)
{
static const WCHAR latin_punc[] = {'#','$','&','\'',',',';','<','>','?','@','\\','^','_','`','{','|','}','~', 0x00a0, 0};
WORD type = 0;
WORD type = 0, type2 = 0;
DWORD ch;
int i;
......@@ -921,6 +921,7 @@ static WORD get_char_script( LPCWSTR str, INT index, INT end, INT *consumed)
}
GetStringTypeW(CT_CTYPE1, &str[index], 1, &type);
GetStringTypeW(CT_CTYPE2, &str[index], 1, &type2);
if (type == 0)
return SCRIPT_UNDEFINED;
......@@ -942,7 +943,7 @@ static WORD get_char_script( LPCWSTR str, INT index, INT end, INT *consumed)
if (ch >= scriptRanges[i].rangeFirst && ch <= scriptRanges[i].rangeLast)
{
if (scriptRanges[i].numericScript && type & C1_DIGIT)
if (scriptRanges[i].numericScript && (type & C1_DIGIT || type2 == C2_ARABICNUMBER))
return scriptRanges[i].numericScript;
if (scriptRanges[i].punctScript && type & C1_PUNCT)
return scriptRanges[i].punctScript;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment