table: Get rid of table_cell destructors, which were unused.
authorBen Pfaff <blp@cs.stanford.edu>
Wed, 25 Dec 2019 17:01:49 +0000 (17:01 +0000)
committerBen Pfaff <blp@cs.stanford.edu>
Sun, 29 Dec 2019 05:28:10 +0000 (05:28 +0000)
src/output/csv.c
src/output/html.c
src/output/odt.c
src/output/render.c
src/output/tab.c
src/output/table-provider.h
src/output/table.c

index 9c70a4515899dcda1570cecbdd8a297e00698ee8..6c2f7495c45d494acab3e6165f4389ceb3f0b0b7 100644 (file)
@@ -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);
         }
index 307f6c223d83bb3fea6040da6e7f04d8d30ada13..f28476eae6661d05d27ce3fdfe0bcfb4af47b465 100644 (file)
@@ -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 ("  </TR>\n", html->file);
     }
index 104e57a9332c373502794a9550ddda5bc1b09f4d..8e50c7b9cc4b56573223621a7289e5a8117f6abb 100644 (file)
@@ -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 */
index 410fd4c5961762a32b69fcb99e037113686e325a..e6ce53164e2ba07e424adca94860529587a1c30c 100644 (file)
@@ -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;
index e73f57200489401880a4d68931246e66431376b4..df0a052234be98b1c89daf2167426c37557a5f5d 100644 (file)
@@ -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];
index 5df00458ed8a13d239ad1ea5c5ab019e1a775299..8b7fdf0a710435bfe81067228005fdbabf20b148 100644 (file)
@@ -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 *);
 
index 7688d8c2fcd897f23f4718df6ba572415c26c688..060da89a91bd5840ee7f38ec421428ddb05cc06f 100644 (file)
@@ -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);
         }
     }