#include "output/driver-provider.h"
#include "output/message-item.h"
#include "output/options.h"
+#include "output/pivot-output.h"
+#include "output/pivot-table.h"
#include "output/render.h"
#include "output/table-item.h"
#include "output/text-item.h"
ascii_output_table_item (struct ascii_driver *a,
const struct table_item *table_item)
{
- struct render_pager *p;
-
update_page_size (a, false);
- if (a->object_cnt++)
- putc ('\n', a->file);
-
- p = render_pager_create (&a->params, table_item);
- for (int i = 0; render_pager_has_next (p); i++)
+ size_t *layer_indexes;
+ PIVOT_OUTPUT_FOR_EACH_LAYER (layer_indexes, table_item->pt, true)
{
- if (i)
- putc ('\n', a->file);
- ascii_output_lines (a, render_pager_draw_next (p, INT_MAX));
+ struct render_pager *p = render_pager_create (&a->params, table_item,
+ layer_indexes);
+ for (int i = 0; render_pager_has_next (p); i++)
+ {
+ if (a->object_cnt++)
+ putc ('\n', a->file);
+
+ ascii_output_lines (a, render_pager_draw_next (p, INT_MAX));
+ }
+ render_pager_destroy (p);
}
- render_pager_destroy (p);
}
static void
{
struct text_item *text_item;
- text_item = text_item_create_format (
- TEXT_ITEM_LOG, _("See %s for a chart."), file_name);
+ text_item = text_item_create_nocopy (
+ TEXT_ITEM_LOG,
+ xasprintf (_("See %s for a chart."), file_name),
+ NULL);
ascii_submit (driver, &text_item->output_item);
text_item_unref (text_item);
ascii_layout_cell (a, cell, bb, clip, max_width, &h);
if (cell->n_footnotes || strchr (cell->text, ' ')
- || cell->n_subscripts || cell->superscript)
+ || cell->n_subscripts)
{
bb[H][1] = 1;
ascii_layout_cell (a, cell, bb, clip, min_width, &h);
ds_put_cstr (&s, text);
for (size_t i = 0; i < cell->n_subscripts; i++)
ds_put_format (&s, "%c%s", i ? ',' : '_', cell->subscripts[i]);
- if (cell->superscript)
- ds_put_format (&s, "^%s", cell->superscript);
for (size_t i = 0; i < cell->n_footnotes; i++)
ds_put_format (&s, "[%s]", cell->footnotes[i]->marker);
return ds_steal_cstr (&s);
? output_get_text_from_markup (cell->text)
: cell->text);
- /* Append footnotes, subscripts, superscript if any. */
+ /* Append footnotes, subscripts if any. */
const char *text;
- if (cell->n_footnotes || cell->n_subscripts || cell->superscript)
+ if (cell->n_footnotes || cell->n_subscripts)
{
text = add_markers (plain_text, cell);
if (plain_text != cell->text)