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

dwrite: Fix explicit levels returned for LRE and RLE control characters.

parent 98a89899
......@@ -278,7 +278,7 @@ static void bidi_resolve_explicit(UINT8 baselevel, UINT8 *classes, UINT8 *levels
/* X2 */
case RLE:
least_odd = get_greater_odd_level(stack[stack_top].level);
levels[i] = stack[stack_top].level;
levels[i] = valid_level(least_odd) ? least_odd : stack[stack_top].level;
if (valid_level(least_odd))
push_stack(least_odd, NI, FALSE);
else if (overflow_isolate_count == 0)
......@@ -288,7 +288,7 @@ static void bidi_resolve_explicit(UINT8 baselevel, UINT8 *classes, UINT8 *levels
/* X3 */
case LRE:
least_even = get_greater_even_level(stack[stack_top].level);
levels[i] = stack[stack_top].level;
levels[i] = valid_level(least_even) ? least_even : stack[stack_top].level;
if (valid_level(least_even))
push_stack(least_even, NI, FALSE);
else if (overflow_isolate_count == 0)
......
......@@ -2282,42 +2282,36 @@ static const struct bidi_test bidi_tests[] = {
DWRITE_READING_DIRECTION_LEFT_TO_RIGHT,
{ 2, 2, 0, 0 },
{ 0, 0, 0, 0 },
TRUE
},
{
{ 'a', LRE, PDF, 'b', 0 },
DWRITE_READING_DIRECTION_LEFT_TO_RIGHT,
{ 0, 2, 2, 0 },
{ 0, 0, 0, 0 },
TRUE
},
{
{ RLE, PDF, 'a', 'b', 0 },
DWRITE_READING_DIRECTION_LEFT_TO_RIGHT,
{ 1, 1, 0, 0 },
{ 0, 0, 0, 0 },
TRUE
},
{
{ 'a', RLE, PDF, 'b', 0 },
DWRITE_READING_DIRECTION_LEFT_TO_RIGHT,
{ 0, 1, 1, 0 },
{ 0, 0, 0, 0 },
TRUE
},
{
{ 'a', RLE, PDF, 'b', 0 },
DWRITE_READING_DIRECTION_RIGHT_TO_LEFT,
{ 1, 3, 3, 1 },
{ 2, 2, 2, 2 },
TRUE
},
{
{ LRE, PDF, 'a', 'b', 0 },
DWRITE_READING_DIRECTION_RIGHT_TO_LEFT,
{ 2, 2, 1, 1 },
{ 1, 1, 2, 2 },
TRUE
},
{
{ PDF, 'a', 'b', 0 },
......
......@@ -1648,7 +1648,7 @@ todo_wine
flush_sequence(sequences, RENDERER_ID);
hr = IDWriteTextLayout_Draw(layout, &ctxt, &testrenderer, 0.0, 0.0);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok_sequence(sequences, RENDERER_ID, draw_seq3, "draw test 3", TRUE);
ok_sequence(sequences, RENDERER_ID, draw_seq3, "draw test 3", FALSE);
IDWriteTextLayout_Release(layout);
/* strikethrough splits ranges from renderer point of view, but doesn't break
......
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