+ out->omit_empty = (flags & 0x02) != 0;
+ out->row_labels_in_corner = !in->tl->nested_row_labels;
+ if (in->v2_styles)
+ {
+ out->col_heading_width_range[0] = in->v2_styles->min_col_heading_width;
+ out->col_heading_width_range[1] = in->v2_styles->max_col_heading_width;
+ out->row_heading_width_range[0] = in->v2_styles->min_row_heading_width;
+ out->row_heading_width_range[1] = in->v2_styles->max_row_heading_width;
+ }
+ else
+ {
+ out->col_heading_width_range[0] = 36;
+ out->col_heading_width_range[1] = 72;
+ out->row_heading_width_range[0] = 36;
+ out->row_heading_width_range[1] = 120;
+ }
+
+ out->show_numeric_markers = flags & 0x04;
+ out->footnote_marker_superscripts = !in->tl->footnote_marker_subscripts;
+
+ for (int i = 0; i < 4; i++)
+ {
+ static const enum pivot_border map[4] =
+ {
+ PIVOT_BORDER_DIM_ROW_HORZ,
+ PIVOT_BORDER_DIM_ROW_VERT,
+ PIVOT_BORDER_CAT_ROW_HORZ,
+ PIVOT_BORDER_CAT_ROW_VERT,
+ };
+ tlo_decode_border (in->ss->sep1[i], &out->borders[map[i]]);
+ }
+
+ for (int i = 0; i < 4; i++)
+ {
+ static const enum pivot_border map[4] =
+ {
+ PIVOT_BORDER_DIM_COL_HORZ,
+ PIVOT_BORDER_DIM_COL_VERT,
+ PIVOT_BORDER_CAT_COL_HORZ,
+ PIVOT_BORDER_CAT_COL_VERT,
+ };
+ tlo_decode_border (in->ss->sep2[i], &out->borders[map[i]]);
+ }
+
+ if (in->v2_styles)
+ for (int i = 0; i < 11; i++)
+ {
+ static const enum pivot_border map[11] =
+ {
+ PIVOT_BORDER_TITLE,
+ PIVOT_BORDER_INNER_LEFT,
+ PIVOT_BORDER_INNER_RIGHT,
+ PIVOT_BORDER_INNER_TOP,
+ PIVOT_BORDER_INNER_BOTTOM,
+ PIVOT_BORDER_OUTER_LEFT,
+ PIVOT_BORDER_OUTER_RIGHT,
+ PIVOT_BORDER_OUTER_TOP,
+ PIVOT_BORDER_OUTER_BOTTOM,
+ PIVOT_BORDER_DATA_LEFT,
+ PIVOT_BORDER_DATA_TOP,
+ };
+ tlo_decode_border (in->v2_styles->sep3[i], &out->borders[map[i]]);
+ }
+ else
+ {
+ out->borders[PIVOT_BORDER_TITLE].stroke = TABLE_STROKE_NONE;
+ out->borders[PIVOT_BORDER_INNER_LEFT].stroke = TABLE_STROKE_SOLID;
+ out->borders[PIVOT_BORDER_INNER_TOP].stroke = TABLE_STROKE_SOLID;
+ out->borders[PIVOT_BORDER_INNER_RIGHT].stroke = TABLE_STROKE_SOLID;
+ out->borders[PIVOT_BORDER_INNER_BOTTOM].stroke = TABLE_STROKE_SOLID;
+ out->borders[PIVOT_BORDER_OUTER_LEFT].stroke = TABLE_STROKE_NONE;
+ out->borders[PIVOT_BORDER_OUTER_TOP].stroke = TABLE_STROKE_NONE;
+ out->borders[PIVOT_BORDER_OUTER_RIGHT].stroke = TABLE_STROKE_NONE;
+ out->borders[PIVOT_BORDER_OUTER_BOTTOM].stroke = TABLE_STROKE_NONE;
+ out->borders[PIVOT_BORDER_DATA_LEFT].stroke = TABLE_STROKE_NONE;
+ out->borders[PIVOT_BORDER_DATA_TOP].stroke = TABLE_STROKE_NONE;
+ }
+
+ tlo_decode_area (in->cs->title_color, in->ts->title_style,
+ &out->areas[PIVOT_AREA_TITLE]);
+ for (int i = 0; i < 7; i++)
+ {
+ static const enum pivot_area map[7] = {
+ PIVOT_AREA_LAYERS,
+ PIVOT_AREA_CORNER,
+ PIVOT_AREA_ROW_LABELS,
+ PIVOT_AREA_COLUMN_LABELS,
+ PIVOT_AREA_DATA,
+ PIVOT_AREA_CAPTION,
+ PIVOT_AREA_FOOTER
+ };
+ tlo_decode_area (in->ts->most_areas[i]->color,
+ in->ts->most_areas[i]->style,
+ &out->areas[map[i]]);
+ }
+
+ out->print_all_layers = flags & 0x08;
+ out->paginate_layers = flags & 0x40;
+ out->shrink_to_fit[TABLE_HORZ] = flags & 0x10;
+ out->shrink_to_fit[TABLE_VERT] = flags & 0x20;
+ out->top_continuation = flags & 0x80;
+ out->bottom_continuation = flags & 0x100;
+ if (in->v2_styles)
+ {
+ free (out->continuation);
+ out->continuation = xmemdup0 (in->v2_styles->continuation,
+ in->v2_styles->continuation_len);
+ }
+ /* n_orphan_lines isn't in .tlo files AFAICT. */
+
+ return out;
+}
+\f