They are no longer used.
ascii_layout_cell (a, cell, footnote_idx, bb, clip, max_width, &h);
if (cell->n_contents != 1
- || cell->contents[0].table
|| cell->contents[0].n_footnotes
|| strchr (cell->contents[0].text, ' '))
{
return y;
}
-static int
-ascii_layout_subtable (struct ascii_driver *a,
- const struct cell_contents *contents,
- int *footnote_idx UNUSED /* XXX */,
- int bb[TABLE_N_AXES][2], int clip[TABLE_N_AXES][2] UNUSED,
- int *widthp)
-{
- struct render_params params;
- struct render_pager *p;
- int r[TABLE_N_AXES][2];
- int width, height;
- int i;
-
- params.draw_line = ascii_draw_line;
- params.measure_cell_width = ascii_measure_cell_width;
- params.measure_cell_height = ascii_measure_cell_height;
- params.adjust_break = NULL;
- params.draw_cell = ascii_draw_cell,
- params.aux = a;
- params.size[H] = bb[TABLE_HORZ][1] - bb[TABLE_HORZ][0];
- params.size[V] = bb[TABLE_VERT][1] - bb[TABLE_VERT][0];
- params.font_size[H] = 1;
- params.font_size[V] = 1;
- for (i = 0; i < RENDER_N_LINES; i++)
- {
- int width = i == RENDER_LINE_NONE ? 0 : 1;
- params.line_widths[H][i] = width;
- params.line_widths[V][i] = width;
- }
-
- p = render_pager_create (¶ms, contents->table);
- width = render_pager_get_size (p, TABLE_HORZ);
- height = render_pager_get_size (p, TABLE_VERT);
-
- /* r = intersect(bb, clip) - bb. */
- for (i = 0; i < TABLE_N_AXES; i++)
- {
- r[i][0] = MAX (bb[i][0], clip[i][0]) - bb[i][0];
- r[i][1] = MIN (bb[i][1], clip[i][1]) - bb[i][0];
- }
-
- if (r[H][0] < r[H][1] && r[V][0] < r[V][1])
- {
- unsigned int alignment = contents->options & TAB_ALIGNMENT;
- int save_x = a->x;
-
- a->x += bb[TABLE_HORZ][0];
- if (alignment == TAB_RIGHT)
- a->x += params.size[H] - width;
- else if (alignment == TAB_CENTER)
- a->x += (params.size[H] - width) / 2;
- a->y += bb[TABLE_VERT][0];
- render_pager_draw (p);
- a->y -= bb[TABLE_VERT][0];
- a->x = save_x;
- }
- render_pager_destroy (p);
-
- if (width > *widthp)
- *widthp = width;
- return bb[V][0] + height;
-}
-
static void
ascii_layout_cell (struct ascii_driver *a, const struct table_cell *cell,
int footnote_idx,
break;
}
- if (contents->text)
- bb[V][0] = ascii_layout_cell_text (a, contents, &footnote_idx,
- bb, clip, widthp);
- else
- bb[V][0] = ascii_layout_subtable (a, contents, &footnote_idx,
- bb, clip, widthp);
+ bb[V][0] = ascii_layout_cell_text (a, contents, &footnote_idx,
+ bb, clip, widthp);
}
*heightp = bb[V][0] - bb_[V][0];
}
contents.options = options | TAB_LEFT;
contents.text = CONST_CAST (char *, s);
- contents.table = NULL;
contents.n_footnotes = 0;
memset (&cell, 0, sizeof cell);
return y + h;
}
-static int
-xr_layout_cell_subtable (struct xr_driver *xr,
- const struct cell_contents *contents,
- int footnote_idx UNUSED,
- int bb[TABLE_N_AXES][2],
- int clip[TABLE_N_AXES][2], int *widthp, int *brk)
-{
- int single_width, double_width;
- struct render_params params;
- struct render_pager *p;
- int r[TABLE_N_AXES][2];
- int width, height;
- int i;
-
- params.draw_line = xr_draw_line;
- params.measure_cell_width = xr_measure_cell_width;
- params.measure_cell_height = xr_measure_cell_height;
- params.adjust_break = NULL;
- params.draw_cell = xr_draw_cell;
- params.aux = xr;
- params.size[H] = bb[H][1] - bb[H][0];
- params.size[V] = bb[V][1] - bb[V][0];
- params.font_size[H] = xr->char_width;
- params.font_size[V] = xr->char_height;
-
- single_width = 2 * xr->line_gutter + xr->line_width;
- double_width = 2 * xr->line_gutter + xr->line_space + 2 * xr->line_width;
- for (i = 0; i < TABLE_N_AXES; i++)
- {
- params.line_widths[i][RENDER_LINE_NONE] = 0;
- params.line_widths[i][RENDER_LINE_SINGLE] = single_width;
- params.line_widths[i][RENDER_LINE_DOUBLE] = double_width;
- }
-
- xr->nest++;
- p = render_pager_create (¶ms, contents->table);
- width = render_pager_get_size (p, H);
- height = render_pager_get_size (p, V);
- if (bb[V][0] + height >= bb[V][1])
- *brk = bb[V][0] + render_pager_get_best_breakpoint (p, bb[V][1] - bb[V][0]);
-
- /* r = intersect(bb, clip) - bb. */
- for (i = 0; i < TABLE_N_AXES; i++)
- {
- r[i][0] = MAX (bb[i][0], clip[i][0]) - bb[i][0];
- r[i][1] = MIN (bb[i][1], clip[i][1]) - bb[i][0];
- }
-
- if (r[H][0] < r[H][1] && r[V][0] < r[V][1])
- {
- unsigned int alignment = contents->options & TAB_ALIGNMENT;
- int save_x = xr->x;
-
- cairo_save (xr->cairo);
- xr_clip (xr, clip);
- xr->x += bb[H][0];
- if (alignment == TAB_RIGHT)
- xr->x += params.size[H] - width;
- else if (alignment == TAB_CENTER)
- xr->x += (params.size[H] - width) / 2;
- xr->y += bb[V][0];
- render_pager_draw_region (p, r[H][0], r[V][0],
- r[H][1] - r[H][0], r[V][1] - r[V][0]);
- xr->y -= bb[V][0];
- xr->x = save_x;
- cairo_restore (xr->cairo);
- }
- render_pager_destroy (p);
- xr->nest--;
-
- if (width > *widthp)
- *widthp = width;
- return bb[V][0] + height;
-}
-
static void
xr_layout_cell (struct xr_driver *xr, const struct table_cell *cell,
int footnote_idx,
*brk = bb[V][0];
}
- if (contents->text)
- bb[V][0] = xr_layout_cell_text (xr, contents, footnote_idx, bb, clip,
- bb[V][0], width, brk);
- else
- bb[V][0] = xr_layout_cell_subtable (xr, contents, footnote_idx,
- bb, clip, width, brk);
+ bb[V][0] = xr_layout_cell_text (xr, contents, footnote_idx, bb, clip,
+ bb[V][0], width, brk);
footnote_idx += contents->n_footnotes;
}
*height = bb[V][0] - bb_[V][0];
free (s);
}
-static void
-csv_put_field (struct csv_driver *csv, struct string *s, const char *field)
-{
- while (*field == ' ')
- field++;
-
- if (csv->quote && field[strcspn (field, csv->quote_set)])
- {
- const char *p;
-
- ds_put_byte (s, csv->quote);
- for (p = field; *p != '\0'; p++)
- {
- if (*p == csv->quote)
- ds_put_byte (s, csv->quote);
- ds_put_byte (s, *p);
- }
- ds_put_byte (s, csv->quote);
- }
- else
- ds_put_cstr (s, field);
-}
-
-static void
-csv_output_subtable (struct csv_driver *csv, struct string *s,
- const struct table_item *item)
-{
- const struct table *t = table_item_get_table (item);
- const char *title = table_item_get_title (item);
- const char *caption = table_item_get_caption (item);
- int y, x;
-
- if (csv->titles && title != NULL)
- {
- csv_output_field_format (csv, "Table: %s", title);
- putc ('\n', csv->file);
- }
-
- for (y = 0; y < table_nr (t); y++)
- {
- if (y > 0)
- ds_put_byte (s, '\n');
-
- for (x = 0; x < table_nc (t); x++)
- {
- struct table_cell cell;
-
- table_get_cell (t, x, y, &cell);
-
- if (x > 0)
- ds_put_cstr (s, csv->separator);
-
- if (x != cell.d[TABLE_HORZ][0] || y != cell.d[TABLE_VERT][0])
- csv_put_field (csv, s, "");
- else if (cell.n_contents == 1 && cell.contents[0].text != NULL)
- csv_put_field (csv, s, cell.contents[0].text);
- else
- {
- struct string s2;
- size_t i;
-
- ds_init_empty (&s2);
- for (i = 0; i < cell.n_contents; i++)
- {
- if (i > 0)
- ds_put_cstr (&s2, "\n\n");
-
- if (cell.contents[i].text != NULL)
- ds_put_cstr (&s2, cell.contents[i].text);
- else
- csv_output_subtable (csv, &s2, cell.contents[i].table);
- }
- csv_put_field (csv, s, ds_cstr (&s2));
- ds_destroy (&s2);
- }
-
- table_cell_free (&cell);
- }
- }
-
- if (csv->captions && caption != NULL)
- {
- csv_output_field_format (csv, "Caption: %s", caption);
- putc ('\n', csv->file);
- }
-}
-
static void
csv_put_separator (struct csv_driver *csv)
{
if (i > 0)
ds_put_cstr (&s, "\n\n");
- if (c->text != NULL)
- ds_put_cstr (&s, c->text);
- else
- csv_output_subtable (csv, &s, c->table);
+ ds_put_cstr (&s, c->text);
for (j = 0; j < c->n_footnotes; j++)
{
/* Output cell contents. */
for (c = cell.contents; c < &cell.contents[cell.n_contents]; c++)
{
- if (c->text)
+ const char *s = c->text;
+ int i;
+
+ if (c->options & TAB_EMPH)
+ fputs ("<EM>", html->file);
+ if (c->options & TAB_FIX)
+ {
+ fputs ("<TT>", html->file);
+ escape_string (html->file, s, strlen (s), " ", "<BR>");
+ fputs ("</TT>", html->file);
+ }
+ else
{
- const char *s = c->text;
- int i;
+ s += strspn (s, CC_SPACES);
+ escape_string (html->file, s, strlen (s), " ", "<BR>");
+ }
+ if (c->options & TAB_EMPH)
+ fputs ("</EM>", html->file);
- if (c->options & TAB_EMPH)
- fputs ("<EM>", html->file);
- if (c->options & TAB_FIX)
- {
- fputs ("<TT>", html->file);
- escape_string (html->file, s, strlen (s), " ", "<BR>");
- fputs ("</TT>", html->file);
- }
- else
+ if (c->n_footnotes > 0)
+ {
+ fputs ("<SUP>", html->file);
+ for (i = 0; i < c->n_footnotes; i++)
{
- s += strspn (s, CC_SPACES);
- escape_string (html->file, s, strlen (s), " ", "<BR>");
- }
- if (c->options & TAB_EMPH)
- fputs ("</EM>", html->file);
+ char marker[16];
- if (c->n_footnotes > 0)
- {
- fputs ("<SUP>", html->file);
- for (i = 0; i < c->n_footnotes; i++)
- {
- char marker[16];
-
- if (i > 0)
- putc (',', html->file);
- str_format_26adic (++footnote_idx, false,
- marker, sizeof marker);
- fputs (marker, html->file);
- }
- fputs ("</SUP>", html->file);
+ if (i > 0)
+ putc (',', html->file);
+ str_format_26adic (++footnote_idx, false,
+ marker, sizeof marker);
+ fputs (marker, html->file);
}
+ fputs ("</SUP>", html->file);
}
- else
- html_output_table (html, c->table);
}
/* Output </TH> or </TD>. */
const struct cell_contents *contents = &cell.contents[i];
int j;
- if (contents->text)
- {
- xmlTextWriterStartElement (odt->content_wtr, _xml("text:p"));
+ xmlTextWriterStartElement (odt->content_wtr, _xml("text:p"));
- if ( r < table_ht (tab) || c < table_hl (tab) )
- xmlTextWriterWriteAttribute (odt->content_wtr, _xml("text:style-name"), _xml("Table_20_Heading"));
- else
- xmlTextWriterWriteAttribute (odt->content_wtr, _xml("text:style-name"), _xml("Table_20_Contents"));
+ if ( r < table_ht (tab) || c < table_hl (tab) )
+ xmlTextWriterWriteAttribute (odt->content_wtr, _xml("text:style-name"), _xml("Table_20_Heading"));
+ else
+ xmlTextWriterWriteAttribute (odt->content_wtr, _xml("text:style-name"), _xml("Table_20_Contents"));
- write_xml_with_line_breaks (odt, contents->text);
+ write_xml_with_line_breaks (odt, contents->text);
- for (j = 0; j < contents->n_footnotes; j++)
- write_footnote (odt, contents->footnotes[j]);
-
- xmlTextWriterEndElement (odt->content_wtr); /* text:p */
- }
- else if (contents->table)
- write_table (odt, contents->table);
+ for (j = 0; j < contents->n_footnotes; j++)
+ write_footnote (odt, contents->footnotes[j]);
+ xmlTextWriterEndElement (odt->content_wtr); /* text:p */
}
xmlTextWriterEndElement (odt->content_wtr); /* table:table-cell */
}
/* Cell options. */
#define TAB_JOIN (1u << TAB_FIRST_AVAILABLE)
-#define TAB_SUBTABLE (1u << (TAB_FIRST_AVAILABLE + 1))
-#define TAB_BARE (1u << (TAB_FIRST_AVAILABLE + 2))
/* Joined cell. */
struct tab_joined_cell
va_end (args);
}
-static void
-subtable_unref (void *subtable)
-{
- table_item_unref (subtable);
-}
-
-/* Places SUBTABLE as the content for cells (X1,X2)-(Y1,Y2) inclusive in TABLE
- with options OPT. */
-void
-tab_subtable (struct tab_table *table, int x1, int y1, int x2, int y2,
- unsigned opt, struct table_item *subtable)
-{
- add_joined_cell (table, x1, y1, x2, y2, opt | TAB_SUBTABLE)->u.subtable
- = subtable;
- pool_register (table->container, subtable_unref, subtable);
-}
-
-/* Places the contents of SUBTABLE as the content for cells (X1,X2)-(Y1,Y2)
- inclusive in TABLE with options OPT.
-
- SUBTABLE must have exactly one row and column. The contents of its single
- cell are used as the contents of TABLE's cell; that is, SUBTABLE is not used
- as a nested table but its contents become part of TABLE. */
-void
-tab_subtable_bare (struct tab_table *table, int x1, int y1, int x2, int y2,
- unsigned opt, struct table_item *subtable)
-{
- const struct table *t UNUSED = table_item_get_table (subtable);
- assert (table_nc (t) == 1);
- assert (table_nr (t) == 1);
- tab_subtable (table, x1, y1, x2, y2, opt | TAB_BARE, subtable);
-}
-
bool
tab_cell_is_empty (const struct tab_table *table, int c, int r)
{
const void *cc = t->cc[index];
cell->inline_contents.options = opt;
- cell->inline_contents.table = NULL;
cell->inline_contents.n_footnotes = 0;
cell->destructor = NULL;
if (opt & TAB_JOIN)
{
const struct tab_joined_cell *jc = cc;
- if (opt & TAB_BARE)
- {
- assert (opt & TAB_SUBTABLE);
-
- /* This overwrites all of the members of CELL. */
- table_get_cell (table_item_get_table (jc->u.subtable), 0, 0, cell);
- }
- else
- {
- cell->contents = &cell->inline_contents;
- cell->n_contents = 1;
- if (opt & TAB_SUBTABLE)
- {
- cell->inline_contents.table = jc->u.subtable;
- cell->inline_contents.text = NULL;
- }
- else
- cell->inline_contents.text = jc->u.text;
- }
+ cell->contents = &cell->inline_contents;
+ cell->n_contents = 1;
+ cell->inline_contents.text = jc->u.text;
cell->inline_contents.footnotes = jc->footnotes;
cell->inline_contents.n_footnotes = jc->n_footnotes;
void tab_footnote (struct tab_table *, int x, int y, const char *format, ...)
PRINTF_FORMAT (4, 5);
-void tab_subtable (struct tab_table *, int x1, int y1, int x2, int y2,
- unsigned opt, struct table_item *subtable);
-void tab_subtable_bare (struct tab_table *, int x1, int y1, int x2, int y2,
- unsigned opt, struct table_item *subtable);
-
bool tab_cell_is_empty (const struct tab_table *, int c, int r);
/* Editing. */
cell->contents = &cell->inline_contents;
cell->n_contents = 1;
cell->inline_contents.options = TAB_RIGHT;
- cell->inline_contents.table = NULL;
cell->inline_contents.n_footnotes = 0;
if (tc->heading != NULL)
{
/* PSPP - a program for statistical analysis.
- Copyright (C) 1997, 1998, 1999, 2000, 2009, 2011, 2013, 2014 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1998, 1999, 2000, 2009, 2011, 2013, 2014, 2018 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
struct cell_contents
{
unsigned int options; /* TAB_*. */
-
- /* Exactly one of these must be nonnull. */
char *text; /* A paragraph of text. */
- struct table_item *table; /* A table nested within the cell. */
/* Optional footnote(s). */
char **footnotes;
cell->contents = &cell->inline_contents;
cell->inline_contents.options = ts->options;
cell->inline_contents.text = ts->string;
- cell->inline_contents.table = NULL;
cell->inline_contents.n_footnotes = 0;
cell->n_contents = 1;
cell->destructor = NULL;
NULL, /* paste */
NULL, /* select */
};
-\f
-struct table_nested
- {
- struct table table;
- struct table_item *inner;
- };
-
-static const struct table_class table_nested_class;
-
-/* Creates and returns a table with a single cell that contains INNER.
- Takes ownership of INNER. */
-struct table *
-table_create_nested (struct table *inner)
-{
- return table_create_nested_item (table_item_create (inner, NULL, NULL));
-}
-
-/* Creates and returns a table with a single cell that contains INNER.
- Takes ownership of INNER. */
-struct table *
-table_create_nested_item (struct table_item *inner)
-{
- struct table_nested *tn = xmalloc (sizeof *tn);
- table_init (&tn->table, &table_nested_class);
- tn->table.n[TABLE_HORZ] = tn->table.n[TABLE_VERT] = 1;
- tn->inner = inner;
- return &tn->table;
-}
-
-static struct table_nested *
-table_nested_cast (const struct table *table)
-{
- assert (table->klass == &table_nested_class);
- return UP_CAST (table, struct table_nested, table);
-}
-
-static void
-table_nested_destroy (struct table *tn_)
-{
- struct table_nested *tn = table_nested_cast (tn_);
- table_item_unref (tn->inner);
- free (tn);
-}
-
-static void
-table_nested_get_cell (const struct table *tn_, int x UNUSED, int y UNUSED,
- struct table_cell *cell)
-{
- struct table_nested *tn = table_nested_cast (tn_);
- cell->d[TABLE_HORZ][0] = 0;
- cell->d[TABLE_HORZ][1] = 1;
- cell->d[TABLE_VERT][0] = 0;
- cell->d[TABLE_VERT][1] = 1;
- cell->contents = &cell->inline_contents;
- cell->inline_contents.options = TAB_LEFT;
- cell->inline_contents.text = NULL;
- cell->inline_contents.table = tn->inner;
- cell->inline_contents.n_footnotes = 0;
- cell->n_contents = 1;
- cell->destructor = NULL;
-}
-
-static int
-table_nested_get_rule (const struct table *tn UNUSED,
- enum table_axis axis UNUSED, int x UNUSED, int y UNUSED)
-{
- return TAL_0;
-}
-
-static const struct table_class table_nested_class =
- {
- table_nested_destroy,
- table_nested_get_cell,
- table_nested_get_rule,
- NULL, /* paste */
- NULL, /* select */
- };
-
size_t column,
const char *heading,
const struct fmt_spec *);
-struct table *table_create_nested (struct table *);
-struct table *table_create_nested_item (struct table_item *);
/* Combining tables. */
struct table *table_paste (struct table *, struct table *,
sysfile info file='pro.sav'.
])
AT_CHECK([pspp -o pspp.csv sysfile-info.sps])
-AT_CHECK([pspp -o pspp.pdf sysfile-info.sps])
-AT_CHECK([pspp -o pspp.txt sysfile-info.sps])
AT_CHECK(
[sed -e '/^Created:,/d' \
-e '/^Endian:,/d' \
static const char *parse_options (int argc, char **argv);
static void usage (void) NO_RETURN;
-static struct table *read_table (FILE *, struct table **tables, size_t n_tables);
+static struct table *read_table (FILE *);
static void draw (FILE *);
int
if (n_tables >= allocated_tables)
tables = x2nrealloc (tables, &allocated_tables, sizeof *tables);
- tables[n_tables] = read_table (input, tables, n_tables);
+ tables[n_tables] = read_table (input);
n_tables++;
ch = getc (input);
}
static struct table *
-read_table (FILE *stream, struct table **tables, size_t n_tables)
+read_table (FILE *stream)
{
struct tab_table *tab;
char buffer[1024];
{
unsigned int opt;
char *new_line;
- unsigned int i;
char *text;
int rs, cs;
replace_newlines (text);
- if (sscanf (text, "{%u}", &i) == 1)
- {
- struct table *table;
-
- if (i >= n_tables)
- error (1, 0, "bad table number %u", i);
- table = table_ref (tables[i]);
-
- text = strchr (text, '}') + 1;
- while (*text)
- switch (*text++)
- {
- case 's':
- table = table_stomp (table);
- break;
-
- case 't':
- table = table_transpose (table);
- break;
-
- default:
- error (1, 0, "unexpected subtable modifier \"%c\"", *text);
- }
- tab_subtable (tab, c, r, c + cs - 1, r + rs - 1, opt,
- table_item_create (table, NULL, NULL));
- }
- else
- {
- char *pos = text;
- char *content;
- int i;
-
- for (i = 0; (content = strsep (&pos, "#")) != NULL; i++)
- if (!i)
- tab_joint_text (tab, c, r, c + cs - 1, r + rs - 1, opt,
- content);
- else
- tab_footnote (tab, c, r, "%s", content);
- }
+ char *pos = text;
+ char *content;
+ int i;
+
+ for (i = 0; (content = strsep (&pos, "#")) != NULL; i++)
+ if (!i)
+ tab_joint_text (tab, c, r, c + cs - 1, r + rs - 1, opt,
+ content);
+ else
+ tab_footnote (tab, c, r, "%s", content);
}
return &tab->table;
])
AT_CLEANUP
-AT_SETUP([nested single cell])
-AT_KEYWORDS([render rendering])
-AT_DATA([input], [1 1
-abc
-1 1
-{0}
-])
-AT_CHECK([render-test input], [0], [abc
-])
-AT_CLEANUP
-
AT_SETUP([single cell with border])
AT_KEYWORDS([render rendering])
AT_DATA([input], [1 1
])
AT_CLEANUP
-AT_SETUP([nested single cell with border])
-AT_KEYWORDS([render rendering])
-AT_DATA([input], [1 1
-@abc
-1 1
-@{0}
-])
-AT_CHECK([render-test input], [0], [dnl
-+-----+
-|+---+|
-||abc||
-|+---+|
-+-----+
-])
-AT_CLEANUP
-
AT_SETUP([joined columns])
AT_KEYWORDS([render rendering])
AT_DATA([input], [2 2
])
AT_CLEANUP
-AT_SETUP([nested joined rows])
-AT_KEYWORDS([render rendering])
-AT_DATA([input], [2 2
-2*1 @ab\ncd\nef
-@hij
-@klm
-1 1
-@{0}
-])
-AT_CHECK([render-test input], [0], [dnl
-+--------+
-|+--+---+|
-||ab|hij||
-||cd+---+|
-||ef|klm||
-|+--+---+|
-+--------+
-])
-AT_CLEANUP
-
dnl This checks for bug #31346, a segmentation fault that surfaced
dnl when two or more rows had no unspanned cells and no rules.
AT_SETUP([joined rows only, no rules])
+-----+------+----+
])
AT_CLEANUP
-
-AT_SETUP([nested 8x8])
-AT_KEYWORDS([render rendering])
-AT_DATA([input], [WEAVE_8X8[]dnl
-1 1
-@{0}
-])
-AT_CHECK([render-test input], [0], [dnl
-+-----------------+
-|+-+-+-+-+-+-+-+-+|
-||a|b|c|d|e|f|g|h||
-|+-+-+-+-+-+-+-+-+|
-||i|jkl|m|nop|q|t||
-|+-+-+-+-+-+-+r+-+|
-||u|v|wxy|z|A|s|D||
-|+-+-+-+-+-+B+-+-+|
-||E|F|I|JKL|C|M|P||
-|+-+G+-+---+-+N+-+|
-||Q|H|R|UVW|X|O|Y||
-|+-+-+S+-+-+-+-+-+|
-||Z|0|T|3|456|7|8||
-|+-+1+-+-+-+-+-+-+|
-||9|2|abc|d|efg|h||
-|+-+-+-+-+-+-+-+-+|
-||i|j|k|l|m|n|o|p||
-|+-+-+-+-+-+-+-+-+|
-+-----------------+
-])
-AT_CLEANUP
-
-AT_SETUP([nested 8x8s and 6x6s])
-AT_KEYWORDS([render rendering])
-AT_DATA([input], [WEAVE_8X8[]WEAVE_6X6[]dnl
-4 2
-@{0}
-@{1}
-@{1}
-@|{1}
-@|{1}
-@({1}
-@({1}
-@{0}
-])
-AT_CHECK([render-test input], [0], [dnl
-+-----------------+-----------------+
-|+-+-+-+-+-+-+-+-+| +-+---+-+-+-+|
-||a|b|c|d|e|f|g|h|| |a|bcd|e|f|i||
-|+-+-+-+-+-+-+-+-+| +-+-+-+-+g+-+|
-||i|jkl|m|nop|q|t|| |j|m|nop|h|q||
-|+-+-+-+-+-+-+r+-+| |k+-+-+-+-+r||
-||u|v|wxy|z|A|s|D|| |l|t|w|xyz|s||
-|+-+-+-+-+-+B+-+-+| +-+u+-+-+-+-+|
-||E|F|I|JKL|C|M|P|| |A|v|B|E|FGH||
-|+-+G+-+---+-+N+-+| +-+-+C+-+-+-+|
-||Q|H|R|UVW|X|O|Y|| |IJK|D|L|O|P||
-|+-+-+S+-+-+-+-+-+| +-+-+-+M+-+-+|
-||Z|0|T|3|456|7|8|| |Q|RST|N|U|V||
-|+-+1+-+-+-+-+-+-+| +-+---+-+-+-+|
-||9|2|abc|d|efg|h|| |
-|+-+-+-+-+-+-+-+-+| |
-||i|j|k|l|m|n|o|p|| |
-|+-+-+-+-+-+-+-+-+| |
-+-----------------+-----------------+
-| +-+---+-+-+-+| +-+---+-+-+-+ |
-| |a|bcd|e|f|i|| |a|bcd|e|f|i| |
-| +-+-+-+-+g+-+| +-+-+-+-+g+-+ |
-| |j|m|nop|h|q|| |j|m|nop|h|q| |
-| |k+-+-+-+-+r|| |k+-+-+-+-+r| |
-| |l|t|w|xyz|s|| |l|t|w|xyz|s| |
-| +-+u+-+-+-+-+| +-+u+-+-+-+-+ |
-| |A|v|B|E|FGH|| |A|v|B|E|FGH| |
-| +-+-+C+-+-+-+| +-+-+C+-+-+-+ |
-| |IJK|D|L|O|P|| |IJK|D|L|O|P| |
-| +-+-+-+M+-+-+| +-+-+-+M+-+-+ |
-| |Q|RST|N|U|V|| |Q|RST|N|U|V| |
-| +-+---+-+-+-+| +-+---+-+-+-+ |
-+-----------------+-----------------+
-| +-+---+-+-+-+ |+-+---+-+-+-+ |
-| |a|bcd|e|f|i| ||a|bcd|e|f|i| |
-| +-+-+-+-+g+-+ |+-+-+-+-+g+-+ |
-| |j|m|nop|h|q| ||j|m|nop|h|q| |
-| |k+-+-+-+-+r| ||k+-+-+-+-+r| |
-| |l|t|w|xyz|s| ||l|t|w|xyz|s| |
-| +-+u+-+-+-+-+ |+-+u+-+-+-+-+ |
-| |A|v|B|E|FGH| ||A|v|B|E|FGH| |
-| +-+-+C+-+-+-+ |+-+-+C+-+-+-+ |
-| |IJK|D|L|O|P| ||IJK|D|L|O|P| |
-| +-+-+-+M+-+-+ |+-+-+-+M+-+-+ |
-| |Q|RST|N|U|V| ||Q|RST|N|U|V| |
-| +-+---+-+-+-+ |+-+---+-+-+-+ |
-+-----------------+-----------------+
-|+-+---+-+-+-+ |+-+-+-+-+-+-+-+-+|
-||a|bcd|e|f|i| ||a|b|c|d|e|f|g|h||
-|+-+-+-+-+g+-+ |+-+-+-+-+-+-+-+-+|
-||j|m|nop|h|q| ||i|jkl|m|nop|q|t||
-||k+-+-+-+-+r| |+-+-+-+-+-+-+r+-+|
-||l|t|w|xyz|s| ||u|v|wxy|z|A|s|D||
-|+-+u+-+-+-+-+ |+-+-+-+-+-+B+-+-+|
-||A|v|B|E|FGH| ||E|F|I|JKL|C|M|P||
-|+-+-+C+-+-+-+ |+-+G+-+---+-+N+-+|
-||IJK|D|L|O|P| ||Q|H|R|UVW|X|O|Y||
-|+-+-+-+M+-+-+ |+-+-+S+-+-+-+-+-+|
-||Q|RST|N|U|V| ||Z|0|T|3|456|7|8||
-|+-+---+-+-+-+ |+-+1+-+-+-+-+-+-+|
-| ||9|2|abc|d|efg|h||
-| |+-+-+-+-+-+-+-+-+|
-| ||i|j|k|l|m|n|o|p||
-| |+-+-+-+-+-+-+-+-+|
-+-----------------+-----------------+
-])
-AT_CLEANUP
-
-AT_SETUP([doubly nested cells])
-AT_KEYWORDS([render rendering])
-AT_DATA([input], [WEAVE_8X8[]WEAVE_6X6[]dnl
-4 2
-@{0}
-@{1}
-@{1}
-@|{1}
-@|{1}
-@({1}
-@({1}
-@{0}
-1 1
-@{2}
-])
-AT_CHECK([render-test input --length=70], [0], [dnl
-+-------------------------------------+
-|+-----------------+-----------------+|
-||+-+-+-+-+-+-+-+-+| +-+---+-+-+-+||
-|||a|b|c|d|e|f|g|h|| |a|bcd|e|f|i|||
-||+-+-+-+-+-+-+-+-+| +-+-+-+-+g+-+||
-|||i|jkl|m|nop|q|t|| |j|m|nop|h|q|||
-||+-+-+-+-+-+-+r+-+| |k+-+-+-+-+r|||
-|||u|v|wxy|z|A|s|D|| |l|t|w|xyz|s|||
-||+-+-+-+-+-+B+-+-+| +-+u+-+-+-+-+||
-|||E|F|I|JKL|C|M|P|| |A|v|B|E|FGH|||
-||+-+G+-+---+-+N+-+| +-+-+C+-+-+-+||
-|||Q|H|R|UVW|X|O|Y|| |IJK|D|L|O|P|||
-||+-+-+S+-+-+-+-+-+| +-+-+-+M+-+-+||
-|||Z|0|T|3|456|7|8|| |Q|RST|N|U|V|||
-||+-+1+-+-+-+-+-+-+| +-+---+-+-+-+||
-|||9|2|abc|d|efg|h|| ||
-||+-+-+-+-+-+-+-+-+| ||
-|||i|j|k|l|m|n|o|p|| ||
-||+-+-+-+-+-+-+-+-+| ||
-|+-----------------+-----------------+|
-|| +-+---+-+-+-+| +-+---+-+-+-+ ||
-|| |a|bcd|e|f|i|| |a|bcd|e|f|i| ||
-|| +-+-+-+-+g+-+| +-+-+-+-+g+-+ ||
-|| |j|m|nop|h|q|| |j|m|nop|h|q| ||
-|| |k+-+-+-+-+r|| |k+-+-+-+-+r| ||
-|| |l|t|w|xyz|s|| |l|t|w|xyz|s| ||
-|| +-+u+-+-+-+-+| +-+u+-+-+-+-+ ||
-|| |A|v|B|E|FGH|| |A|v|B|E|FGH| ||
-|| +-+-+C+-+-+-+| +-+-+C+-+-+-+ ||
-|| |IJK|D|L|O|P|| |IJK|D|L|O|P| ||
-|| +-+-+-+M+-+-+| +-+-+-+M+-+-+ ||
-|| |Q|RST|N|U|V|| |Q|RST|N|U|V| ||
-|| +-+---+-+-+-+| +-+---+-+-+-+ ||
-|+-----------------+-----------------+|
-|| +-+---+-+-+-+ |+-+---+-+-+-+ ||
-|| |a|bcd|e|f|i| ||a|bcd|e|f|i| ||
-|| +-+-+-+-+g+-+ |+-+-+-+-+g+-+ ||
-|| |j|m|nop|h|q| ||j|m|nop|h|q| ||
-|| |k+-+-+-+-+r| ||k+-+-+-+-+r| ||
-|| |l|t|w|xyz|s| ||l|t|w|xyz|s| ||
-|| +-+u+-+-+-+-+ |+-+u+-+-+-+-+ ||
-|| |A|v|B|E|FGH| ||A|v|B|E|FGH| ||
-|| +-+-+C+-+-+-+ |+-+-+C+-+-+-+ ||
-|| |IJK|D|L|O|P| ||IJK|D|L|O|P| ||
-|| +-+-+-+M+-+-+ |+-+-+-+M+-+-+ ||
-|| |Q|RST|N|U|V| ||Q|RST|N|U|V| ||
-|| +-+---+-+-+-+ |+-+---+-+-+-+ ||
-|+-----------------+-----------------+|
-||+-+---+-+-+-+ |+-+-+-+-+-+-+-+-+||
-|||a|bcd|e|f|i| ||a|b|c|d|e|f|g|h|||
-||+-+-+-+-+g+-+ |+-+-+-+-+-+-+-+-+||
-|||j|m|nop|h|q| ||i|jkl|m|nop|q|t|||
-|||k+-+-+-+-+r| |+-+-+-+-+-+-+r+-+||
-|||l|t|w|xyz|s| ||u|v|wxy|z|A|s|D|||
-||+-+u+-+-+-+-+ |+-+-+-+-+-+B+-+-+||
-|||A|v|B|E|FGH| ||E|F|I|JKL|C|M|P|||
-||+-+-+C+-+-+-+ |+-+G+-+---+-+N+-+||
-|||IJK|D|L|O|P| ||Q|H|R|UVW|X|O|Y|||
-||+-+-+-+M+-+-+ |+-+-+S+-+-+-+-+-+||
-|||Q|RST|N|U|V| ||Z|0|T|3|456|7|8|||
-||+-+---+-+-+-+ |+-+1+-+-+-+-+-+-+||
-|| ||9|2|abc|d|efg|h|||
-|| |+-+-+-+-+-+-+-+-+||
-|| ||i|j|k|l|m|n|o|p|||
-|| |+-+-+-+-+-+-+-+-+||
-|+-----------------+-----------------+|
-+-------------------------------------+
-])
-AT_CLEANUP
\f
AT_BANNER([output rendering -- horizontal page breaks])
AT_CHECK([render-test -o mb0 --min-break=0 --width=7 --length=6 input],
[0], [expout])
AT_CLEANUP
-
-AT_SETUP([breaking nested cell too tall for page])
-AT_KEYWORDS([render rendering])
-AT_CAPTURE_FILE([input])
-AT_DATA([input], [WEAVE_8X8[]WEAVE_6X6[]dnl
-1 2
-@{0}
-@{1}
-])
-AT_CHECK([render-test input --length=10], [0], [dnl
-+-----------------+-------------+
-|+-+-+-+-+-+-+-+-+|+-+---+-+-+-+|
-||a|b|c|d|e|f|g|h|||a|bcd|e|f|i||
-|+-+-+-+-+-+-+-+-+|+-+-+-+-+g+-+|
-||i|jkl|m|nop|q|t|||j|m|nop|h|q||
-|+-+-+-+-+-+-+r+-+||k+-+-+-+-+r||
-||u|v|wxy|z|A|s|D|||l|t|w|xyz|s||
-|+-+-+-+-+-+B+-+-+|+-+u+-+-+-+-+|
-||E|F|I|JKL|C|M|P|||A|v|B|E|FGH||
-|+-+G+-+---+-+N+-+|+-+-+C+-+-+-+|
-
-||Q|H|R|UVW|X|O|Y|||IJK|D|L|O|P||
-|+-+-+S+-+-+-+-+-+|+-+-+-+M+-+-+|
-||Z|0|T|3|456|7|8|||Q|RST|N|U|V||
-|+-+1+-+-+-+-+-+-+|+-+---+-+-+-+|
-||9|2|abc|d|efg|h|| |
-|+-+-+-+-+-+-+-+-+| |
-||i|j|k|l|m|n|o|p|| |
-|+-+-+-+-+-+-+-+-+| |
-+-----------------+-------------+
-])
-AT_CLEANUP
\f
AT_BANNER([output rendering -- double page breaks])