work toward making pivot tables the primary representation
[pspp] / src / output / pivot-table.c
index 50bed0a7115f626918d27c7be8057c8e712d3c9c..afa306e30ff9607ffca429ade31a88c29a353b73 100644 (file)
@@ -817,11 +817,11 @@ pivot_table_create (const char *title)
   return pivot_table_create__ (pivot_value_new_text (title), title);
 }
 
-/* Creates and returns a new pivot table with the given TITLE, and takes
-   ownership of TITLE.  The new pivot table's subtype is SUBTYPE, which
-   should be an untranslated English string that describes the contents of
-   the table at a high level without being specific about the variables or
-   other context involved.
+/* Creates and returns a new pivot table with the given TITLE (which may be
+   null), and takes ownership of TITLE.  The new pivot table's subtype is
+   SUBTYPE, which should be an untranslated English string that describes the
+   contents of the table at a high level without being specific about the
+   variables or other context involved.
 
    Operations commonly performed on the new pivot_table:
 
@@ -2122,16 +2122,29 @@ pivot_value_get_style (struct pivot_value *value,
 void
 pivot_value_set_style (struct pivot_value *value,
                        const struct table_area_style *area)
+{
+  pivot_value_set_font_style (value, &area->font_style);
+  pivot_value_set_cell_style (value, &area->cell_style);
+}
+
+void
+pivot_value_set_font_style (struct pivot_value *value,
+                            const struct font_style *font_style)
 {
   if (value->font_style)
     font_style_uninit (value->font_style);
   else
     value->font_style = xmalloc (sizeof *value->font_style);
-  font_style_copy (NULL, value->font_style, &area->font_style);
+  font_style_copy (NULL, value->font_style, font_style);
+}
 
+void
+pivot_value_set_cell_style (struct pivot_value *value,
+                            const struct cell_style *cell_style)
+{
   if (!value->cell_style)
     value->cell_style = xmalloc (sizeof *value->cell_style);
-  *value->cell_style = area->cell_style;
+  *value->cell_style = *cell_style;
 }
 
 /* Frees the data owned by ARG (but not ARG itself). */