static void html_write_border_style_40_for_merged_cell (GsfOutput *output, GnmStyle const *style, Sheet *sheet, gint row, gint col) { GnmBorder *border; GnmRange const *merge_range; GnmCellPos pos; pos.col = col; pos.row = row; border = gnm_style_get_border (style, MSTYLE_BORDER_TOP); if (!gnm_style_border_is_blank (border)) html_write_one_border_style_40 (output, border, "border-top"); border = gnm_style_get_border (style, MSTYLE_BORDER_LEFT); if (!gnm_style_border_is_blank (border)) html_write_one_border_style_40 (output, border, "border-left"); merge_range = gnm_sheet_merge_contains_pos (sheet, &pos); if (merge_range != NULL) { style = sheet_style_get (sheet, merge_range->end.col, merge_range->end.row); if (style == NULL) return; } border = gnm_style_get_border (style, MSTYLE_BORDER_BOTTOM); if (!gnm_style_border_is_blank (border)) html_write_one_border_style_40 (output, border, "border-bottom"); border = gnm_style_get_border (style, MSTYLE_BORDER_RIGHT); if (!gnm_style_border_is_blank (border)) html_write_one_border_style_40 (output, border, "border-right"); }
static void html_write_border_style_40 (GsfOutput *output, GnmStyle const *style) { GnmBorder *border; border = gnm_style_get_border (style, MSTYLE_BORDER_TOP); if (!gnm_style_border_is_blank (border)) html_write_one_border_style_40 (output, border, "border-top"); border = gnm_style_get_border (style, MSTYLE_BORDER_BOTTOM); if (!gnm_style_border_is_blank (border)) html_write_one_border_style_40 (output, border, "border-bottom"); border = gnm_style_get_border (style, MSTYLE_BORDER_LEFT); if (!gnm_style_border_is_blank (border)) html_write_one_border_style_40 (output, border, "border-left"); border = gnm_style_get_border (style, MSTYLE_BORDER_RIGHT); if (!gnm_style_border_is_blank (border)) html_write_one_border_style_40 (output, border, "border-right"); }
void gnm_style_border_print_diag_gtk (GnmStyle const *style, cairo_t *context, double x1, double y1, double x2, double y2) { GnmBorder const *diag; cairo_save (context); diag = gnm_style_get_border (style, MSTYLE_BORDER_REV_DIAGONAL); if (diag != NULL && diag->line_type != GNM_STYLE_BORDER_NONE) { style_border_set_gtk (diag, context); if (diag->line_type == GNM_STYLE_BORDER_DOUBLE) { cairo_move_to (context, x1+1.5, y1+3.); cairo_line_to (context, x2-2., y2- .5); cairo_stroke (context); cairo_move_to (context, x1+ 3., y1+1.5); cairo_line_to (context, x2- .5, y2-2.); } else { cairo_move_to (context, x1+.5, y1+.5); cairo_line_to (context, x2+.5, y2+.5); } cairo_stroke (context); } diag = gnm_style_get_border (style, MSTYLE_BORDER_DIAGONAL); if (diag != NULL && diag->line_type != GNM_STYLE_BORDER_NONE) { style_border_set_gtk (diag, context); if (diag->line_type == GNM_STYLE_BORDER_DOUBLE) { cairo_move_to (context, x1+1.5, y2-2.); cairo_line_to (context, x2-2., y1+1.5); cairo_stroke (context); cairo_move_to (context, x1+3., y2- .5); cairo_line_to (context, x2- .5, y1+3.); } else { cairo_move_to (context, x1+.5, y2+.5); cairo_line_to (context, x2+.5, y1+.5); } cairo_stroke (context); } cairo_restore (context); }