diff options
| author | Eli Zaretskii | 2014-09-24 11:06:26 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2014-09-24 11:06:26 +0300 |
| commit | f0d89bb4d7a0a2013ecaa134af7c9c902e04c1cd (patch) | |
| tree | a6f63ee897d42114aaf173a6cd7de822b06e831a /src | |
| parent | 61a403ecde239da3712469adbb183d0ed25b81f1 (diff) | |
| download | emacs-f0d89bb4d7a0a2013ecaa134af7c9c902e04c1cd.tar.gz emacs-f0d89bb4d7a0a2013ecaa134af7c9c902e04c1cd.zip | |
Adapt bidi_resolve_neutral to new treatment of PDF to avoid assertion violations.
Diffstat (limited to 'src')
| -rw-r--r-- | src/bidi.c | 41 |
1 files changed, 20 insertions, 21 deletions
diff --git a/src/bidi.c b/src/bidi.c index d928a00af30..c2b5a983310 100644 --- a/src/bidi.c +++ b/src/bidi.c | |||
| @@ -2011,7 +2011,6 @@ bidi_resolve_explicit (struct bidi_it *bidi_it) | |||
| 2011 | + bidi_it->ch_len, s, | 2011 | + bidi_it->ch_len, s, |
| 2012 | bidi_it->string.unibyte))) | 2012 | bidi_it->string.unibyte))) |
| 2013 | { | 2013 | { |
| 2014 | bidi_remember_char (&bidi_it->prev, bidi_it); | ||
| 2015 | /* This advances to the next character, skipping any | 2014 | /* This advances to the next character, skipping any |
| 2016 | characters covered by display strings. */ | 2015 | characters covered by display strings. */ |
| 2017 | level = bidi_resolve_explicit_1 (bidi_it); | 2016 | level = bidi_resolve_explicit_1 (bidi_it); |
| @@ -2426,29 +2425,29 @@ bidi_resolve_neutral (struct bidi_it *bidi_it) | |||
| 2426 | though they were R.'' */ | 2425 | though they were R.'' */ |
| 2427 | next_type = STRONG_R; | 2426 | next_type = STRONG_R; |
| 2428 | break; | 2427 | break; |
| 2429 | case WEAK_BN: | 2428 | default: |
| 2430 | case NEUTRAL_ON: /* W6/Retaining */ | 2429 | if ((bidi_it->level_stack[bidi_it->stack_idx].level |
| 2431 | if (!bidi_explicit_dir_char (bidi_it->ch)) | 2430 | != current_level) |
| 2432 | emacs_abort (); /* can't happen: BNs are skipped */ | 2431 | || type == NEUTRAL_B) |
| 2433 | /* FALLTHROUGH */ | ||
| 2434 | case NEUTRAL_B: | ||
| 2435 | /* Marched all the way to the end of this level run. | ||
| 2436 | We need to use the eos type, whose information is | ||
| 2437 | stored by bidi_set_sos_type in the prev_for_neutral | ||
| 2438 | member. */ | ||
| 2439 | if (saved_it.type != WEAK_BN | ||
| 2440 | || bidi_get_category (bidi_it->prev.type_after_w1) == NEUTRAL) | ||
| 2441 | next_type = bidi_it->prev_for_neutral.type; | ||
| 2442 | else | ||
| 2443 | { | 2432 | { |
| 2444 | /* This is a BN which does not adjoin neutrals. | 2433 | /* Marched all the way to the end of this level |
| 2445 | Leave its type alone. */ | 2434 | run. We need to use the eos type, whose |
| 2446 | bidi_copy_it (bidi_it, &saved_it); | 2435 | information is stored by bidi_set_sos_type in |
| 2447 | return bidi_it->type; | 2436 | the prev_for_neutral member. */ |
| 2437 | if (saved_it.type != WEAK_BN | ||
| 2438 | || bidi_get_category (bidi_it->prev.type_after_w1) == NEUTRAL) | ||
| 2439 | next_type = bidi_it->prev_for_neutral.type; | ||
| 2440 | else | ||
| 2441 | { | ||
| 2442 | /* This is a BN which does not adjoin | ||
| 2443 | neutrals. Leave its type alone. */ | ||
| 2444 | bidi_copy_it (bidi_it, &saved_it); | ||
| 2445 | return bidi_it->type; | ||
| 2446 | } | ||
| 2448 | } | 2447 | } |
| 2448 | else | ||
| 2449 | emacs_abort (); | ||
| 2449 | break; | 2450 | break; |
| 2450 | default: | ||
| 2451 | emacs_abort (); | ||
| 2452 | } | 2451 | } |
| 2453 | type = bidi_resolve_neutral_1 (saved_it.prev_for_neutral.type, | 2452 | type = bidi_resolve_neutral_1 (saved_it.prev_for_neutral.type, |
| 2454 | next_type, current_level); | 2453 | next_type, current_level); |