char *chart_file_name;
FILE *file;
- size_t chart_cnt;
+ size_t n_charts;
struct ll_list preamble_list;
struct ll_list token_list;
tex->handle = fh;
tex->chart_file_name = parse_chart_file_name (opt (d, o, "charts",
fh_get_file_name (fh)));
- tex->chart_cnt = 1;
+ tex->n_charts = 1;
tex->bg = parse_color (opt (d, o, "background-color", "#FFFFFFFFFFFF"));
tex->fg = parse_color (opt (d, o, "foreground-color", "#000000000000"));
if (nt->cat == CAT_SPACE || nt->cat == CAT_EOL)
break;
if (prev_x && (prev_x->cat == CAT_COMMENT) && (nt->cat != CAT_COMMENT))
- break;
+ {
+ ds_destroy (&prev_x->str);
+ free (prev_x);
+ break;
+ }
word_len += ds_length (&nt->str);
prev_x = nt;
}
{
fputs ("\n", file);
line_len = 0;
+ if (tt)
+ {
+ ds_destroy (&tt->str);
+ free (tt);
+ }
continue;
}
}
{
char *file_name = xr_draw_png_chart (item->chart,
tex->chart_file_name,
- tex->chart_cnt++,
+ tex->n_charts++,
&tex->fg, &tex->bg);
if (file_name != NULL)
{
break;
case OUTPUT_ITEM_GROUP:
- NOT_REACHED ();
+ break;
case OUTPUT_ITEM_IMAGE:
{
char *file_name = xr_write_png_image (
- item->image, tex->chart_file_name, tex->chart_cnt++);
+ item->image, tex->chart_file_name, tex->n_charts++);
if (file_name != NULL)
{
shipout (&tex->token_list, "\\includegraphics{%s}\n", file_name);
static void
tex_put_footnote_markers (struct tex_driver *tex,
const struct pivot_table *pt,
- const size_t *footnote_indexes,
- size_t n_footnotes)
+ const struct pivot_value_ex *ex)
{
size_t n_visible = 0;
- for (size_t i = 0; i < n_footnotes; i++)
+ for (size_t i = 0; i < ex->n_footnotes; i++)
{
- const struct pivot_footnote *f = pt->footnotes[footnote_indexes[i]];
+ const struct pivot_footnote *f = pt->footnotes[ex->footnote_indexes[i]];
if (f->show)
{
if (!n_visible++)
tex_escape_string (tex, ds_cstr (&s), false);
ds_destroy (&s);
- tex_put_footnote_markers (tex, pt,
- cell->value->footnote_indexes,
- cell->value->n_footnotes);
+ tex_put_footnote_markers (tex, pt, pivot_value_ex (cell->value));
}
static void
tex_escape_string (tex, ds_cstr (&s), true);
ds_destroy (&s);
- tex_put_footnote_markers (tex, pt, cell.value->footnote_indexes,
- cell.value->n_footnotes);
+ tex_put_footnote_markers (tex, pt, pivot_value_ex (cell.value));
if (halign == TABLE_HALIGN_CENTER || halign == TABLE_HALIGN_RIGHT)
{
shipout (&tex->token_list, "}");