aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/out.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2012-05-27 17:54:54 +0000
committerIngo Schwarze <schwarze@openbsd.org>2012-05-27 17:54:54 +0000
commitee72941131e356c2314d4c3009737bbc0f101fc0 (patch)
treee261cf307917d75e5446cdefff6a6ecccd31d227 /out.c
parent5924b5736a3bec0c2ef93ddbd1da733745942d59 (diff)
downloadmandoc-ee72941131e356c2314d4c3009737bbc0f101fc0.tar.gz
mandoc-ee72941131e356c2314d4c3009737bbc0f101fc0.tar.zst
mandoc-ee72941131e356c2314d4c3009737bbc0f101fc0.zip
Do not handle vertical lines as additional tbl(7) columns,
instead save their properties with the following column. This simplifies layout parsing and saves a lot of code related to column handling. At output time, print all white space and vertical lines separating columns before printing the following column, and none after printing the preceding column, considerably simplifying white space handling and width calculations. No functional change, but it saves 150 lines of code, and it allows the next patch to tbl_term.c, tbl_literal(). "Please check them in and I'll look into them later!" kristaps@
Diffstat (limited to 'out.c')
-rw-r--r--out.c21
1 files changed, 1 insertions, 20 deletions
diff --git a/out.c b/out.c
index 8dbd68ac..6f41f3bc 100644
--- a/out.c
+++ b/out.c
@@ -1,4 +1,4 @@
-/* $Id: out.c,v 1.43 2011/09/20 23:05:49 schwarze Exp $ */
+/* $Id: out.c,v 1.44 2012/05/27 17:54:54 schwarze Exp $ */
/*
* Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2011 Ingo Schwarze <schwarze@openbsd.org>
@@ -178,25 +178,6 @@ tblcalc(struct rofftbl *tbl, const struct tbl_span *sp)
tblcalc_data(tbl, col, sp->tbl, dp);
}
}
-
- /*
- * Calculate width of the spanners. These get one space for a
- * vertical line, two for a double-vertical line.
- */
-
- for ( ; hp; hp = hp->next) {
- col = &tbl->cols[hp->ident];
- switch (hp->pos) {
- case (TBL_HEAD_VERT):
- col->width = (*tbl->len)(1, tbl->arg);
- break;
- case (TBL_HEAD_DVERT):
- col->width = (*tbl->len)(2, tbl->arg);
- break;
- default:
- break;
- }
- }
}
static void