Commit d1eef68a authored by Morten Welinder's avatar Morten Welinder
Browse files

Sheet: improve default row height.

Excel's 12.75pts doesn't cut it anymore.

Compute the height that a number will get -- see cb_max_cell_height -- and
make sure we are that tall.
parent 4a118b79
......@@ -717,6 +717,9 @@ static void
gnm_sheet_constructed (GObject *obj)
{
Sheet *sheet = SHEET (obj);
int ht;
GnmStyle *style;
PangoContext *context;
if (parent_class->constructed)
parent_class->constructed (obj);
......@@ -772,6 +775,16 @@ gnm_sheet_constructed (GObject *obj)
g_assert_not_reached ();
}
style = sheet_style_default (sheet);
context = gnm_pango_context_get ();
ht = gnm_style_get_pango_height (style, context, 1);
gnm_style_unref (style);
g_object_unref (context);
ht += GNM_ROW_MARGIN + GNM_ROW_MARGIN + 1;
if (ht > sheet_row_get_default_size_pixels (sheet)) {
sheet_row_set_default_size_pixels (sheet, ht);
}
sheet_scale_changed (sheet, TRUE, TRUE);
}
......@@ -5745,6 +5758,13 @@ sheet_colrow_default_calc (Sheet *sheet, double units,
g_return_if_fail (units > 0.);
if (gnm_debug_flag ("colrow")) {
g_printerr ("Setting default %s size to %g%s\n",
is_cols ? "column" : "row",
units,
is_pts ? "pts" : "px");
}
cri->is_default = TRUE;
cri->hard_size = FALSE;
cri->visible = TRUE;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment