Commit 99c5649c authored by Morten Welinder's avatar Morten Welinder

RenderedValue: add debug code

parent 5b1287d6
......@@ -63,6 +63,16 @@ static int rv_allocations;
#define CHUNK_FREE(p,v) (rv_allocations--, g_slice_free1 (sizeof(*v),(v)))
#endif
static gboolean
debug_rv (void)
{
static int res = -1;
if (res == -1) {
res = gnm_debug_flag ("rendered-value");
}
return res > 0;
}
static guint16
calc_indent (PangoContext *context, const GnmStyle *mstyle)
......@@ -220,12 +230,16 @@ gnm_rendered_value_new (GnmCell const *cell,
GnmStyle const *mstyle;
PangoDirection dir;
char const *text;
gboolean debug = debug_rv ();
g_return_val_if_fail (cell != NULL, NULL);
/* sheet->workbook can be NULL when called from preview-grid.c */
sheet = cell->base.sheet;
if (debug)
g_printerr ("Rendering %s\n", cell_name (cell));
displayed_formula =
gnm_cell_has_expr (cell) && sheet->display_formulas;
......@@ -314,6 +328,9 @@ gnm_rendered_value_new (GnmCell const *cell,
double font_size, scale = 1., tscale;
int rise = 0;
if (debug)
g_printerr (" Markup on value: %s\n", go_format_as_XL (fmt));
attrs = pango_attr_list_copy (attrs);
iter = pango_attr_list_get_iterator (attrs);
......
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