From 033c8787a641e1263906b93c5fc30f4789fb136f Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Fri, 23 Dec 2022 12:48:50 -0800 Subject: [PATCH] table: Remove table_box(). It was only used from table_put() to erase any rules within a joined cell, but the client code didn't ever put rules in a joined cell, so it was only used as a no-op. --- src/output/table.c | 78 ---------------------------------------------- src/output/table.h | 2 -- 2 files changed, 80 deletions(-) diff --git a/src/output/table.c b/src/output/table.c index 09ed509e35..4a92acb3d8 100644 --- a/src/output/table.c +++ b/src/output/table.c @@ -349,81 +349,6 @@ table_hline (struct table *t, int style, int x1, int x2, int y) t->rh[x + t->n[H] * y] = style; } } - -/* Draws a box around cells (X1,Y1)-(X2,Y2) inclusive with horizontal - lines of style F_H and vertical lines of style F_V. Fills the - interior of the box with horizontal lines of style I_H and vertical - lines of style I_V. Any of the line styles may be -1 to avoid - drawing those lines. This is distinct from 0, which draws a null - line. */ -void -table_box (struct table *t, int f_h, int f_v, int i_h, int i_v, - int x1, int y1, int x2, int y2) -{ - if (debugging) - { - if (x1 < 0 || x1 >= t->n[H] - || x2 < 0 || x2 >= t->n[H] - || y1 < 0 || y1 >= t->n[V] - || y2 < 0 || y2 >= t->n[V]) - { - printf ("bad box: (%d,%d)-(%d,%d) in table size (%d,%d)\n", - x1, y1, x2, y2, t->n[H], t->n[V]); - NOT_REACHED (); - } - } - - assert (x2 >= x1); - assert (y2 >= y1); - assert (x1 >= 0); - assert (y1 >= 0); - assert (x2 < t->n[H]); - assert (y2 < t->n[V]); - - if (f_h != -1) - { - int x; - for (x = x1; x <= x2; x++) - { - t->rh[x + t->n[H] * y1] = f_h; - t->rh[x + t->n[H] * (y2 + 1)] = f_h; - } - } - if (f_v != -1) - { - int y; - for (y = y1; y <= y2; y++) - { - t->rv[x1 + (t->n[H] + 1) * y] = f_v; - t->rv[(x2 + 1) + (t->n[H] + 1) * y] = f_v; - } - } - - if (i_h != -1) - { - int y; - - for (y = y1 + 1; y <= y2; y++) - { - int x; - - for (x = x1; x <= x2; x++) - t->rh[x + t->n[H] * y] = i_h; - } - } - if (i_v != -1) - { - int x; - - for (x = x1 + 1; x <= x2; x++) - { - int y; - - for (y = y1; y <= y2; y++) - t->rv[x + (t->n[H] + 1) * y] = i_v; - } - } -} /* Cells. */ @@ -442,9 +367,6 @@ table_put (struct table *table, int x1, int y1, int x2, int y2, } else { - table_box (table, -1, -1, TABLE_STROKE_NONE, TABLE_STROKE_NONE, - x1, y1, x2, y2); - struct table_cell *cell = pool_alloc (table->container, sizeof *cell); *cell = (struct table_cell) { .d = { [H] = { x1, x2 + 1 }, [V] = { y1, y2 + 1 } }, diff --git a/src/output/table.h b/src/output/table.h index add7bf94be..ed56891dc4 100644 --- a/src/output/table.h +++ b/src/output/table.h @@ -253,8 +253,6 @@ struct table *table_create (int nc, int nr, int hl, int hr, int ht, int hb); /* Rules. */ void table_hline (struct table *, int style, int x1, int x2, int y); void table_vline (struct table *, int style, int x, int y1, int y2); -void table_box (struct table *, int f_h, int f_v, int i_h, int i_v, - int x1, int y1, int x2, int y2); /* Cells. */ void table_put (struct table *, int x1, int y1, int x2, int y2, -- 2.30.2