diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2011-01-04 13:14:26 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2011-01-04 13:14:26 +0000 |
commit | de12a3c94d73528ca77a6d4a2924953c96d34df0 (patch) | |
tree | 6fd9ab1ba79b0367e8e4e242d1f7125cd37c19b5 /tbl_term.c | |
parent | b6b883b7b599dbe343a853c4f09d0d994f8ce23e (diff) | |
download | mandoc-de12a3c94d73528ca77a6d4a2924953c96d34df0.tar.gz |
Fix spacing for tables to use term_len(). Also make term.c properly
recode ASCII_HYPHEN and ASCII_NBRSP before passing back for widths.
Diffstat (limited to 'tbl_term.c')
-rw-r--r-- | tbl_term.c | 18 |
1 files changed, 9 insertions, 9 deletions
@@ -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 @@ -465,7 +462,7 @@ tbl_calc_data(struct termp *tp, const struct tbl *tbl, case (TBL_CELL_HORIZ): /* FALLTHROUGH */ case (TBL_CELL_DHORIZ): - tblp->width = 1; + tblp->width = term_len(tp, 1); break; case (TBL_CELL_LONG): /* FALLTHROUGH */ @@ -536,7 +533,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 +548,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) |