output: Improve comments.
authorBen Pfaff <blp@cs.stanford.edu>
Fri, 1 Jan 2021 05:57:30 +0000 (21:57 -0800)
committerBen Pfaff <blp@cs.stanford.edu>
Fri, 1 Jan 2021 05:57:48 +0000 (21:57 -0800)
src/output/pivot-output.c
src/output/pivot-table.c
src/output/pivot-table.h
src/output/spv/spv.h
src/output/table.c
src/output/table.h

index 1a4ac9db7ce7e4faf48b05049a95cef25207fb6b..c8ca2c19d693352c18e3ace1917a0796adee5afc 100644 (file)
@@ -190,6 +190,13 @@ draw_line (struct table *t, const struct table_border_style *styles,
     table_vline (t, rule, a, b0, b1);
 }
 
     table_vline (t, rule, a, b0, b1);
 }
 
+/* Fills row or column headings into T.
+
+   This function uses terminology and variable names for column headings, but
+   it also applies to row headings because it uses variables for the
+   differences, e.g. when for column headings it would use the H axis, it
+   instead uses 'h', which is set to H for column headings and V for row
+   headings.  */
 static void
 compose_headings (struct table *t,
                   const struct pivot_axis *a_axis, enum table_axis a,
 static void
 compose_headings (struct table *t,
                   const struct pivot_axis *a_axis, enum table_axis a,
@@ -348,6 +355,23 @@ compose_headings (struct table *t,
                       vrules[x1] = true;
                     }
                 }
                       vrules[x1] = true;
                     }
                 }
+
+              /* Draws the horizontal lines within a dimension, that is, those
+                 that separate a separating a category (or group) from its
+                 parent group or dimension's label.  Our running example
+                 doesn't have groups but the ==== lines below show the
+                 separators between categories and their dimension label:
+
+                 +-----------------------------------------------------+
+                 |                         bbbb                        |
+                 +=================+=================+=================+
+                 |      bbbb1      |      bbbb2      |      bbbb3      |
+                 +-----------------+-----------------+-----------------+
+                 |       aaaa      |       aaaa      |       aaaa      |
+                 +=====+=====+=====+=====+=====+=====+=====+=====+=====+
+                 |aaaa1|aaaa2|aaaa3|aaaa1|aaaa2|aaaa3|aaaa1|aaaa2|aaaa3|
+                 +-----+-----+-----+-----+-----+-----+-----+-----+-----+
+              */
               if (c->parent && c->parent->show_label)
                 draw_line (t, borders, cat_col_horz, a, y1,
                            x1 + a_ofs, x2 + a_ofs - 1);
               if (c->parent && c->parent->show_label)
                 draw_line (t, borders, cat_col_horz, a, y1,
                            x1 + a_ofs, x2 + a_ofs - 1);
index aa5b181c52dda70e78a48a2bc5ff57ddfd833c6f..a01bae388d63affce42a4f89830e677150550f67 100644 (file)
@@ -1389,10 +1389,6 @@ pivot_table_assign_label_depth (struct pivot_table *table)
   pivot_axis_assign_label_depth (table, PIVOT_AXIS_LAYER, false);
 }
 \f
   pivot_axis_assign_label_depth (table, PIVOT_AXIS_LAYER, false);
 }
 \f
-/* Footnotes. */
-
-\f
-\f
 static void
 indent (int indentation)
 {
 static void
 indent (int indentation)
 {
index de50c7f39e3bed05fadb34224ee524624e26ab23..56ca865a2d3e4eac589b36b56e5ab1bdb2117d57 100644 (file)
@@ -428,7 +428,7 @@ struct pivot_table
     bool show_grid_lines;
     bool show_title;
     bool show_caption;
     bool show_grid_lines;
     bool show_title;
     bool show_caption;
-    size_t *current_layer; /* axis[PIVOT_AXIS_LAYER].n_dimensions elements. */
+    size_t *current_layer; /* axes[PIVOT_AXIS_LAYER].n_dimensions elements. */
     enum settings_value_show show_values;
     enum settings_value_show show_variables;
     struct fmt_spec weight_format;
     enum settings_value_show show_values;
     enum settings_value_show show_variables;
     struct fmt_spec weight_format;
index 6857d9b3b67f7e0d01dd699a2c6de6893b0c1798..d1706f4e7ecc4334c2e4d49e6f45b3fdc6335161 100644 (file)
@@ -116,8 +116,8 @@ struct spv_item
     char *structure_member;
 
     enum spv_item_type type;
     char *structure_member;
 
     enum spv_item_type type;
-    char *label;
-    char *command_id;           /* Unique command identifier. */
+    char *label;                /* Localized label. */
+    char *command_id;           /* Non-localized unique command identifier. */
 
     /* Whether the item is visible.
        For SPV_ITEM_HEADING, false indicates that the item is collapsed.
 
     /* Whether the item is visible.
        For SPV_ITEM_HEADING, false indicates that the item is collapsed.
index 5087441224a3c75bcea5f2e87ab3eb7fd9521e90..2691b79e0dbebee7e2afd4a47188ee3bc8b69d94 100644 (file)
@@ -693,10 +693,7 @@ table_cell_is_empty (const struct table *table, int c, int r)
 }
 \f
 /* Initializes CELL with the contents of the table cell at column X and row Y
 }
 \f
 /* Initializes CELL with the contents of the table cell at column X and row Y
-   within TABLE.  When CELL is no longer needed, the caller is responsible for
-   freeing it by calling table_cell_free(CELL).
-
-   The caller must ensure that CELL is destroyed before TABLE is unref'ed. */
+   within TABLE. */
 void
 table_get_cell (const struct table *t, int x, int y, struct table_cell *cell)
 {
 void
 table_get_cell (const struct table *t, int x, int y, struct table_cell *cell)
 {
index 07c88874c86a47eb925089c6b9606f3859f161f4..85d063e8b6f730fda5e8957dfdeb9eec1da30385 100644 (file)
@@ -19,7 +19,7 @@
 
 /* Tables.
 
 
 /* Tables.
 
-.  A table is a rectangular grid of cells.  Cells can be joined to form larger
+   A table is a rectangular grid of cells.  Cells can be joined to form larger
    cells.  Rows and columns can be separated by rules of various types.  Rows
    at the top and bottom of a table and columns at the left and right edges of
    a table can be designated as headers, which means that if the table must be
    cells.  Rows and columns can be separated by rules of various types.  Rows
    at the top and bottom of a table and columns at the left and right edges of
    a table can be designated as headers, which means that if the table must be