Commit c9ba258d authored by Jody Goldberg's avatar Jody Goldberg Committed by Jody Goldberg

add new convenience routine.

2002-02-21  Jody Goldberg <jody@gnome.org>

	* gnumeric-expr-entry.c (gnm_expr_entry_load_from_expr) : add new
	  convenience routine.
parent 4afdc104
2002-02-21 Jody Goldberg <jody@gnome.org>
* gnumeric-expr-entry.c (gnm_expr_entry_load_from_expr) : add new
convenience routine.
2002-02-21 Morten Welinder <terra@diku.dk>
* widget-font-selector.c (styles): Constify.
......
......@@ -788,6 +788,33 @@ gnm_expr_entry_load_from_dep (GnumericExprEntry *gee, Dependent const *dep)
gnm_expr_entry_load_from_text (gee, "");
}
/**
* gnm_expr_entry_load_from_expr
* @gee: a #GnumericExprEntry
* @expr: An expression
* @pp : The parse position
*
* Sets the text of the entry, and removes saved information about earlier
* range selections.
**/
void
gnm_expr_entry_load_from_expr (GnumericExprEntry *gee,
ExprTree const *expr, ParsePos const *pp)
{
g_return_if_fail (IS_GNUMERIC_EXPR_ENTRY (gee));
/* We have nowhere to store the text while frozen. */
g_return_if_fail (gee->freeze_count == 0);
if (expr != NULL) {
char *text = expr_tree_as_string (expr, pp);
gee_rangesel_reset (gee);
gtk_entry_set_text (gee->entry, text);
gee->rangesel.text_end = strlen (text);
g_free (text);
} else
gnm_expr_entry_load_from_text (gee, "");
}
/**
* gnm_expr_entry_load_from_range
* @gee: a #GnumericExprEntry
......
......@@ -50,9 +50,12 @@ GSList *gnm_expr_entry_parse_as_list (GnumericExprEntry *ee, Sheet *sheet);
ExprTree *gnm_expr_entry_parse (GnumericExprEntry *e,
ParsePos const *pp,
ParseError *perr, gboolean start_sel);
void gnm_expr_entry_load_from_text (GnumericExprEntry *e, char const *str);
void gnm_expr_entry_load_from_dep (GnumericExprEntry *e,
void gnm_expr_entry_load_from_text (GnumericExprEntry *e, char const *str);
void gnm_expr_entry_load_from_dep (GnumericExprEntry *e,
Dependent const *dep);
void gnm_expr_entry_load_from_expr (GnumericExprEntry *e,
ExprTree const *expr,
ParsePos const *pp);
gboolean gnm_expr_entry_load_from_range (GnumericExprEntry *e,
Sheet *sheet, Range const *r);
......
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