[gnumeric] xls: warning fixes.



commit eeaee4e738b6c457466579454d17a4773abd6340
Author: Morten Welinder <terra gnome org>
Date:   Sat Oct 10 21:36:30 2009 -0400

    xls: warning fixes.

 plugins/excel/ms-excel-write.c |    3 +--
 src/expr-name.c                |    3 ++-
 2 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/plugins/excel/ms-excel-write.c b/plugins/excel/ms-excel-write.c
index 3952e0d..f2174b5 100644
--- a/plugins/excel/ms-excel-write.c
+++ b/plugins/excel/ms-excel-write.c
@@ -1571,7 +1571,7 @@ excel_write_NAME (G_GNUC_UNUSED gpointer key,
 		excel_write_string (ewb->bp, STR_NO_LENGTH, name);
 	}
 
-	if (expr_name_is_placeholder (nexpr))
+	if (!nexpr->texpr || expr_name_is_placeholder (nexpr))
 		expr_len = 0;
 	else
 		expr_len = excel_write_formula (ewb, nexpr->texpr,
@@ -5254,7 +5254,6 @@ create_macroname (SheetObject *so)
 	}
 
 	pp.sheet = NULL;
-	g_printerr ("Name = %s\n", name);
 
 	nexpr = expr_name_add (&pp, name, NULL, NULL, TRUE, NULL);
 	expr_name_set_expr (nexpr, NULL);
diff --git a/src/expr-name.c b/src/expr-name.c
index 12028df..4a2639f 100644
--- a/src/expr-name.c
+++ b/src/expr-name.c
@@ -829,7 +829,8 @@ expr_name_is_placeholder (GnmNamedExpr const *nexpr)
 {
 	g_return_val_if_fail (nexpr != NULL, FALSE);
 
-	return gnm_expr_top_is_err (nexpr->texpr, GNM_ERROR_NAME);
+	return (nexpr->texpr &&
+		gnm_expr_top_is_err (nexpr->texpr, GNM_ERROR_NAME));
 }
 
 int



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