- /* Re-use data header. */
- if (TBL_HEAD_DATA == h->pos &&
- (TBL_CELL_VERT != p->pos &&
- TBL_CELL_DVERT != p->pos)) {
- p->head = h;
- return(p);
- }
-
- /* Re-use spanner header. */
- if (TBL_HEAD_DATA != h->pos &&
- (TBL_CELL_VERT == p->pos ||
- TBL_CELL_DVERT == p->pos)) {
- head_adjust(p, h);
- p->head = h;
- return(p);
- }
-
- /* Right-shift headers with a new spanner. */
- if (TBL_HEAD_DATA == h->pos &&
- (TBL_CELL_VERT == p->pos ||
- TBL_CELL_DVERT == p->pos)) {
- hp = mandoc_calloc(1, sizeof(struct tbl_head));
- hp->prev = h->prev;
- if (h->prev)
- h->prev->next = hp;
- if (h == tbl->first_head)
- tbl->first_head = hp;
- h->prev = hp;
- hp->next = h;
- head_adjust(p, hp);
- p->head = hp;
- return(p);
- }
-
- if (NULL != (h = h->next)) {
- head_adjust(p, h);
- p->head = h;
- return(p);
- }
-
- /* Fall through to default case... */