=================================================================== RCS file: /cvs/mandoc/tbl_term.c,v retrieving revision 1.7 retrieving revision 1.10 diff -u -p -r1.7 -r1.10 --- mandoc/tbl_term.c 2011/01/04 12:06:21 1.7 +++ mandoc/tbl_term.c 2011/01/04 15:02:00 1.10 @@ -1,4 +1,4 @@ -/* $Id: tbl_term.c,v 1.7 2011/01/04 12:06:21 kristaps Exp $ */ +/* $Id: tbl_term.c,v 1.10 2011/01/04 15:02:00 kristaps Exp $ */ /* * Copyright (c) 2009 Kristaps Dzonsons * @@ -206,9 +206,6 @@ tbl_hframe(struct termp *tp, const struct tbl_span *sp TBL_OPT_DBOX & sp->tbl->opts)) return; - tp->flags |= TERMP_NONOSPACE; - tp->flags |= TERMP_NOSPACE; - /* * Print out the horizontal part of a frame or double frame. A * double frame has an unbroken `-' outer line the width of the @@ -256,6 +253,9 @@ tbl_data(struct termp *tp, const struct tbl *tbl, } switch (dp->pos) { + case (TBL_DATA_NONE): + tbl_char(tp, ASCII_NBRSP, tbp->width); + return; case (TBL_DATA_HORIZ): /* FALLTHROUGH */ case (TBL_DATA_NHORIZ): @@ -423,14 +423,9 @@ tbl_calc(struct termp *tp, const struct tbl_span *sp) hp = sp->head; for ( ; sp; sp = sp->next) { - switch (sp->pos) { - case (TBL_DATA_HORIZ): - /* FALLTHROUGH */ - case (TBL_DATA_DHORIZ): + if (TBL_SPAN_DATA != sp->pos) continue; - default: - break; - } + for (dp = sp->first; dp; dp = dp->next) { if (NULL == dp->layout) continue; @@ -458,6 +453,7 @@ static void tbl_calc_data(struct termp *tp, const struct tbl *tbl, const struct tbl_dat *dp, struct termp_tbl *tblp) { + int sz; /* Branch down into data sub-types. */ @@ -465,7 +461,9 @@ tbl_calc_data(struct termp *tp, const struct tbl *tbl, case (TBL_CELL_HORIZ): /* FALLTHROUGH */ case (TBL_CELL_DHORIZ): - tblp->width = 1; + sz = term_len(tp, 1); + if (tblp->width < sz) + tblp->width = sz; break; case (TBL_CELL_LONG): /* FALLTHROUGH */ @@ -536,7 +534,7 @@ tbl_calc_data_literal(struct termp *tp, const struct tbl_dat *dp, struct termp_tbl *tblp) { - int sz, bufsz; + int sz, bufsz, spsz; /* * Calculate our width and use the spacing, with a minimum @@ -551,16 +549,19 @@ tbl_calc_data_literal(struct termp *tp, case (TBL_CELL_LONG): /* FALLTHROUGH */ case (TBL_CELL_CENTRE): - bufsz = 2; + bufsz = term_len(tp, 2); break; default: - bufsz = 1; + bufsz = term_len(tp, 1); break; } + spsz = 0; if (dp->layout->spacing) - bufsz = bufsz > dp->layout->spacing ? - bufsz : dp->layout->spacing; + spsz = term_len(tp, dp->layout->spacing); + + if (spsz) + bufsz = bufsz > spsz ? bufsz : spsz; sz += bufsz; if (tblp->width < sz)