[gnumeric] sheet_get_conventions: code cleanup.



commit cb7e718220d35e9a2d63492e20eedb174ddf9284
Author: Morten Welinder <terra gnome org>
Date:   Fri Mar 21 15:46:11 2014 -0400

    sheet_get_conventions: code cleanup.

 src/expr.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/src/expr.c b/src/expr.c
index 5312a5f..3aa981c 100644
--- a/src/expr.c
+++ b/src/expr.c
@@ -1841,8 +1841,6 @@ gnm_expr_as_string (GnmExpr const *expr, GnmParsePos const *pp,
        /*
         * Defaults for debugging only!
         */
-       if (!convs)
-               convs = gnm_conventions_default;
        if (!pp) {
                /* UGH: Just get the first sheet in the first workbook! */
                Workbook *wb = gnm_app_workbook_get_by_index (0);
@@ -1850,6 +1848,10 @@ gnm_expr_as_string (GnmExpr const *expr, GnmParsePos const *pp,
                parse_pos_init (&pp0, NULL, sheet, 0, 0);
                pp = &pp0;
        }
+       if (!convs)
+               convs = pp->sheet
+                       ? sheet_get_conventions (pp->sheet)
+                       : gnm_conventions_default;
 
        out.accum = g_string_new (NULL);
        out.pp    = pp;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]