Commit e17e6e42 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

dwrite: Use enum members for class testing, simplify reseting to NI before applying Nx rules.

parent 3d34f29b
......@@ -759,16 +759,18 @@ static void bidi_resolve_neutrals(IsolatedRun *run)
/* Translate isolates into NI */
for (i = 0; i < run->length; i++) {
if (bidi_is_isolate(*run->item[i].class))
*run->item[i].class = NI;
switch (*run->item[i].class) {
case B:
case S:
case WS: *run->item[i].class = NI;
case WS:
case FSI:
case LRI:
case RLI:
case PDI: *run->item[i].class = NI;
}
ASSERT(*run->item[i].class < 5 || *run->item[i].class == BN); /* "Only NI, L, R, AN, EN and BN are allowed" */
/* "Only NI, L, R, AN, EN and BN are allowed" */
ASSERT(*run->item[i].class <= EN || *run->item[i].class == BN);
}
/* N0: Skipping bracketed pairs for now */
......@@ -900,8 +902,8 @@ static void bidi_resolve_implicit(const UINT8 *classes, UINT8 *levels, int sos,
if (classes[i] == BN)
continue;
ASSERT(classes[i] > 0); /* "No Neutrals allowed to survive here." */
ASSERT(classes[i] < 5); /* "Out of range." */
ASSERT(classes[i] != ON); /* "No Neutrals allowed to survive here." */
ASSERT(classes[i] <= EN); /* "Out of range." */
if (odd(levels[i]) && (classes[i] == L || classes[i] == EN || classes[i] == AN))
levels[i]++;
......
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