[gnumeric] GUI: Restore auto-expression's use-max-precision option
- From: Morten Welinder <mortenw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] GUI: Restore auto-expression's use-max-precision option
- Date: Thu, 5 Jan 2012 13:59:11 +0000 (UTC)
commit 99cdf9ca80d6bc5f02364b957d43b2d0eaa97947
Author: Morten Welinder <terra gnome org>
Date: Thu Jan 5 08:58:48 2012 -0500
GUI: Restore auto-expression's use-max-precision option
src/workbook-view.c | 18 ++++++++++--------
1 files changed, 10 insertions(+), 8 deletions(-)
---
diff --git a/src/workbook-view.c b/src/workbook-view.c
index b1b50b6..5f2974a 100644
--- a/src/workbook-view.c
+++ b/src/workbook-view.c
@@ -509,12 +509,10 @@ wb_view_auto_expr_recalc (WorkbookView *wbv)
return;
if (wbv->auto_expr.dep.sheet != NULL &&
- wbv->auto_expr.dep.texpr != NULL &&
- wbv->auto_expr.descr != NULL) {
+ wbv->auto_expr.dep.texpr != NULL) {
texpr = wbv->auto_expr.dep.texpr;
gnm_expr_top_ref (texpr);
- } else if (wbv->auto_expr.func != NULL &&
- wbv->auto_expr.descr != NULL) {
+ } else if (wbv->auto_expr.func != NULL) {
sv_selection_apply (sv, &accumulate_regions, FALSE, &selection);
texpr = gnm_expr_top_new
(gnm_expr_new_funcall (wbv->auto_expr.func, selection));
@@ -525,10 +523,14 @@ wb_view_auto_expr_recalc (WorkbookView *wbv)
eval_pos_init_sheet (&ep, wbv->current_sheet);
v = gnm_expr_top_eval (texpr, &ep, GNM_EXPR_EVAL_SCALAR_NON_EMPTY);
- if (v && !VALUE_FMT (v)) {
- GOFormat const *fmt = auto_style_format_suggest (texpr, &ep);
- value_set_fmt (v, fmt);
- go_format_unref (fmt);
+ if (v) {
+ if (wbv->auto_expr.use_max_precision)
+ value_set_fmt (v, NULL);
+ else if (!VALUE_FMT (v)) {
+ GOFormat const *fmt = auto_style_format_suggest (texpr, &ep);
+ value_set_fmt (v, fmt);
+ go_format_unref (fmt);
+ }
}
g_object_set (wbv, "auto-expr-value", v, NULL);
value_release (v);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]