output: Remove support for nested tables.
authorBen Pfaff <blp@cs.stanford.edu>
Sun, 2 Dec 2018 21:37:57 +0000 (13:37 -0800)
committerBen Pfaff <blp@cs.stanford.edu>
Mon, 3 Dec 2018 03:11:31 +0000 (19:11 -0800)
They are no longer used.

14 files changed:
src/output/ascii.c
src/output/cairo.c
src/output/csv.c
src/output/html.c
src/output/odt.c
src/output/tab.c
src/output/tab.h
src/output/table-casereader.c
src/output/table-provider.h
src/output/table.c
src/output/table.h
tests/language/dictionary/sys-file-info.at
tests/output/render-test.c
tests/output/render.at

index 897182d04303b70aea89d370ac5d40e21f4c28b4..ae5e25bef4d32482026d456caade19dda7ae41cc 100644 (file)
@@ -646,7 +646,6 @@ ascii_measure_cell_width (void *a_, const struct table_cell *cell,
   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, ' '))
     {
@@ -945,69 +944,6 @@ ascii_layout_cell_text (struct ascii_driver *a,
   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 (&params, 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,
@@ -1033,12 +969,8 @@ ascii_layout_cell (struct ascii_driver *a, const struct table_cell *cell,
             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];
 }
@@ -1059,7 +991,6 @@ ascii_test_write (struct output_driver *driver,
 
   contents.options = options | TAB_LEFT;
   contents.text = CONST_CAST (char *, s);
-  contents.table = NULL;
   contents.n_footnotes = 0;
 
   memset (&cell, 0, sizeof cell);
index ef0b593233e67f7e03867926d35753536314166f..49a7f7ed3dda709f52280480151e5ca04fa71b55 100644 (file)
@@ -1105,81 +1105,6 @@ xr_layout_cell_text (struct xr_driver *xr,
   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 (&params, 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,
@@ -1228,12 +1153,8 @@ xr_layout_cell (struct xr_driver *xr, const struct table_cell *cell,
             *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];
index 455584914e7c4a470e8c506640880d6b94bad1f7..d463a3f6de3546b9be239c173c15b305673d1475 100644 (file)
@@ -164,93 +164,6 @@ csv_output_field_format (struct csv_driver *csv, const char *format, ...)
   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)
 {
@@ -315,10 +228,7 @@ csv_submit (struct output_driver *driver,
                       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++)
                         {
index 38b89719a443095bf3456437a05b81bb6f6c450d..6dc2ffe7379b00a5018946ace0365af5fec1f32e 100644 (file)
@@ -527,45 +527,40 @@ html_output_table (struct html_driver *html, const struct table_item *item)
           /* 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), "&nbsp;", "<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), "&nbsp;", "<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>. */
index 065ef379a6d176455dde3d0a523b1c7ea28872b8..63c10054f9411528a49e63f79ec8e3362af68ba4 100644 (file)
@@ -526,25 +526,19 @@ write_table (struct odt_driver *odt, const struct table_item *item)
                   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 */
            }
index 733cc9854fd09de4b68f9509f4bc3c8b2a37cc00..78bde01e5dcb1a36de59556dbd7af5140919b8ae 100644 (file)
@@ -53,8 +53,6 @@ static const bool debugging = false;
 
 /* 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
@@ -643,39 +641,6 @@ tab_footnote (struct tab_table *table, int x, int y, const char *format, ...)
   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)
 {
@@ -815,32 +780,15 @@ tab_get_cell (const struct table *table, int x, int y,
   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;
index 9371d812c652292de4fb8e64032665be96a12ab6..3109e39439d165f0c94a4dd3e7cf8117d5f86b27 100644 (file)
@@ -146,11 +146,6 @@ void tab_joint_text_format (struct tab_table *, int x1, int y1, int x2, int y2,
 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. */
index 485014dc81a20eac816f91ed34435033d2910676..36f74f20c4b55c07309c102572efa3693b1da8e5 100644 (file)
@@ -113,7 +113,6 @@ table_casereader_get_cell (const struct table *t, int x, int y,
   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)
     {
index b64410c22703b33f7f4b98bc49a624f016d0dfbc..5dbf99b15ad3e6303357a061fd7adc390932eee3 100644 (file)
@@ -1,5 +1,5 @@
 /* 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;
index e354bb3edfc540a9b920a61e68a3e59fe773d411..2158ca723e53bf3c5e2a83adb91433c079bad943 100644 (file)
@@ -320,7 +320,6 @@ table_string_get_cell (const struct table *ts_, int x UNUSED, int y UNUSED,
   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;
@@ -342,81 +341,3 @@ static const struct table_class table_string_class =
     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 */
-  };
-
index 919777db53ff3b90feaecc2c781e04ebae72a5b6..09e5041a3eeed7f62b0897bfea25e46fa36ba5a3 100644 (file)
@@ -171,8 +171,6 @@ struct table *table_from_casereader (const struct casereader *,
                                      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 *,
index 25e38e45fef60fc9d02f494b926b68e78cfd7c0a..d71e813743b0119fb60f6424c9d589630405c25c 100644 (file)
@@ -29,8 +29,6 @@ SAVE OUTFILE='pro.sav'.
 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' \
index fdfb2d20b6feb0cf664fd8bc7251908cb89789bc..2c683813319daa7a345b8a7f93b1a5ac7baaa267 100644 (file)
@@ -67,7 +67,7 @@ static const char *output_base = "render";
 
 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
@@ -103,7 +103,7 @@ main (int argc, char **argv)
           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);
@@ -351,7 +351,7 @@ replace_newlines (char *p)
 }
 
 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];
@@ -381,7 +381,6 @@ read_table (FILE *stream, struct table **tables, size_t n_tables)
         {
           unsigned int opt;
           char *new_line;
-          unsigned int i;
           char *text;
           int rs, cs;
 
@@ -452,45 +451,16 @@ read_table (FILE *stream, struct table **tables, size_t n_tables)
 
           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;
index b2c9731ce06ad32d8ae636cb55770e3e4b97b16a..e1d6fcea365ca74d7647e6f2989f592527fabee7 100644 (file)
@@ -182,17 +182,6 @@ AT_CHECK([render-test input], [0], [abc
 ])
 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
@@ -205,22 +194,6 @@ AT_CHECK([render-test input], [0], [dnl
 ])
 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
@@ -406,26 +379,6 @@ AT_CHECK([render-test input], [0], [dnl
 ])
 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])
@@ -567,203 +520,6 @@ AT_CHECK([render-test input], [0],[dnl
 +-----+------+----+
 ])
 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])
 
@@ -2392,38 +2148,6 @@ AT_CHECK([render-test --width=7 --length=6 input], [0], [expout])
 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])