diff options
-rw-r--r-- | tbl.c | 5 | ||||
-rw-r--r-- | tbl_layout.c | 2 | ||||
-rw-r--r-- | tree.c | 39 |
3 files changed, 29 insertions, 17 deletions
@@ -199,9 +199,6 @@ static void tbl_calc_data(struct tbl_node *tbl, struct tbl_dat *data) { - /* - * This is the case with overrunning cells... - */ if (NULL == data->layout) return; @@ -313,5 +310,3 @@ tbl_calc_data_literal(struct tbl_dat *data) if (data->layout->head->width < sz) data->layout->head->width = sz; } - - diff --git a/tbl_layout.c b/tbl_layout.c index b01b521c..3e3695cd 100644 --- a/tbl_layout.c +++ b/tbl_layout.c @@ -294,7 +294,7 @@ cell_alloc(struct tbl_node *tbl, struct tbl_row *rp, enum tbl_cellt pos) * ones. */ - h = pp ? pp->head->prev : tbl->first_head; + h = pp ? pp->head->next : tbl->first_head; if (h) { /* Re-use data header. */ @@ -30,7 +30,7 @@ static void print_mdoc(const struct mdoc_node *, int); static void print_man(const struct man_node *, int); -static void print_span(const struct tbl_span *); +static void print_span(const struct tbl_span *, int); /* ARGSUSED */ @@ -136,13 +136,13 @@ print_mdoc(const struct mdoc_node *n, int indent) /* NOTREACHED */ } - for (i = 0; i < indent; i++) - putchar('\t'); - if (n->span) { assert(NULL == p); - print_span(n->span); + print_span(n->span, indent); } else { + for (i = 0; i < indent; i++) + putchar('\t'); + printf("%s (%s)", p, t); for (i = 0; i < (int)argc; i++) { @@ -228,14 +228,14 @@ print_man(const struct man_node *n, int indent) /* NOTREACHED */ } - for (i = 0; i < indent; i++) - putchar('\t'); - if (n->span) { assert(NULL == p); - print_span(n->span); - } else + print_span(n->span, indent); + } else { + for (i = 0; i < indent; i++) + putchar('\t'); printf("%s (%s) %d:%d", p, t, n->line, n->pos); + } putchar('\n'); @@ -246,9 +246,26 @@ print_man(const struct man_node *n, int indent) } static void -print_span(const struct tbl_span *sp) +print_span(const struct tbl_span *sp, int indent) { const struct tbl_dat *dp; + const struct tbl_head *hp; + int i; + + if (TBL_SPAN_FIRST & sp->flags) { + for (i = 0; i < indent; i++) + putchar('\t'); + printf("tbl-head: "); + for (hp = sp->head; hp; hp = hp->next) { + printf("[%d]", hp->width); + if (hp->next) + putchar(' '); + } + putchar('\n'); + } + + for (i = 0; i < indent; i++) + putchar('\t'); printf("tbl: "); |