X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Foutput%2Fspv%2Fspv-writer.c;h=a1069f963a191a28279169ba68bc5254eac0ae1c;hb=0394b56ed72885ec7a9dec776c1c676768e7c01a;hp=4883ebf5ba36477cff3fa7bcf90a696a93a74d5f;hpb=5164eb1bfa0527dcb32248fb1fc7db55c2bcc94c;p=pspp diff --git a/src/output/spv/spv-writer.c b/src/output/spv/spv-writer.c index 4883ebf5ba..a1069f963a 100644 --- a/src/output/spv/spv-writer.c +++ b/src/output/spv/spv-writer.c @@ -294,9 +294,6 @@ void spv_writer_put_text (struct spv_writer *w, const struct text_item *text, const char *command_id) { - if (text->type == TEXT_ITEM_EJECT_PAGE) - w->need_page_break = true; - bool initial_depth = w->heading_depth; if (!initial_depth) spv_writer_open_file (w); @@ -325,6 +322,12 @@ spv_writer_put_text (struct spv_writer *w, const struct text_item *text, if (!initial_depth) spv_writer_close_file (w, ""); } + +void +spv_writer_eject_page (struct spv_writer *w) +{ + w->need_page_break = true; +} #define H TABLE_HORZ #define V TABLE_VERT @@ -711,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); @@ -720,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 @@ -770,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. */ @@ -795,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 @@ -838,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 @@ -858,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. */ @@ -873,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 */ @@ -887,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);