free (column_enumeration);
free (row_enumeration);
- struct table_item *ti = table_item_create (table, NULL, NULL, pt->notes);
+ struct table_item *ti = table_item_create (table);
+
+ if (pt->notes)
+ table_item_set_notes (ti, pt->notes);
if (pt->title && pt->show_title)
{
}
}
-/* Initializes ITEM as a table item for rendering TABLE. The new table item
- initially has the specified TITLE, CAPTION, and NOTES, which may each be
- NULL. The caller retains ownership of TITLE, CAPTION, and NOTES. */
+/* Initializes ITEM as a table item for rendering TABLE. Takes ownership of
+ TABLE. */
struct table_item *
-table_item_create (struct table *table, const char *title, const char *caption,
- const char *notes)
+table_item_create (struct table *table)
{
struct table_item *item = xmalloc (sizeof *item);
*item = (struct table_item) {
.output_item = OUTPUT_ITEM_INITIALIZER (&table_item_class),
.table = table,
- .title = table_item_text_create (title),
- .caption = table_item_text_create (caption),
- .notes = notes ? xstrdup (notes) : NULL,
};
return item;
}
struct pivot_table *pt;
};
-struct table_item *table_item_create (struct table *, const char *title,
- const char *caption, const char *notes);
+struct table_item *table_item_create (struct table *);
const struct table *table_item_get_table (const struct table_item *);
if (text_item->type == TEXT_ITEM_SYNTAX || text_item->type == TEXT_ITEM_LOG)
opts |= TAB_FIX;
table_text (tab, 0, 0, opts, text_item_get_text (text_item));
- struct table_item *table_item = table_item_create (tab, NULL, NULL, NULL);
+ struct table_item *table_item = table_item_create (tab);
text_item_unref (text_item);
return table_item;
}
}
table = tables[n_tables - 1];
- table_item_submit (table_item_create (table, NULL, NULL, NULL));
+ table_item_submit (table_item_create (table));
free (tables);
}
else