=================================================================== RCS file: /cvs/mandoc/mdoc_term.c,v retrieving revision 1.166 retrieving revision 1.168 diff -u -p -r1.166 -r1.168 --- mandoc/mdoc_term.c 2010/07/02 10:53:28 1.166 +++ mandoc/mdoc_term.c 2010/07/02 15:03:14 1.168 @@ -1,4 +1,4 @@ -/* $Id: mdoc_term.c,v 1.166 2010/07/02 10:53:28 kristaps Exp $ */ +/* $Id: mdoc_term.c,v 1.168 2010/07/02 15:03:14 kristaps Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * @@ -57,7 +57,6 @@ static size_t a2width(const struct termp *, const ch static size_t a2height(const struct termp *, const char *); static size_t a2offs(const struct termp *, const char *); -static int arg_hasattr(int, const struct mdoc_node *); static int arg_getattr(int, const struct mdoc_node *); static void print_bvspace(struct termp *, const struct mdoc_node *, @@ -528,18 +527,6 @@ a2offs(const struct termp *p, const char *v) /* - * Return 1 if an argument has a particular argument value or 0 if it - * does not. See arg_getattr(). - */ -static int -arg_hasattr(int arg, const struct mdoc_node *n) -{ - - return(-1 != arg_getattr(arg, n)); -} - - -/* * Get the index of an argument in a node's argument list or -1 if it * does not exist. */ @@ -1141,10 +1128,10 @@ termp_an_post(DECL_ARGS) return; } - if (arg_hasattr(MDOC_Split, n)) { + if (AUTH_split == n->data.An.auth) { p->flags &= ~TERMP_NOSPLIT; p->flags |= TERMP_SPLIT; - } else { + } else if (AUTH_nosplit == n->data.An.auth) { p->flags &= ~TERMP_SPLIT; p->flags |= TERMP_NOSPLIT; } @@ -2057,30 +2044,19 @@ termp_fo_post(DECL_ARGS) static int termp_bf_pre(DECL_ARGS) { - const struct mdoc_node *nn; if (MDOC_HEAD == n->type) return(0); else if (MDOC_BLOCK != n->type) return(1); - if (NULL == (nn = n->head->child)) { - if (arg_hasattr(MDOC_Emphasis, n)) - term_fontpush(p, TERMFONT_UNDER); - else if (arg_hasattr(MDOC_Symbolic, n)) - term_fontpush(p, TERMFONT_BOLD); - else - term_fontpush(p, TERMFONT_NONE); + assert(n->data.Bf); - return(1); - } - - assert(MDOC_TEXT == nn->type); - if (0 == strcmp("Em", nn->string)) + if (FONT_Em == n->data.Bf->font) term_fontpush(p, TERMFONT_UNDER); - else if (0 == strcmp("Sy", nn->string)) + else if (FONT_Sy == n->data.Bf->font) term_fontpush(p, TERMFONT_BOLD); - else + else term_fontpush(p, TERMFONT_NONE); return(1);