Skip to content

Commit

Permalink
dwrite: Fix explicit levels returned for LRE and RLE control characters.
Browse files Browse the repository at this point in the history
Signed-off-by: Nikolay Sivov <[email protected]>
Signed-off-by: Alexandre Julliard <[email protected]>
  • Loading branch information
nsivov authored and julliard committed Apr 5, 2017
1 parent 98a8989 commit abfc973
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
4 changes: 2 additions & 2 deletions dlls/dwrite/bidi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down
6 changes: 0 additions & 6 deletions dlls/dwrite/tests/analyzer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
Expand Down
2 changes: 1 addition & 1 deletion dlls/dwrite/tests/layout.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit abfc973

Please sign in to comment.