From 761cab0e835626ba4ed8afc0c00ebed0e7f02841 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Wed, 25 Dec 2019 17:01:49 +0000 Subject: [PATCH] table: Get rid of table_cell destructors, which were unused. --- src/output/csv.c | 2 -- src/output/html.c | 1 - src/output/odt.c | 2 -- src/output/render.c | 9 --------- src/output/tab.c | 1 - src/output/table-provider.h | 6 ------ src/output/table.c | 10 ---------- 7 files changed, 31 deletions(-) diff --git a/src/output/csv.c b/src/output/csv.c index 9c70a45158..6c2f7495c4 100644 --- a/src/output/csv.c +++ b/src/output/csv.c @@ -246,8 +246,6 @@ csv_submit (struct output_driver *driver, csv_output_field (csv, ds_cstr (&s)); ds_destroy (&s); } - - table_cell_free (&cell); } putc ('\n', csv->file); } diff --git a/src/output/html.c b/src/output/html.c index 307f6c223d..f28476eae6 100644 --- a/src/output/html.c +++ b/src/output/html.c @@ -587,7 +587,6 @@ html_output_table (struct html_driver *html, const struct table_item *item) next_1: x = cell.d[TABLE_HORZ][1]; - table_cell_free (&cell); } fputs (" \n", html->file); } diff --git a/src/output/odt.c b/src/output/odt.c index 104e57a933..8e50c7b9cc 100644 --- a/src/output/odt.c +++ b/src/output/odt.c @@ -544,8 +544,6 @@ write_table (struct odt_driver *odt, const struct table_item *item) xmlTextWriterStartElement (odt->content_wtr, _xml("table:covered-table-cell")); xmlTextWriterEndElement (odt->content_wtr); } - - table_cell_free (&cell); } xmlTextWriterEndElement (odt->content_wtr); /* row */ diff --git a/src/output/render.c b/src/output/render.c index 410fd4c596..e6ce53164e 100644 --- a/src/output/render.c +++ b/src/output/render.c @@ -745,7 +745,6 @@ render_page_create (const struct render_params *params, struct table *table, } } x = cell.d[H][1]; - table_cell_free (&cell); } /* Distribute widths of spanned columns. */ @@ -768,7 +767,6 @@ render_page_create (const struct render_params *params, struct table *table, rules[H], table_cell_colspan (&cell)); } x = cell.d[H][1]; - table_cell_free (&cell); } if (min_width > 0) for (int i = 0; i < 2; i++) @@ -834,7 +832,6 @@ render_page_create (const struct render_params *params, struct table *table, set_join_crossings (page, H, &cell, rules[H]); } x = cell.d[H][1]; - table_cell_free (&cell); } for (int i = 0; i < 2; i++) free (columns[i]); @@ -854,7 +851,6 @@ render_page_create (const struct render_params *params, struct table *table, table_cell_rowspan (&cell)); } x = cell.d[H][1]; - table_cell_free (&cell); } /* Decide final row heights. */ @@ -1148,7 +1144,6 @@ render_page_draw_cells (const struct render_page *page, if (y / 2 == bb[V][0] / 2 || y / 2 == cell.d[V][0]) render_cell (page, ofs, &cell); x = rule_ofs (cell.d[H][1]); - table_cell_free (&cell); } else x++; @@ -1385,7 +1380,6 @@ render_break_next (struct render_break *b, int size) int better_pixel = page->params->adjust_break ( page->params->aux, &cell, w, pixel); x = cell.d[H][1]; - table_cell_free (&cell); if (better_pixel < pixel) { @@ -1912,7 +1906,6 @@ render_page_select (const struct render_page *page, enum table_axis axis, } } z = cell.d[b][1]; - table_cell_free (&cell); } if (!page->h[a][1] || z1 < page->n[a] - page->h[a][1] || p1) @@ -1932,7 +1925,6 @@ render_page_select (const struct render_page *page, enum table_axis axis, cell_ofs (cell.d[a][1])); } z = cell.d[b][1]; - table_cell_free (&cell); } /* Copy overflows from PAGE into subpage. */ @@ -1945,7 +1937,6 @@ render_page_select (const struct render_page *page, enum table_axis axis, if (cell.d[a][1] > z0 && cell.d[a][0] < z1 && find_overflow_for_cell (&s, &cell) == NULL) insert_overflow (&s, &cell); - table_cell_free (&cell); } return subpage; diff --git a/src/output/tab.c b/src/output/tab.c index e73f572004..df0a052234 100644 --- a/src/output/tab.c +++ b/src/output/tab.c @@ -482,7 +482,6 @@ tab_get_cell (const struct table *table, int x, int y, cell->options = opt; cell->n_footnotes = 0; - cell->destructor = NULL; int style_idx = (opt & TAB_STYLE_MASK) >> TAB_STYLE_SHIFT; const struct area_style *style = t->styles[style_idx]; diff --git a/src/output/table-provider.h b/src/output/table-provider.h index 5df00458ed..8b7fdf0a71 100644 --- a/src/output/table-provider.h +++ b/src/output/table-provider.h @@ -61,14 +61,8 @@ struct table_cell size_t n_footnotes; const struct area_style *style; - - /* Called to free the cell's data, if nonnull. */ - void (*destructor) (void *destructor_aux); - void *destructor_aux; }; -void table_cell_free (struct table_cell *); - void table_cell_format_footnote_markers (const struct table_cell *, struct string *); diff --git a/src/output/table.c b/src/output/table.c index 7688d8c2fc..060da89a91 100644 --- a/src/output/table.c +++ b/src/output/table.c @@ -172,15 +172,6 @@ table_get_cell (const struct table *table, int x, int y, table->klass->get_cell (table, x, y, cell); } -/* Frees CELL, which should have been initialized by calling - table_get_cell(). */ -void -table_cell_free (struct table_cell *cell) -{ - if (cell->destructor != NULL) - cell->destructor (cell->destructor_aux); -} - /* Returns one of the TAL_* enumeration constants (declared in output/table.h) representing a rule running alongside one of the cells in TABLE. @@ -280,7 +271,6 @@ table_collect_footnotes (const struct table_item *item, if (x == cell.d[TABLE_HORZ][0] && y == cell.d[TABLE_VERT][0]) footnotes = add_footnotes (cell.footnotes, cell.n_footnotes, footnotes, &allocated, &n); - table_cell_free (&cell); } } -- 2.30.2