text-item: Use struct font_style instead of individual fields.
[pspp] / src / output / spv / spv-writer.c
index 12f3ec70dff5bcff23cf6be7c4b54c09e362f367..a1069f963a191a28279169ba68bc5254eac0ae1c 100644 (file)
@@ -714,7 +714,9 @@ put_custom_currency (struct buf *buf, const struct pivot_table *table)
 static void
 put_x1 (struct buf *buf, const struct pivot_table *table)
 {
-  put_bytes (buf, "\0\1\0", 3);
+  put_byte (buf, 0);
+  put_byte (buf, table->show_title ? 1 : 10);
+  put_byte (buf, 0);
   put_byte (buf, 0);
   put_show_values (buf, table->show_variables);
   put_show_values (buf, table->show_values);
@@ -723,7 +725,7 @@ put_x1 (struct buf *buf, const struct pivot_table *table)
   for (int i = 0; i < 17; i++)
     put_byte (buf, 0);
   put_bool (buf, false);
-  put_byte (buf, 1);
+  put_byte (buf, table->show_caption);
 }
 
 static void
@@ -773,10 +775,10 @@ put_light_table (struct buf *buf, uint64_t table_id,
   put_bool (buf, table->rotate_outer_row_labels);
   put_bool (buf, true);
   put_u32 (buf, 0x15);
-  put_u32 (buf, table->look.width_ranges[H][0]);
-  put_u32 (buf, table->look.width_ranges[H][1]);
-  put_u32 (buf, table->look.width_ranges[V][0]);
-  put_u32 (buf, table->look.width_ranges[V][1]);
+  put_u32 (buf, table->look->width_ranges[H][0]);
+  put_u32 (buf, table->look->width_ranges[H][1]);
+  put_u32 (buf, table->look->width_ranges[V][0]);
+  put_u32 (buf, table->look->width_ranges[V][1]);
   put_u64 (buf, table_id);
 
   /* Titles. */
@@ -798,7 +800,7 @@ put_light_table (struct buf *buf, uint64_t table_id,
   /* Areas. */
   for (size_t i = 0; i < PIVOT_N_AREAS; i++)
     {
-      const struct table_area_style *a = &table->look.areas[i];
+      const struct table_area_style *a = &table->look->areas[i];
       put_byte (buf, i + 1);
       put_byte (buf, 0x31);
       put_string (buf, (a->font_style.typeface
@@ -841,7 +843,7 @@ put_light_table (struct buf *buf, uint64_t table_id,
   put_be32 (buf, PIVOT_N_BORDERS);
   for (size_t i = 0; i < PIVOT_N_BORDERS; i++)
     {
-      const struct table_border_style *b = &table->look.borders[i];
+      const struct table_border_style *b = &table->look->borders[i];
       put_be32 (buf, i);
       put_be32 (buf, (b->stroke == TABLE_STROKE_NONE ? 0
                       : b->stroke == TABLE_STROKE_SOLID ? 1
@@ -861,14 +863,14 @@ put_light_table (struct buf *buf, uint64_t table_id,
   /* Print Settings. */
   uint32_t ps_start = start_count (buf);
   put_be32 (buf, 1);
-  put_bool (buf, table->look.print_all_layers);
-  put_bool (buf, table->look.paginate_layers);
-  put_bool (buf, table->look.shrink_to_fit[H]);
-  put_bool (buf, table->look.shrink_to_fit[V]);
-  put_bool (buf, table->look.top_continuation);
-  put_bool (buf, table->look.bottom_continuation);
-  put_be32 (buf, table->look.n_orphan_lines);
-  put_bestring (buf, table->look.continuation);
+  put_bool (buf, table->look->print_all_layers);
+  put_bool (buf, table->look->paginate_layers);
+  put_bool (buf, table->look->shrink_to_fit[H]);
+  put_bool (buf, table->look->shrink_to_fit[V]);
+  put_bool (buf, table->look->top_continuation);
+  put_bool (buf, table->look->bottom_continuation);
+  put_be32 (buf, table->look->n_orphan_lines);
+  put_bestring (buf, table->look->continuation);
   end_count_u32 (buf, ps_start);
 
   /* Table Settings. */
@@ -876,10 +878,10 @@ put_light_table (struct buf *buf, uint64_t table_id,
   put_be32 (buf, 1);
   put_be32 (buf, 4);
   put_be32 (buf, 0);            /* XXX current_layer */
-  put_bool (buf, table->look.omit_empty);
-  put_bool (buf, table->look.row_labels_in_corner);
-  put_bool (buf, !table->look.show_numeric_markers);
-  put_bool (buf, table->look.footnote_marker_superscripts);
+  put_bool (buf, table->look->omit_empty);
+  put_bool (buf, table->look->row_labels_in_corner);
+  put_bool (buf, !table->look->show_numeric_markers);
+  put_bool (buf, table->look->footnote_marker_superscripts);
   put_byte (buf, 0);
   uint32_t keep_start = start_count (buf);
   put_be32 (buf, 0);            /* n-row-breaks */
@@ -890,7 +892,7 @@ put_light_table (struct buf *buf, uint64_t table_id,
   put_be32 (buf, 0);            /* n-column-point-keeps */
   end_count_be32 (buf, keep_start);
   put_bestring (buf, table->notes);
-  put_bestring (buf, table->look.name);
+  put_bestring (buf, table->look->name);
   for (size_t i = 0; i < 82; i++)
     put_byte (buf, 0);
   end_count_u32 (buf, ts_start);