version 1.83, 2021/09/28 17:06:59 |
version 1.85, 2021/10/17 21:05:54 |
Line 149 tblcalc(struct rofftbl *tbl, const struct tbl_span *sp |
|
Line 149 tblcalc(struct rofftbl *tbl, const struct tbl_span *sp |
|
* to data cells in the data section. |
* to data cells in the data section. |
*/ |
*/ |
|
|
gp = &first_group; |
|
for (dp = sp->first; dp != NULL; dp = dp->next) { |
for (dp = sp->first; dp != NULL; dp = dp->next) { |
icol = dp->layout->col; |
icol = dp->layout->col; |
while (maxcol < icol + dp->hspans) |
while (maxcol < icol + dp->hspans) |
Line 190 tblcalc(struct rofftbl *tbl, const struct tbl_span *sp |
|
Line 189 tblcalc(struct rofftbl *tbl, const struct tbl_span *sp |
|
continue; |
continue; |
|
|
/* |
/* |
* Build an ordered, singly linked list |
* Build a singly linked list |
* of all groups of columns joined by spans, |
* of all groups of columns joined by spans, |
* recording the minimum width for each group. |
* recording the minimum width for each group. |
*/ |
*/ |
|
|
while (*gp != NULL && ((*gp)->startcol < icol || |
gp = &first_group; |
(*gp)->endcol < icol + dp->hspans)) |
while (*gp != NULL && ((*gp)->startcol != icol || |
|
(*gp)->endcol != icol + dp->hspans)) |
gp = &(*gp)->next; |
gp = &(*gp)->next; |
if (*gp == NULL || (*gp)->startcol > icol || |
if (*gp == NULL) { |
(*gp)->endcol > icol + dp->hspans) { |
|
g = mandoc_malloc(sizeof(*g)); |
g = mandoc_malloc(sizeof(*g)); |
g->next = *gp; |
g->next = *gp; |
g->wanted = width; |
g->wanted = width; |
Line 248 tblcalc(struct rofftbl *tbl, const struct tbl_span *sp |
|
Line 247 tblcalc(struct rofftbl *tbl, const struct tbl_span *sp |
|
done = 1; |
done = 1; |
break; |
break; |
} else |
} else |
(*gp)->wanted -= width; |
g->wanted -= width; |
} |
} |
if (done) { |
if (done) { |
*gp = g->next; |
*gp = g->next; |
free(g); |
free(g); |
} else |
} else |
gp = &(*gp)->next; |
gp = &g->next; |
} |
} |
|
|
colwidth = mandoc_reallocarray(NULL, maxcol + 1, sizeof(*colwidth)); |
colwidth = mandoc_reallocarray(NULL, maxcol + 1, sizeof(*colwidth)); |
Line 327 tblcalc(struct rofftbl *tbl, const struct tbl_span *sp |
|
Line 326 tblcalc(struct rofftbl *tbl, const struct tbl_span *sp |
|
*gp = g->next; |
*gp = g->next; |
free(g); |
free(g); |
} else |
} else |
gp = &(*gp)->next; |
gp = &g->next; |
} |
} |
} |
} |
free(colwidth); |
free(colwidth); |