summaryrefslogtreecommitdiff
path: root/src/bidi.c
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2014-09-24 11:06:26 +0300
committerEli Zaretskii <eliz@gnu.org>2014-09-24 11:06:26 +0300
commitf0d89bb4d7a0a2013ecaa134af7c9c902e04c1cd (patch)
treea6f63ee897d42114aaf173a6cd7de822b06e831a /src/bidi.c
parent61a403ecde239da3712469adbb183d0ed25b81f1 (diff)
downloademacs-f0d89bb4d7a0a2013ecaa134af7c9c902e04c1cd.tar.gz
Adapt bidi_resolve_neutral to new treatment of PDF to avoid assertion violations.
Diffstat (limited to 'src/bidi.c')
-rw-r--r--src/bidi.c41
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)
+ bidi_it->ch_len, s,
bidi_it->string.unibyte)))
{
- bidi_remember_char (&bidi_it->prev, bidi_it);
/* This advances to the next character, skipping any
characters covered by display strings. */
level = bidi_resolve_explicit_1 (bidi_it);
@@ -2426,29 +2425,29 @@ bidi_resolve_neutral (struct bidi_it *bidi_it)
though they were R.'' */
next_type = STRONG_R;
break;
- case WEAK_BN:
- case NEUTRAL_ON: /* W6/Retaining */
- if (!bidi_explicit_dir_char (bidi_it->ch))
- emacs_abort (); /* can't happen: BNs are skipped */
- /* FALLTHROUGH */
- case NEUTRAL_B:
- /* Marched all the way to the end of this level run.
- We need to use the eos type, whose information is
- stored by bidi_set_sos_type in the prev_for_neutral
- member. */
- if (saved_it.type != WEAK_BN
- || bidi_get_category (bidi_it->prev.type_after_w1) == NEUTRAL)
- next_type = bidi_it->prev_for_neutral.type;
- else
+ default:
+ if ((bidi_it->level_stack[bidi_it->stack_idx].level
+ != current_level)
+ || type == NEUTRAL_B)
{
- /* This is a BN which does not adjoin neutrals.
- Leave its type alone. */
- bidi_copy_it (bidi_it, &saved_it);
- return bidi_it->type;
+ /* Marched all the way to the end of this level
+ run. We need to use the eos type, whose
+ information is stored by bidi_set_sos_type in
+ the prev_for_neutral member. */
+ if (saved_it.type != WEAK_BN
+ || bidi_get_category (bidi_it->prev.type_after_w1) == NEUTRAL)
+ next_type = bidi_it->prev_for_neutral.type;
+ else
+ {
+ /* This is a BN which does not adjoin
+ neutrals. Leave its type alone. */
+ bidi_copy_it (bidi_it, &saved_it);
+ return bidi_it->type;
+ }
}
+ else
+ emacs_abort ();
break;
- default:
- emacs_abort ();
}
type = bidi_resolve_neutral_1 (saved_it.prev_for_neutral.type,
next_type, current_level);