[gnumeric] Fix component references issues. [#680190]



commit a62bc21a1d52a0e49ac42bdd88dcc12db18bf21c
Author: Jean Brefort <jean brefort normalesup org>
Date:   Thu Jul 26 14:50:45 2012 +0200

    Fix component references issues. [#680190]

 ChangeLog                                          |    7 ++
 NEWS                                               |    3 +
 component/gnumeric.c                               |    4 +-
 plugins/excel/ms-excel-read.c                      |    4 +-
 plugins/excel/xlsx-read.c                          |    8 +-
 plugins/fn-stat/functions.c                        |    2 +-
 plugins/fn-string/functions.c                      |   10 +-
 plugins/openoffice/openoffice-read.c               |   86 ++++++++++----------
 plugins/openoffice/openoffice-write.c              |   60 +++++++-------
 src/application.c                                  |    2 +-
 src/cell.c                                         |   32 ++++----
 src/cell.h                                         |    2 +-
 .../dialog-analysis-tool-wilcoxon-mann-whitney.c   |    2 +-
 src/dialogs/dialog-consolidate.c                   |    2 +-
 src/dialogs/dialog-doc-metadata.c                  |    6 +-
 src/expr.c                                         |    6 +-
 src/format-template.h                              |    2 +-
 src/rangefunc.c                                    |    8 +-
 src/rangefunc.h                                    |    2 +-
 src/sheet-filter.c                                 |   10 +-
 src/sheet-object.c                                 |    2 +-
 src/sheet-style.c                                  |    6 +-
 src/ssgrep.c                                       |    2 +
 src/ssindex.c                                      |    2 +
 src/sstest.c                                       |    2 +-
 src/style-conditions.c                             |    2 +-
 src/tools/analysis-one-mean-test.c                 |   12 ++--
 src/tools/analysis-wilcoxon-mann-whitney.c         |   14 ++--
 src/tools/gnm-solver.c                             |    2 +-
 src/wbc-gtk.c                                      |    2 +-
 src/widgets/gnumeric-expr-entry.c                  |   12 ++--
 src/widgets/widget-editable-label.c                |    4 +-
 32 files changed, 168 insertions(+), 152 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 6366c0a..279c3c0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2012-07-26  Jean Brefort  <jean brefort normalesup org>
+
+	* component/gnumeric.c (go_gnm_component_get_data),
+	(cb_editor_destroyed): fix references issues. [#680190]
+	* src/ssgrep.c (main): don't crash for files with components.
+	* src/ssindex.c (main):
+
 2012-07-25  Morten Welinder  <terra gnome org>
 
 	* src/func.h (GnmFunc): Use "usage" instead of "ref_count".
diff --git a/NEWS b/NEWS
index 19ba5f0..4a97ddf 100644
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,9 @@ Andreas:
 	* Some documentation updates.
 	* Fix implicit ')' for array functions. [#680548]
 
+Jean:
+	* Fix component references issues. [#680190]
+
 Morten:
 	* Fix xls read crash.  [#679992]
 	* Reduce code duplication for dependents.
diff --git a/component/gnumeric.c b/component/gnumeric.c
index cc4d1ae..42b77be 100644
--- a/component/gnumeric.c
+++ b/component/gnumeric.c
@@ -101,6 +101,7 @@ go_gnm_component_get_data (GOComponent *component, gpointer *data, int *length,
 		*length = gsf_output_size (output);
 		*clearfunc = g_object_unref;
 		*user_data = output;
+		g_object_unref (io_context);
 		return TRUE;
 	}
 	return FALSE;
@@ -204,7 +205,8 @@ static GtkActionEntry const actions[] = {
 static void
 cb_editor_destroyed (GOGnmComponent *gognm)
 {
-	g_object_unref (gognm->edited);
+	if (gognm->edited && G_OBJECT (gognm->edited)->ref_count > 0)
+		g_object_unref (gognm->edited);
 	gognm->edited = NULL;
 }
 
diff --git a/plugins/excel/ms-excel-read.c b/plugins/excel/ms-excel-read.c
index 291400e..dd55c63 100644
--- a/plugins/excel/ms-excel-read.c
+++ b/plugins/excel/ms-excel-read.c
@@ -5181,7 +5181,7 @@ excel_read_CF (BiffQuery *q, ExcelReadSheet *esheet, GnmStyleConditions *sc)
 	cond = gnm_style_cond_new (cop, esheet->sheet);
 
 	if (expr0_len > 0) {
-		GnmExprTop const *texpr = 
+		GnmExprTop const *texpr =
 			ms_sheet_parse_expr_internal
 			(esheet,
 			 q->data + q->length - expr0_len - expr1_len,
@@ -5190,7 +5190,7 @@ excel_read_CF (BiffQuery *q, ExcelReadSheet *esheet, GnmStyleConditions *sc)
 		gnm_expr_top_unref (texpr);
 	}
 	if (expr1_len > 0) {
-		GnmExprTop const *texpr = 
+		GnmExprTop const *texpr =
 			ms_sheet_parse_expr_internal
 			(esheet,
 			 q->data + q->length - expr1_len,
diff --git a/plugins/excel/xlsx-read.c b/plugins/excel/xlsx-read.c
index d4969f8..15135d5 100644
--- a/plugins/excel/xlsx-read.c
+++ b/plugins/excel/xlsx-read.c
@@ -2261,7 +2261,7 @@ xlsx_cond_fmt_formula_end (GsfXMLIn *xin, G_GNUC_UNUSED GsfXMLBlob *blob)
 
 	parse_pos_init_sheet (&pp, state->sheet);
 
-	gnm_style_cond_set_expr (state->cond, 
+	gnm_style_cond_set_expr (state->cond,
 				 xlsx_parse_expr (xin, xin->content->str, &pp),
 				 state->count);
 	state->count++;
@@ -3150,8 +3150,8 @@ xlsx_run_color (GsfXMLIn *xin, xmlChar const **attrs)
 					_("Invalid color '%s' for attribute rgb"),
 					attrs[1]);
 			}
-			attr = pango_attr_foreground_new (CLAMP ((int)r * 257, 0, 65535), 
-							  CLAMP ((int)g * 257, 0, 65535), 
+			attr = pango_attr_foreground_new (CLAMP ((int)r * 257, 0, 65535),
+							  CLAMP ((int)g * 257, 0, 65535),
 							  CLAMP ((int)b * 257, 0, 65535));
 			if (state->run_attrs == NULL)
 				state->run_attrs = pango_attr_list_new ();
@@ -3451,7 +3451,7 @@ xlsx_sstitem_end (GsfXMLIn *xin, G_GNUC_UNUSED GsfXMLBlob *blob)
 	entry = &g_array_index (state->sst, XLSXStr, state->count);
 	state->count++;
 	entry->str = go_string_new_nocopy (text);
-	
+
 	if (state->rich_attrs) {
 		entry->markup = go_format_new_markup (state->rich_attrs, FALSE);
 		state->rich_attrs = NULL;
diff --git a/plugins/fn-stat/functions.c b/plugins/fn-stat/functions.c
index b439f37..967de7f 100644
--- a/plugins/fn-stat/functions.c
+++ b/plugins/fn-stat/functions.c
@@ -4902,7 +4902,7 @@ gnumeric_adtest (GnmFuncEvalInfo *ei, GnmValue const * const *argv)
 		value_array_set (result, 0, 0,
 				 value_new_error_VALUE (ei->pos));
 		value_array_set (result, 0, 1,
-				 value_new_error_VALUE (ei->pos));		
+				 value_new_error_VALUE (ei->pos));
 	} else {
 		value_array_set (result, 0, 0,
 				 value_new_float (p));
diff --git a/plugins/fn-string/functions.c b/plugins/fn-string/functions.c
index aba50e7..176c061 100644
--- a/plugins/fn-string/functions.c
+++ b/plugins/fn-string/functions.c
@@ -206,7 +206,7 @@ gnm_compare_strings (const char *cstr1, const char *cstr2)
 	/* then it is exactly the same. */
 	while (*a == *b && *a != 0 && *b != 0)
 		a++, b++;
-	
+
 	if (*a == 0)
 		return (*b == 0);
 	if (*b == 0)
@@ -226,17 +226,17 @@ gnm_compare_strings (const char *cstr1, const char *cstr2)
 	/* are both expanded by NFD (or NFKD) into the sequence */
 	/*"U+0041 U+030A" (Latin letter "A" and combining ring above "Â") */
 	/* Of course "U+0041 U+030A" is retained in form, so we need to work with */
-	/* at least the last ASCII character. Performance should nearly be */ 
+	/* at least the last ASCII character. Performance should nearly be */
 	/* identical to using all */
 
 	str1 = g_utf8_normalize (cstr1, -1, G_NORMALIZE_DEFAULT);
 	str2 = g_utf8_normalize (cstr2, -1, G_NORMALIZE_DEFAULT);
-	
+
 	val = (g_strcmp0 (str1, str2) == 0);
-	
+
 	g_free (str1);
 	g_free (str2);
-	
+
 	return val;
 }
 
diff --git a/plugins/openoffice/openoffice-read.c b/plugins/openoffice/openoffice-read.c
index 18462b1..14291fb 100644
--- a/plugins/openoffice/openoffice-read.c
+++ b/plugins/openoffice/openoffice-read.c
@@ -367,7 +367,7 @@ struct  _OOParseState {
 
 	int		 col_inc, row_inc;
 	gboolean	 content_is_error;
-	
+
 	GSList          *text_p_stack;
 	oo_text_p_t      text_p_for_cell;
 
@@ -1513,7 +1513,7 @@ odf_text_p_apply_pango_attribute (PangoAttribute *attribute, gpointer ptr)
 {
 	odf_text_p_apply_style_t *data = ptr;
 	PangoAttribute *attr = pango_attribute_copy (attribute);
-	
+
 	attr->start_index = data->start;
 	attr->end_index = data->end;
 
@@ -1523,7 +1523,7 @@ odf_text_p_apply_pango_attribute (PangoAttribute *attribute, gpointer ptr)
 }
 
 static void
-odf_text_p_apply_style (OOParseState *state, 
+odf_text_p_apply_style (OOParseState *state,
 			PangoAttrList *attrs,
 			int start, int end)
 {
@@ -1542,7 +1542,7 @@ odf_text_p_apply_style (OOParseState *state,
 	data.start = start;
 	data.end = end;
 	data.attrs = ptr->attrs;
-	
+
 	pango_attr_list_filter (attrs, odf_text_p_apply_pango_attribute, &data);
 }
 
@@ -1577,7 +1577,7 @@ odf_pop_text_p (OOParseState *state)
 	GSList *link = state->text_p_stack;
 
 	g_return_if_fail (state->text_p_stack != NULL);
-	
+
 	ptr = link->data;
 	g_slist_free_full (ptr->span_style_stack, g_free);
 	ptr->span_style_stack = NULL;
@@ -1588,7 +1588,7 @@ odf_pop_text_p (OOParseState *state)
 			pango_attr_list_unref (ptr->attrs);
 		g_free (ptr);
 	}
-	
+
 	state->text_p_stack = g_slist_remove_link (state->text_p_stack, link);
 	g_slist_free_1 (link);
 }
@@ -1612,7 +1612,7 @@ odf_text_content_end (GsfXMLIn *xin, G_GNUC_UNUSED GsfXMLBlob *blob)
 	oo_text_p_t *ptr = state->text_p_stack->data;
 
 	if (strlen (xin->content->str) > ptr->offset)
-		odf_text_p_add_text 
+		odf_text_p_add_text
 			(state, xin->content->str + ptr->offset);
 }
 
@@ -2326,7 +2326,7 @@ odf_validation_new_list (GsfXMLIn *xin, odf_validation_t *val, guint offset)
 					     GNM_VALIDATION_TYPE_IN_LIST,
 					     GNM_VALIDATION_OP_NONE,
 					     state->pos.sheet,
-					     val->title, 
+					     val->title,
 					     val->message ? val->message->str : NULL,
 					     texpr,
 					     NULL,
@@ -2358,7 +2358,7 @@ odf_validation_new_single_expr (GsfXMLIn *xin, odf_validation_t *val,
 				       val_type,
 				       val_op,
 				       state->pos.sheet,
-				       val->title, 
+				       val->title,
 				       val->message ? val->message->str : NULL,
 				       texpr,
 				       NULL,
@@ -2416,7 +2416,7 @@ odf_validation_new_pair_expr (GsfXMLIn *xin, odf_validation_t *val,
 				       val_type,
 				       val_op,
 				       state->pos.sheet,
-				       val->title, 
+				       val->title,
 				       val->message ? val->message->str : NULL,
 				       texpr_a,
 				       texpr_b,
@@ -2701,7 +2701,7 @@ odf_validation_error_message_end (GsfXMLIn *xin, G_GNUC_UNUSED GsfXMLBlob *blob)
 static void
 odf_adjust_offsets_col (OOParseState *state, int *col, double *x, gboolean absolute)
 {
-	ColRowInfo const *cr = sheet_col_get_info (state->pos.sheet, 
+	ColRowInfo const *cr = sheet_col_get_info (state->pos.sheet,
 						   *col);
 	int last =  gnm_sheet_get_last_col (state->pos.sheet);
 	if (absolute && *col > 0)
@@ -2722,7 +2722,7 @@ odf_adjust_offsets_col (OOParseState *state, int *col, double *x, gboolean absol
 static void
 odf_adjust_offsets_row (OOParseState *state, int *row, double *y, gboolean absolute)
 {
-	ColRowInfo const *cr = sheet_row_get_info (state->pos.sheet, 
+	ColRowInfo const *cr = sheet_row_get_info (state->pos.sheet,
 						   *row);
 	int last =  gnm_sheet_get_last_row (state->pos.sheet);
 	if (absolute && *row > 0)
@@ -2754,7 +2754,7 @@ oo_table_end (GsfXMLIn *xin, G_GNUC_UNUSED GsfXMLBlob *blob)
 	GnmRange r;
 	int rows, cols;
 	int max_cols, max_rows;
-	GSList *l; 
+	GSList *l;
 
 	maybe_update_progress (xin);
 
@@ -2969,7 +2969,7 @@ odf_oo_cell_style_ref (OOCellStyle *oostyle)
 }
 
 static void
-odf_oo_cell_style_attach_condition (OOCellStyle *oostyle, OOCellStyle *cstyle, 
+odf_oo_cell_style_attach_condition (OOCellStyle *oostyle, OOCellStyle *cstyle,
 				gchar const *condition, gchar const *base)
 {
 	g_return_if_fail (oostyle != NULL);
@@ -3047,7 +3047,7 @@ odf_style_load_one_value (GsfXMLIn *xin, char *condition, GnmStyleCond *cond, gc
 }
 
 static void
-odf_style_add_condition (GsfXMLIn *xin, GnmStyle *style, GnmStyle *cstyle, 
+odf_style_add_condition (GsfXMLIn *xin, GnmStyle *style, GnmStyle *cstyle,
 			 gchar const *condition, gchar const *base)
 {
 	OOParseState *state = (OOParseState *)xin->user_state;
@@ -3147,7 +3147,7 @@ odf_style_add_condition (GsfXMLIn *xin, GnmStyle *style, GnmStyle *cstyle,
 			g_free (text);
 		}
 	}
-	
+
 	if (!success || !cond) {
 		if (cond)
 			gnm_style_cond_free (cond);
@@ -3166,7 +3166,7 @@ odf_style_add_condition (GsfXMLIn *xin, GnmStyle *style, GnmStyle *cstyle,
 		sc = gnm_style_conditions_new (sheet);
 		gnm_style_conditions_insert (sc, cond, -1);
 		gnm_style_set_conditions (style, sc);
-	}	
+	}
 
 	gnm_style_cond_free (cond);
 }
@@ -3636,7 +3636,7 @@ oo_cell_start (GsfXMLIn *xin, xmlChar const **attrs)
 					}
 					gnm_style_set_format (oostyle->style, format);
 				}
-			} 
+			}
 		}
 		if (oostyle != NULL)
 			style = odf_style_from_oo_cell_style (xin, oostyle);
@@ -3860,7 +3860,7 @@ oo_cell_content_start (GsfXMLIn *xin, G_GNUC_UNUSED xmlChar const **attrs)
 		}
        }
 
-       odf_push_text_p (state, TRUE);       
+       odf_push_text_p (state, TRUE);
 }
 
 
@@ -3946,7 +3946,7 @@ oo_covered_cell_start (GsfXMLIn *xin, xmlChar const **attrs)
 
 	state->col_inc = 1;
 	for (; attrs != NULL && attrs[0] && attrs[1] ; attrs += 2)
-		if (oo_attr_int_range (xin, attrs, OO_NS_TABLE, "number-columns-repeated", 
+		if (oo_attr_int_range (xin, attrs, OO_NS_TABLE, "number-columns-repeated",
 				       &state->col_inc, 0, INT_MAX))
 			;
 #if 0
@@ -6412,7 +6412,7 @@ od_style_prop_chart (GsfXMLIn *xin, xmlChar const **attrs)
 					oo_prop_new_string ("map-name", "Log"));
 		} else if (oo_attr_bool (xin, attrs, OO_NS_CHART, "link-data-style-to-source", &btmp)) {
 			if (btmp)
-				style->other_props = g_slist_prepend 
+				style->other_props = g_slist_prepend
 					(style->other_props,
 					 oo_prop_new_bool ("ignore-axis-data-style", btmp));
 		} else if (oo_attr_bool (xin, attrs, OO_NS_CHART, "vertical", &btmp)) {
@@ -6744,7 +6744,7 @@ od_style_prop_chart (GsfXMLIn *xin, xmlChar const **attrs)
 				 ("marker-end", CXML2C(attrs[1])));
 	}
 
-	if ((stacked_set && !overlap_set) || 
+	if ((stacked_set && !overlap_set) ||
 	    (percentage_set && !stacked_unset && !overlap_set))
 		style->plot_props = g_slist_prepend (style->plot_props,
 						     oo_prop_new_int ("overlap-percentage", 100));
@@ -6856,7 +6856,7 @@ od_style_prop_text (GsfXMLIn *xin, xmlChar const **attrs)
 			style_color_unref (color);
 			attr->start_index = 0;
 			attr->end_index = 0;
-			pango_attr_list_insert (state->cur_style.text, attr);			
+			pango_attr_list_insert (state->cur_style.text, attr);
 		} else if ((color = oo_attr_color (xin, attrs, OO_NS_FO, "background-color"))) {
 			attr = go_color_to_pango (color->go_color, FALSE);
 			style_color_unref (color);
@@ -7212,7 +7212,7 @@ od_draw_frame_start (GsfXMLIn *xin, xmlChar const **attrs)
 		frame_offset[3] = end_y ;
 	}
 
-	odf_draw_frame_store_location (state, frame_offset, 
+	odf_draw_frame_store_location (state, frame_offset,
 				       (height > 0) ? height : go_nan,
 				       (width > 0) ? width : go_nan);
 
@@ -7263,7 +7263,7 @@ od_draw_text_frame_end (GsfXMLIn *xin, G_GNUC_UNUSED GsfXMLBlob *blob)
 	OOParseState *state = (OOParseState *)xin->user_state;
 	oo_text_p_t *ptr;
 
-	if (state->text_p_stack != NULL && (NULL != (ptr = state->text_p_stack->data)) 
+	if (state->text_p_stack != NULL && (NULL != (ptr = state->text_p_stack->data))
 	    && ptr->gstr != NULL)
 		g_object_set (state->chart.so, "text", ptr->gstr->str, "markup", ptr->attrs, NULL);
 	od_draw_frame_end_full (xin, FALSE);
@@ -7276,7 +7276,7 @@ odf_line_end (GsfXMLIn *xin, G_GNUC_UNUSED GsfXMLBlob *blob)
 	OOParseState *state = (OOParseState *)xin->user_state;
 	oo_text_p_t *ptr;
 
-	if (state->text_p_stack != NULL && (NULL != (ptr = state->text_p_stack->data)) 
+	if (state->text_p_stack != NULL && (NULL != (ptr = state->text_p_stack->data))
 	    && ptr->gstr != NULL)
 		oo_warning (xin, _("Gnumeric's sheet object lines do not support attached text. "
 				   "The text \"%s\" has been dropped."), ptr->gstr->str);
@@ -7718,7 +7718,7 @@ oo_chart_title (GsfXMLIn *xin, xmlChar const **attrs)
 		else if (gsf_xml_in_namecmp (xin, CXML2C (attrs[0]),
 					     OO_GNUM_NS_EXT, "anchor"))
 			state->chart.title_anchor = g_strdup (CXML2C (attrs[1]));
-		else if (oo_attr_bool (xin, attrs, OO_GNUM_NS_EXT, "is-position-manual", 
+		else if (oo_attr_bool (xin, attrs, OO_GNUM_NS_EXT, "is-position-manual",
 				       &state->chart.title_manual_pos))
 			;
 		else if (gsf_xml_in_namecmp (xin, CXML2C (attrs[0]), OO_NS_SVG, "x"))
@@ -7730,7 +7730,7 @@ oo_chart_title (GsfXMLIn *xin, xmlChar const **attrs)
 	if (!(go_finite (state->chart.title_x) && go_finite (state->chart.title_y)))
 		state->chart.title_manual_pos = FALSE;
 	if (state->chart.title_position == NULL)
-		state->chart.title_position = g_strdup ((xin->node->user_data.v_int == 2) ? "bottom" : "top"); 
+		state->chart.title_position = g_strdup ((xin->node->user_data.v_int == 2) ? "bottom" : "top");
 
 	odf_push_text_p (state, FALSE);
 }
@@ -7745,15 +7745,15 @@ oo_chart_title_end (GsfXMLIn *xin, G_GNUC_UNUSED GsfXMLBlob *blob)
 	g_return_if_fail (state->text_p_stack != NULL);
 	ptr = state->text_p_stack->data;
 	g_return_if_fail (ptr != NULL);
-	
+
 	if (state->chart.title_expr == NULL && ptr->gstr) {
 			state->chart.title_expr = gnm_expr_top_new_constant
-				(value_new_string_nocopy 
+				(value_new_string_nocopy
 				 (go_pango_attrs_to_markup (ptr->attrs, ptr->gstr->str)));
-			use_markup = (ptr->attrs != NULL && 
+			use_markup = (ptr->attrs != NULL &&
 				      !go_pango_attr_list_is_empty (ptr->attrs));
 	}
-		
+
 	if (state->chart.title_expr) {
 		GOData *data = gnm_go_data_scalar_new_expr
 			(state->chart.src_sheet, state->chart.title_expr);
@@ -7773,7 +7773,7 @@ oo_chart_title_end (GsfXMLIn *xin, G_GNUC_UNUSED GsfXMLBlob *blob)
 		} else {
 			obj = (GogObject *)state->chart.chart;
 			tag = "Title";
-		} 
+		}
 
 		label = gog_object_add_by_name (obj, tag, NULL);
 		gog_dataset_set_dim (GOG_DATASET (label), 0, data, NULL);
@@ -7808,7 +7808,7 @@ oo_chart_title_end (GsfXMLIn *xin, G_GNUC_UNUSED GsfXMLBlob *blob)
 				alloc.w = 0;
 				alloc.y = state->chart.title_y / state->chart.height;
 				alloc.h = 0;
-				
+
 				gog_object_set_position_flags (label, GOG_POSITION_MANUAL, GOG_POSITION_ANY_MANUAL);
 				gog_object_set_manual_position (label, &alloc);
 			} else {
@@ -7818,7 +7818,7 @@ oo_chart_title_end (GsfXMLIn *xin, G_GNUC_UNUSED GsfXMLBlob *blob)
 				oo_warning (xin, _("Unable to determine manual position for a chart component!"));
 			}
 		}
-			
+
 	}
 	g_free (state->chart.title_position);
 	state->chart.title_position = NULL;
@@ -7916,7 +7916,7 @@ oo_chart_axis (GsfXMLIn *xin, xmlChar const **attrs)
 				gboolean has_prop = FALSE;
 				oo_prop_list_has (style->other_props, &has_prop, "ignore-axis-data-style");
 				if (!has_prop)
-					gog_axis_set_format (GOG_AXIS (state->chart.axis), 
+					gog_axis_set_format (GOG_AXIS (state->chart.axis),
 							     go_format_ref (style->fmt));
 			}
 		}
@@ -8826,18 +8826,18 @@ oo_chart_grid (GsfXMLIn *xin, xmlChar const **attrs)
 				grid = gog_object_add_by_name (state->chart.axis, "MinorGrid", NULL);
 		} else if (gsf_xml_in_namecmp (xin, CXML2C (attrs[0]), OO_NS_CHART, "style-name"))
 			style_name = CXML2C (attrs[1]);
-	
+
 	if (grid != NULL && style_name != NULL) {
 		GOStyle *style = NULL;
 		g_object_get (G_OBJECT (grid), "style", &style, NULL);
-		
+
 		if (style) {
 			OOChartStyle *chart_style = g_hash_table_lookup
 				(state->chart.graph_styles, style_name);
 			odf_apply_style_props (xin, chart_style->style_props, style);
 			g_object_unref (style);
 		}
-	}	
+	}
 }
 
 static void
@@ -9074,8 +9074,8 @@ odf_line (GsfXMLIn *xin, xmlChar const **attrs)
 		height = y1 - y2;
 	}
 
-	odf_draw_frame_store_location (state, frame_offset, 
-				       height, width);	
+	odf_draw_frame_store_location (state, frame_offset,
+				       height, width);
 
 	col = sheet_col_get_info (state->pos.sheet, cell_base.start.col);
 	row = sheet_row_get_info (state->pos.sheet, cell_base.start.row);
@@ -10202,11 +10202,11 @@ static GsfXMLInNode const opendoc_content_dtd [] =
 	      GSF_XML_IN_NODE (TABLE, TABLE_SHAPES, OO_NS_TABLE, "shapes", GSF_XML_NO_CONTENT, NULL, NULL),
 		  GSF_XML_IN_NODE (TABLE_SHAPES, DRAW_FRAME, OO_NS_DRAW, "frame", GSF_XML_NO_CONTENT, &od_draw_frame_start, &od_draw_frame_end),
 	          GSF_XML_IN_NODE (TABLE_SHAPES, DRAW_ELLIPSE, OO_NS_DRAW, "ellipse", GSF_XML_NO_CONTENT, &odf_ellipse, &od_draw_text_frame_end),
-	            GSF_XML_IN_NODE (DRAW_ELLIPSE, TEXT_CONTENT, OO_NS_TEXT, "p", GSF_XML_NO_CONTENT, NULL, NULL), /* 2nd def */ 
+	            GSF_XML_IN_NODE (DRAW_ELLIPSE, TEXT_CONTENT, OO_NS_TEXT, "p", GSF_XML_NO_CONTENT, NULL, NULL), /* 2nd def */
 	          GSF_XML_IN_NODE (TABLE_SHAPES, DRAW_LINE, OO_NS_DRAW, "line", GSF_XML_NO_CONTENT, &odf_line, &odf_line_end),
                     GSF_XML_IN_NODE (DRAW_LINE, TEXT_CONTENT, OO_NS_TEXT, "p", GSF_XML_NO_CONTENT, NULL, NULL), /* 2nd def */
 	          GSF_XML_IN_NODE (TABLE_SHAPES, DRAW_RECT, OO_NS_DRAW, "rect", GSF_XML_NO_CONTENT, &odf_rect, &od_draw_text_frame_end),
-	            GSF_XML_IN_NODE (DRAW_RECT, TEXT_CONTENT, OO_NS_TEXT, "p", GSF_XML_NO_CONTENT, NULL, NULL), /* 2nd def */                  
+	            GSF_XML_IN_NODE (DRAW_RECT, TEXT_CONTENT, OO_NS_TEXT, "p", GSF_XML_NO_CONTENT, NULL, NULL), /* 2nd def */
 	      GSF_XML_IN_NODE (TABLE, FORMS, OO_NS_OFFICE, "forms", GSF_XML_NO_CONTENT, NULL, NULL),
 	        GSF_XML_IN_NODE (FORMS, FORM, OO_NS_FORM, "form", GSF_XML_NO_CONTENT, NULL, NULL),
 	          GSF_XML_IN_NODE (FORM, FORM_PROPERTIES, OO_NS_FORM, "properties", GSF_XML_NO_CONTENT, NULL, NULL),
diff --git a/plugins/openoffice/openoffice-write.c b/plugins/openoffice/openoffice-write.c
index 7f6fbee..cd85918 100644
--- a/plugins/openoffice/openoffice-write.c
+++ b/plugins/openoffice/openoffice-write.c
@@ -1131,8 +1131,8 @@ odf_write_style_cell_properties (GnmOOExport *state, GnmStyle const *style)
 /* Background Color */
 	if (gnm_style_is_element_set (style, MSTYLE_COLOR_BACK))
 		gnm_xml_out_add_hex_color (state->xml, FOSTYLE "background-color",
-					   gnm_style_get_back_color (style), 
-					   gnm_style_is_element_set (style, MSTYLE_PATTERN) ? 
+					   gnm_style_get_back_color (style),
+					   gnm_style_is_element_set (style, MSTYLE_PATTERN) ?
 					   gnm_style_get_pattern (style) : 1);
 /* Borders */
 	BORDERSTYLE(MSTYLE_BORDER_TOP,FOSTYLE "border-top", STYLE "border-line-width-top", GNMSTYLE "border-line-style-top");
@@ -1569,35 +1569,35 @@ odf_save_style_map (GnmOOExport *state, GnmStyleCond const *cond, GnmRange *r)
 		odf_determine_base (state, r, &pp);
 		g_string_append (str, "of:is-true-formula(NOT(ISERROR(FIND(");
 		odf_save_style_map_single_f (state, str, gnm_style_cond_get_expr (cond, 0), &pp);
-		g_string_append_printf (str, ";[.%s%s]))))", 
+		g_string_append_printf (str, ";[.%s%s]))))",
 					col_name (pp.eval.col), row_name (pp.eval.row));
 		break;
 	case GNM_STYLE_COND_NOT_CONTAINS_STR:
 		odf_determine_base (state, r, &pp);
 		g_string_append (str, "of:is-true-formula(ISERROR(FIND(");
 		odf_save_style_map_single_f (state, str, gnm_style_cond_get_expr (cond, 0), &pp);
-		g_string_append_printf (str, ";[.%s%s])))", 
+		g_string_append_printf (str, ";[.%s%s])))",
 					col_name (pp.eval.col), row_name (pp.eval.row));
 		break;
 	case GNM_STYLE_COND_BEGINS_WITH_STR:
 		odf_determine_base (state, r, &pp);
 		g_string_append (str, "of:is-true-formula(IFERROR(FIND(");
 		odf_save_style_map_single_f (state, str, gnm_style_cond_get_expr (cond, 0), &pp);
-		g_string_append_printf (str, ";[.%s%s]);2)=1)", 
+		g_string_append_printf (str, ";[.%s%s]);2)=1)",
 					col_name (pp.eval.col), row_name (pp.eval.row));
 		break;
 	case GNM_STYLE_COND_NOT_BEGINS_WITH_STR:
 		odf_determine_base (state, r, &pp);
 		g_string_append (str, "of:is-true-formula(NOT(IFERROR(FIND(");
 		odf_save_style_map_single_f (state, str, gnm_style_cond_get_expr (cond, 0), &pp);
-		g_string_append_printf (str, ";[.%s%s]);2)=1))", 
+		g_string_append_printf (str, ";[.%s%s]);2)=1))",
 					col_name (pp.eval.col), row_name (pp.eval.row));
 		break;
 	case GNM_STYLE_COND_ENDS_WITH_STR:
 		odf_determine_base (state, r, &pp);
 		g_string_append (str, "of:is-true-formula(EXACT(");
 		odf_save_style_map_single_f (state, str, gnm_style_cond_get_expr (cond, 0), &pp);
-		g_string_append_printf (str, ";RIGHT([.%s%s];LEN(", 
+		g_string_append_printf (str, ";RIGHT([.%s%s];LEN(",
 					col_name (pp.eval.col), row_name (pp.eval.row));
 		odf_save_style_map_single_f (state, str, gnm_style_cond_get_expr (cond, 0), &pp);
 		g_string_append (str, ")))");
@@ -1606,7 +1606,7 @@ odf_save_style_map (GnmOOExport *state, GnmStyleCond const *cond, GnmRange *r)
 		odf_determine_base (state, r, &pp);
 		g_string_append (str, "of:is-true-formula(NOT(EXACT(");
 		odf_save_style_map_single_f (state, str, gnm_style_cond_get_expr (cond, 0), &pp);
-		g_string_append_printf (str, ";RIGHT([.%s%s];LEN(", 
+		g_string_append_printf (str, ";RIGHT([.%s%s];LEN(",
 					col_name (pp.eval.col), row_name (pp.eval.row));
 		odf_save_style_map_single_f (state, str, gnm_style_cond_get_expr (cond, 0), &pp);
 		g_string_append (str, "))))");
@@ -1791,7 +1791,7 @@ odf_store_this_named_style (GnmStyle *style, char const *name, GnmRange *r, GnmO
 		real_name = g_strdup (name);
 
 	g_hash_table_insert (state->named_cell_styles, style, real_name);
-	g_hash_table_insert (state->named_cell_style_regions, gnm_style_region_new (r, style), 
+	g_hash_table_insert (state->named_cell_style_regions, gnm_style_region_new (r, style),
 			     g_strdup (real_name));
 
 	if (gnm_style_is_element_set (style, MSTYLE_CONDITIONS) &&
@@ -2786,7 +2786,7 @@ odf_write_comment (GnmOOExport *state, GnmComment const *cc)
 		g_free (text);
 		if (markup != NULL)
 			pango_attr_list_unref (markup);
-		
+
 	}
 	g_object_set (G_OBJECT (state->xml), "pretty-print", pp, NULL);
 	gsf_xml_out_end_element (state->xml); /*  OFFICE "annotation" */
@@ -2963,7 +2963,7 @@ odf_write_so_filled (GnmOOExport *state, SheetObject *so)
 	odf_new_markup (state, markup, text);
 	gsf_xml_out_end_element (state->xml);   /* p */
 	g_object_set (G_OBJECT (state->xml), "pretty-print", pp, NULL);
-	
+
 	g_free (text);
 	if (markup)
 		pango_attr_list_unref (markup);
@@ -3562,7 +3562,7 @@ odf_write_content_rows (GnmOOExport *state, Sheet const *sheet, int from, int to
 
 			objects = odf_sheet_objects_get (sheet, &pos);
 
-			if ((!(current_cell && gnm_cell_has_expr(current_cell))) && 
+			if ((!(current_cell && gnm_cell_has_expr(current_cell))) &&
 			    (merge_range == NULL) && (objects == NULL) &&
 			    gnm_cell_is_empty (current_cell) &&
 			    NULL == gnm_style_get_hlink
@@ -4417,7 +4417,7 @@ odf_print_spreadsheet_content_validations (GnmOOExport *state)
 			gsf_xml_out_add_cstr_unchecked (state->xml, TABLE "message-type", message_type);
 			if (val->title != NULL)
 				gsf_xml_out_add_cstr (state->xml, TABLE "title", val->title->str);
-				
+
 			if (val->msg != NULL && go_string_get_len (val->msg) > 0) {
 				gboolean white_written = TRUE;
 				gboolean pp = TRUE;
@@ -5144,7 +5144,7 @@ odf_write_office_styles (GnmOOExport *state)
 	if (state->default_style_region->style != NULL) {
 		gsf_xml_out_start_element (state->xml, STYLE "default-style");
 		gsf_xml_out_add_cstr_unchecked (state->xml, STYLE "family", "table-cell");
-		odf_write_style (state, state->default_style_region->style, 
+		odf_write_style (state, state->default_style_region->style,
 				 &state->default_style_region->range, TRUE);
 		gsf_xml_out_end_element (state->xml); /* </style:default-style */
 	}
@@ -6469,12 +6469,12 @@ odf_write_axis_style (GnmOOExport *state, G_GNUC_UNUSED GOStyle const *style,
 		odf_add_bool (state->xml, CHART "logarithmic",
 			      0 != strcmp (type, "Linear"));
 	}
-	
-	tmp = gog_axis_get_entry 
+
+	tmp = gog_axis_get_entry
 		(GOG_AXIS (axis), GOG_AXIS_ELEM_MIN, &user_defined);
 	if (user_defined)
 		gsf_xml_out_add_float (state->xml, CHART "minimum", tmp, -1);
-	tmp = gog_axis_get_entry 
+	tmp = gog_axis_get_entry
 		(GOG_AXIS (axis), GOG_AXIS_ELEM_MAX, &user_defined);
 	if (user_defined)
 		gsf_xml_out_add_float (state->xml, CHART "maximum", tmp, -1);
@@ -6647,7 +6647,7 @@ odf_write_title (GnmOOExport *state, GogObject const *title,
 {
 	if (title != NULL && id != NULL) {
 		GOData const *dat = gog_dataset_get_dim (GOG_DATASET(title),0);
-		
+
 		if (dat != NULL) {
 			GnmExprTop const *texpr = gnm_go_data_get_expr (dat);
 			if (texpr != NULL) {
@@ -6658,7 +6658,7 @@ odf_write_title (GnmOOExport *state, GogObject const *title,
 				g_object_get (G_OBJECT (state->xml), "pretty-print", &pp, NULL);
 
 				gsf_xml_out_start_element (state->xml, id);
-				
+
 				if (state->with_extension) {
 					if (position == NULL)
 						g_object_get (G_OBJECT (title),
@@ -6699,11 +6699,11 @@ odf_write_title (GnmOOExport *state, GogObject const *title,
 					g_object_set (G_OBJECT (state->xml), "pretty-print", FALSE, NULL);
 					gsf_xml_out_start_element (state->xml, TEXT "p");
 					str = value_peek_string (texpr->expr->constant.value);
-					if (GOG_IS_TEXT (title) && 
+					if (GOG_IS_TEXT (title) &&
 					    (text = GOG_TEXT (title))->allow_markup) {
 						PangoAttrList *attr_list = NULL;
 						char *text_clean = NULL;
-						if (pango_parse_markup (str, -1, 0, 
+						if (pango_parse_markup (str, -1, 0,
 									&attr_list,
 									&text_clean, NULL, NULL)) {
 							odf_new_markup (state, attr_list, text_clean);
@@ -7020,7 +7020,7 @@ odf_write_gog_style_chart (GnmOOExport *state, GOStyle const *style, GogObject c
 		GOFormat *fmt = gog_axis_get_format (GOG_AXIS (obj));
 		odf_add_bool (state->xml, CHART "link-data-style-to-source", fmt == NULL);
 	}
-	
+
 
 	func = g_hash_table_lookup (state->chart_props_hash, type);
 	if (func != NULL)
@@ -7226,7 +7226,7 @@ odf_write_generic_axis (GnmOOExport *state,
 }
 
 static void
-odf_write_plot (GnmOOExport *state, SheetObject *so, GogObject const *graph, 
+odf_write_plot (GnmOOExport *state, SheetObject *so, GogObject const *graph,
 		GogObject const *chart, GogObject const *plot)
 {
 	char const *plot_type = G_OBJECT_TYPE_NAME (plot);
@@ -7449,7 +7449,7 @@ odf_write_plot (GnmOOExport *state, SheetObject *so, GogObject const *graph,
 		      "compass", &position,
 		      NULL);
 		is_footer = NULL != g_strstr_len (position, -1, "bottom");
-		odf_write_title (state, title, 
+		odf_write_title (state, title,
 				 is_footer ? CHART "footer" : CHART "subtitle",
 				 TRUE, position);
 		g_slist_free (subtitles);
@@ -7617,7 +7617,7 @@ odf_write_graph_content (GnmOOExport *state, GsfOutput *child, SheetObject *so)
 	graph = sheet_object_graph_get_gog (so);
 	if (graph != NULL) {
 		double pos[4];
-		GogRenderer *renderer;	
+		GogRenderer *renderer;
 		GogObjectRole const *role =
 			gog_object_find_role_by_name (GOG_OBJECT (graph), "Chart");
 
@@ -7627,7 +7627,7 @@ odf_write_graph_content (GnmOOExport *state, GsfOutput *child, SheetObject *so)
 					  NULL);
 		gog_renderer_update (renderer, pos[2] - pos[0], pos[3] - pos[1]);
 		g_object_get (G_OBJECT (renderer), "view", &state->root_view, NULL);
-	
+
 		if (role != NULL) {
 			GSList *charts = gog_object_get_children
 				(GOG_OBJECT (graph), role);
@@ -7639,7 +7639,7 @@ odf_write_graph_content (GnmOOExport *state, GsfOutput *child, SheetObject *so)
 					GSList *plots = gog_object_get_children
 						(chart, gog_object_find_role_by_name (chart, "Plot"));
 					if (plots != NULL && plots->data != NULL) {
-						odf_write_plot (state, so, GOG_OBJECT (graph), 
+						odf_write_plot (state, so, GOG_OBJECT (graph),
 								chart, plots->data);
 						plot_written = TRUE;
 					}
@@ -8042,7 +8042,7 @@ openoffice_file_save_real (G_GNUC_UNUSED  GOFileSaver const *fs, GOIOContext *io
 	state.named_cell_styles = g_hash_table_new_full (g_direct_hash, g_direct_equal,
 						   NULL, (GDestroyNotify) g_free);
 	state.named_cell_style_regions = g_hash_table_new_full (g_direct_hash, g_direct_equal,
-								(GDestroyNotify) gnm_style_region_free, 
+								(GDestroyNotify) gnm_style_region_free,
 								(GDestroyNotify) g_free);
 	state.cell_styles = g_hash_table_new_full (g_direct_hash, g_direct_equal,
 						   NULL, (GDestroyNotify) g_free);
@@ -8105,8 +8105,8 @@ openoffice_file_save_real (G_GNUC_UNUSED  GOFileSaver const *fs, GOIOContext *io
 		GnmRange r = {{0,0},{0,0}};
 		/* We need to make sure any referenced styles are added to the named hash */
 		state.default_style_region = gnm_style_region_new (&r, style);
-		odf_store_this_named_style (state.default_style_region->style, "Gnumeric-default", 
-					    &state.default_style_region->range, 
+		odf_store_this_named_style (state.default_style_region->style, "Gnumeric-default",
+					    &state.default_style_region->range,
 					    &state);
 		gnm_style_unref (style);
 	} else {
diff --git a/src/application.c b/src/application.c
index 138be1b..fab6875 100644
--- a/src/application.c
+++ b/src/application.c
@@ -444,7 +444,7 @@ gnm_app_workbook_foreach (GnmWbIterFunc cback, gpointer data)
 /**
  * gnm_app_workbook_get_by_index:
  * @i: index
- * 
+ *
  * Get nth workbook.  Index is zero-based.
  * Return value: (transfer none): the nth workbook if any.
  */
diff --git a/src/cell.c b/src/cell.c
index 7742e2f..ed4b277 100644
--- a/src/cell.c
+++ b/src/cell.c
@@ -735,32 +735,32 @@ guess_time_format (const char *prefix, gnm_float f)
  */
 
 char *
-gnm_cell_get_text_for_editing (GnmCell const * cell, Sheet *sheet, 
+gnm_cell_get_text_for_editing (GnmCell const * cell, Sheet *sheet,
 			       gboolean *quoted, int *cursor_pos)
 {
 	GODateConventions const *date_conv;
 	gchar *text = NULL;
-	
+
 	g_return_val_if_fail (cell != NULL, NULL);
 	g_return_val_if_fail (sheet != NULL, NULL);
 
 	if (quoted)
 		*quoted = FALSE;
-	
+
 	date_conv = workbook_date_conv (sheet->workbook);
 
 	if (!gnm_cell_is_array (cell) &&
 	    !gnm_cell_has_expr (cell) && VALUE_IS_FLOAT (cell->value)) {
 		GOFormat const *fmt = gnm_cell_get_format (cell);
 		gnm_float f = value_get_as_float (cell->value);
-		
+
 		switch (go_format_get_family (fmt)) {
 		case GO_FORMAT_FRACTION:
 			text = gnm_cell_get_entered_text (cell);
 			g_strchug (text);
 			g_strchomp (text);
 			break;
-			
+
 		case GO_FORMAT_PERCENTAGE: {
 			GString *new_str = g_string_new (NULL);
 			gnm_render_general (NULL, new_str, go_format_measure_zero,
@@ -772,7 +772,7 @@ gnm_cell_get_text_for_editing (GnmCell const * cell, Sheet *sheet,
 			text = g_string_free (new_str, FALSE);
 			break;
 		}
-			
+
 		case GO_FORMAT_NUMBER:
 		case GO_FORMAT_SCIENTIFIC:
 		case GO_FORMAT_CURRENCY:
@@ -784,23 +784,23 @@ gnm_cell_get_text_for_editing (GnmCell const * cell, Sheet *sheet,
 			text = g_string_free (new_str, FALSE);
 			break;
 		}
-			
+
 		case GO_FORMAT_DATE: {
 			GOFormat *new_fmt;
-			
+
 			new_fmt = gnm_format_for_date_editing (cell);
-			
+
 			if (!close_to_int (f, 1e-6 / (24 * 60 * 60))) {
 				GString *fstr = g_string_new (go_format_as_XL (new_fmt));
 				go_format_unref (new_fmt);
-				
+
 				g_string_append_c (fstr, ' ');
 				new_fmt = guess_time_format
 					(fstr->str,
 					 f - gnm_floor (f));
 				g_string_free (fstr, TRUE);
 			}
-			
+
 			text = format_value (new_fmt, cell->value,
 					     -1, date_conv);
 			if (!text || text[0] == 0) {
@@ -813,27 +813,27 @@ gnm_cell_get_text_for_editing (GnmCell const * cell, Sheet *sheet,
 			go_format_unref (new_fmt);
 			break;
 		}
-			
+
 		case GO_FORMAT_TIME: {
 			GOFormat *new_fmt = guess_time_format (NULL, f);
-			
+
 			text = format_value (new_fmt, cell->value, -1,
 					     date_conv);
 			go_format_unref (new_fmt);
 			break;
 		}
-			
+
 		default:
 			break;
 		}
 	}
-	
+
 	if (!text) {
 		text = gnm_cell_get_entered_text (cell);
 		if (quoted)
 			*quoted = (text[0] == '\'');
 	}
-	
+
 	return text;
 }
 
diff --git a/src/cell.h b/src/cell.h
index f998cb9..e391c90 100644
--- a/src/cell.h
+++ b/src/cell.h
@@ -91,7 +91,7 @@ int	gnm_cell_rendered_width		(GnmCell const * cell);	/* excludes offset */
 int	gnm_cell_rendered_offset	(GnmCell const * cell);
 GOColor gnm_cell_get_render_color	(GnmCell const * cell);
 char *	gnm_cell_get_entered_text	(GnmCell const * cell);
-char *	gnm_cell_get_text_for_editing	(GnmCell const * cell, Sheet *sheet, 
+char *	gnm_cell_get_text_for_editing	(GnmCell const * cell, Sheet *sheet,
 					 gboolean *quoted, int *cursor_pos);
 char *  gnm_cell_get_rendered_text	(GnmCell *cell);
 
diff --git a/src/dialogs/dialog-analysis-tool-wilcoxon-mann-whitney.c b/src/dialogs/dialog-analysis-tool-wilcoxon-mann-whitney.c
index 669382a..8e91bca 100644
--- a/src/dialogs/dialog-analysis-tool-wilcoxon-mann-whitney.c
+++ b/src/dialogs/dialog-analysis-tool-wilcoxon-mann-whitney.c
@@ -91,7 +91,7 @@ wilcoxon_mann_whitney_tool_update_sensitivity_cb (G_GNUC_UNUSED GtkWidget *dummy
 		gtk_label_set_text (GTK_LABEL (state->warning),
 				    _("The input range for variable 2 is invalid."));
 		gtk_widget_set_sensitive (state->ok_button, FALSE);
-		return;		
+		return;
 	}
 
 	/* Checking Output Page */
diff --git a/src/dialogs/dialog-consolidate.c b/src/dialogs/dialog-consolidate.c
index f8862a1..722b43d 100644
--- a/src/dialogs/dialog-consolidate.c
+++ b/src/dialogs/dialog-consolidate.c
@@ -108,7 +108,7 @@ adjust_source_areas (ConsolidateState *state)
 		} while (gtk_tree_model_iter_next
 			 (state->source_areas,&iter));
 	}
-		
+
 	for (i = 0; i < cnt_empty; i++) {
 		gtk_list_store_append (GTK_LIST_STORE(state->source_areas),
 				       &iter);
diff --git a/src/dialogs/dialog-doc-metadata.c b/src/dialogs/dialog-doc-metadata.c
index 5936a88..2a5d1c5 100644
--- a/src/dialogs/dialog-doc-metadata.c
+++ b/src/dialogs/dialog-doc-metadata.c
@@ -266,7 +266,7 @@ dialog_doc_metadata_get_value_type (GValue *value)
 			else if (VAL_IS_GSF_DOCPROP_VECTOR (value))
 				val_type = GSF_DOCPROP_VECTOR_TYPE;
 			else {
-				g_printerr ("GType %s (%i) not handled in metadata dialog.\n", 
+				g_printerr ("GType %s (%i) not handled in metadata dialog.\n",
 					    g_type_name (val_type), (int) val_type);
 				val_type = G_TYPE_INVALID;
 			}
@@ -858,7 +858,7 @@ dialog_doc_metadata_set_gsf_prop_val (DialogDocMetaData *state,
 			g_value_transform (&string_value, prop_value);
 			g_value_unset (&string_value);
 		} else
-			g_printerr (_("Transform function of G_TYPE_STRING to %s is required!\n"), 
+			g_printerr (_("Transform function of G_TYPE_STRING to %s is required!\n"),
 				    g_type_name (t));
 		break;
 	}
@@ -1622,7 +1622,7 @@ cb_dialog_doc_metadata_tree_prop_selected (GtkTreeSelection  *selection,
 			break;
 		default:
 			if (val_type == GSF_DOCPROP_VECTOR_TYPE) {
-				if (0 == strcmp (prop_name, "dc:keywords")) 
+				if (0 == strcmp (prop_name, "dc:keywords"))
 					text = _("To edit, use the keywords tab.");
 				else
 					text = _("This property value cannot be edited.");
diff --git a/src/expr.c b/src/expr.c
index b238249..9cd0076 100644
--- a/src/expr.c
+++ b/src/expr.c
@@ -1580,7 +1580,7 @@ gnm_expr_simplify_if (GnmExpr const *expr)
 	if (expr->func.func != f_if || expr->func.argc != 3)
 		return NULL;
 
-	cond = expr->func.argv[0];	
+	cond = expr->func.argv[0];
 	if (GNM_EXPR_GET_OPER (cond) == GNM_EXPR_OP_CONSTANT) {
 		GnmValue const *condval = cond->constant.value;
 		gboolean err;
@@ -1730,12 +1730,12 @@ do_expr_as_string (GnmExpr const *expr, int paren_level,
 			return;
 		}
 
-		if (v->type == VALUE_BOOLEAN && 
+		if (v->type == VALUE_BOOLEAN &&
 		    out->convs->output.boolean != NULL) {
 			out->convs->output.boolean (out, v->v_bool.val);
 			return;
 		}
-		
+
 
 		value_get_as_gstring (v, target, out->convs);
 
diff --git a/src/format-template.h b/src/format-template.h
index 31acad7..33ae100 100644
--- a/src/format-template.h
+++ b/src/format-template.h
@@ -89,7 +89,7 @@ struct _GnmFormatTemplate {
 	gboolean font;
 	gboolean patterns;
 	gboolean alignment;
-	
+
 	struct _FormatEdges {
 		gboolean left;
 		gboolean right;
diff --git a/src/rangefunc.c b/src/rangefunc.c
index 9ee2c5b..4d7e708 100644
--- a/src/rangefunc.c
+++ b/src/rangefunc.c
@@ -449,8 +449,8 @@ gnm_range_mode (gnm_float const *xs, int n, gnm_float *res)
 	return 0;
 }
 
-int 
-gnm_range_adtest    (gnm_float const *xs, int n, gnm_float *pvalue, 
+int
+gnm_range_adtest    (gnm_float const *xs, int n, gnm_float *pvalue,
 		     gnm_float *statistics)
 {
 	gnm_float mu = 0.;
@@ -468,8 +468,8 @@ gnm_range_adtest    (gnm_float const *xs, int n, gnm_float *pvalue,
 		ys = range_sort (xs, n);
 
 		for (i = 0; i < n; i++) {
-			gnm_float val = (pnorm (ys[i], mu, sigma, TRUE, TRUE) + 
-					 pnorm (ys[n - i - 1], 
+			gnm_float val = (pnorm (ys[i], mu, sigma, TRUE, TRUE) +
+					 pnorm (ys[n - i - 1],
 						mu, sigma, FALSE, TRUE));
 			total += ((2*i+1)* val);
 		}
diff --git a/src/rangefunc.h b/src/rangefunc.h
index 772a1bf..d2cc3db 100644
--- a/src/rangefunc.h
+++ b/src/rangefunc.h
@@ -60,7 +60,7 @@ int gnm_range_rsq_pop	(gnm_float const *xs, const gnm_float *ys, int n, gnm_floa
 
 int gnm_range_mode	(gnm_float const *xs, int n, gnm_float *res);
 
-int gnm_range_adtest    (gnm_float const *xs, int n, gnm_float *p, 
+int gnm_range_adtest    (gnm_float const *xs, int n, gnm_float *p,
 			 gnm_float *statistics);
 
 G_END_DECLS
diff --git a/src/sheet-filter.c b/src/sheet-filter.c
index 85079e0..9eaa6fe 100644
--- a/src/sheet-filter.c
+++ b/src/sheet-filter.c
@@ -885,7 +885,7 @@ gnm_sheet_filter_intersect_rows (Sheet const *sheet, int from, int to)
 }
 
 GnmRange *
-gnm_sheet_filter_can_be_extended (G_GNUC_UNUSED Sheet const *sheet, 
+gnm_sheet_filter_can_be_extended (G_GNUC_UNUSED Sheet const *sheet,
 				  GnmFilter const *f, GnmRange const *r)
 {
 	if (r->start.row < f->r.start.row || r->end.row > f->r.end.row)
@@ -915,7 +915,7 @@ cb_remove_col_undo_free (struct cb_remove_col_undo *r)
 }
 
 static void
-cb_remove_col_undo (GnmFilter *filter, struct cb_remove_col_undo *r, 
+cb_remove_col_undo (GnmFilter *filter, struct cb_remove_col_undo *r,
 		    G_GNUC_UNUSED gpointer data)
 {
 	while (filter->fields->len <= r->col)
@@ -954,9 +954,9 @@ gnm_filter_set_range (GnmFilter *filter, GnmRange *r)
 	int start = r->start.col;
 
 	filter->r = *r;
-	for (i = start; i < old_r.start.col; i++) 
+	for (i = start; i < old_r.start.col; i++)
 		gnm_filter_add_field (filter, i - start);
-	for (i = old_r.end.col + 1; i <= r->end.col; i++) 
+	for (i = old_r.end.col + 1; i <= r->end.col; i++)
 		gnm_filter_add_field (filter, i - start);
 }
 
@@ -1100,7 +1100,7 @@ gnm_sheet_filter_insdel_colrow (Sheet *sheet,
 					 (GFreeFunc)gnm_filter_unref,
 					 g_free);
 				*pundo = go_undo_combine (*pundo, u);
-			}			
+			}
 			gnm_filter_update_active (filter);
 			gnm_filter_reapply (filter);
 		}
diff --git a/src/sheet-object.c b/src/sheet-object.c
index 33d87bc..859424b 100644
--- a/src/sheet-object.c
+++ b/src/sheet-object.c
@@ -1006,7 +1006,7 @@ sheet_objects_clear (Sheet const *sheet, GnmRange const *r, GType t,
 	for (ptr = sheet->sheet_objects; ptr != NULL ; ptr = next ) {
 		GObject *obj = G_OBJECT (ptr->data);
 		next = ptr->next;
-		if ((t == G_TYPE_NONE && G_OBJECT_TYPE (obj) != GNM_FILTER_COMBO_TYPE) 
+		if ((t == G_TYPE_NONE && G_OBJECT_TYPE (obj) != GNM_FILTER_COMBO_TYPE)
 		    || t == G_OBJECT_TYPE (obj)) {
 			SheetObject *so = SHEET_OBJECT (obj);
 			if (r == NULL || range_contained (&so->anchor.cell_bound, r))
diff --git a/src/sheet-style.c b/src/sheet-style.c
index 91d0777..952c94e 100644
--- a/src/sheet-style.c
+++ b/src/sheet-style.c
@@ -1775,7 +1775,7 @@ typedef struct {
 
 static void
 cb_find_conflicts (GnmStyle *style,
-		   G_GNUC_UNUSED int corner_col, G_GNUC_UNUSED int corner_row, 
+		   G_GNUC_UNUSED int corner_col, G_GNUC_UNUSED int corner_row,
 		   G_GNUC_UNUSED int width, G_GNUC_UNUSED int height,
 		   G_GNUC_UNUSED GnmRange const *apply_to, FindConflicts *ptr)
 {
@@ -2132,7 +2132,7 @@ struct cb_is_default {
 
 static void
 cb_is_default (GnmStyle *style,
-	       int corner_col, G_GNUC_UNUSED int corner_row, 
+	       int corner_col, G_GNUC_UNUSED int corner_row,
 	       int width, G_GNUC_UNUSED int height,
 	       GnmRange const *apply_to, gpointer user_)
 {
@@ -2663,7 +2663,7 @@ style_list_get_style (GnmStyleList const *list, int col, int row)
 
 static void
 cb_find_link (GnmStyle *style,
-	      G_GNUC_UNUSED int corner_col, G_GNUC_UNUSED int corner_row, 
+	      G_GNUC_UNUSED int corner_col, G_GNUC_UNUSED int corner_row,
 	      G_GNUC_UNUSED int width, G_GNUC_UNUSED int height,
 	      G_GNUC_UNUSED GnmRange const *apply_to, gpointer user)
 {
diff --git a/src/ssgrep.c b/src/ssgrep.c
index a972c3c..6bd8af6 100644
--- a/src/ssgrep.c
+++ b/src/ssgrep.c
@@ -521,6 +521,7 @@ main (int argc, char const **argv)
 
 	ioc = go_io_context_new (cc);
 	go_io_context_set_num_files (ioc, N);
+	go_component_set_default_command_context (cc);
 
 	if (ssgrep_print_filenames == (gboolean)2)
 		ssgrep_print_filenames = (N > 1);
@@ -535,6 +536,7 @@ main (int argc, char const **argv)
 
 	g_hash_table_destroy (ssgrep_targets);
 
+	go_component_set_default_command_context (NULL);
 	g_object_unref (ioc);
 
 	g_object_unref (cc);
diff --git a/src/ssindex.c b/src/ssindex.c
index 88a4036..1ac88ae 100644
--- a/src/ssindex.c
+++ b/src/ssindex.c
@@ -279,6 +279,7 @@ main (int argc, char const **argv)
 		/* FIXME: What do we want to do here? */
 		go_error_info_free (plugin_errs);
 	}
+	go_component_set_default_command_context (cc);
 
 	if (ssindex_run_indexer) {
 		GOIOContext *ioc = go_io_context_new (cc);
@@ -301,6 +302,7 @@ main (int argc, char const **argv)
 		}
 	}
 
+	go_component_set_default_command_context (NULL);
 	g_object_unref (cc);
 	gnm_shutdown ();
 	gnm_pre_parse_shutdown ();
diff --git a/src/sstest.c b/src/sstest.c
index a4f57ad..c9b4158 100644
--- a/src/sstest.c
+++ b/src/sstest.c
@@ -646,7 +646,7 @@ test_random_randnorm (int N)
 	char *expr;
 	gnm_float T;
 
-	expr = g_strdup_printf ("=RANDNORM(%.10" GNM_FORMAT_g ",%.10" GNM_FORMAT_g ")", 
+	expr = g_strdup_printf ("=RANDNORM(%.10" GNM_FORMAT_g ",%.10" GNM_FORMAT_g ")",
 				mean_target, var_target);
 	vals = test_random_normality (N, expr, &mean, &var, &adtest, &cvmtest, &lkstest, &sftest);
 	g_free (expr);
diff --git a/src/style-conditions.c b/src/style-conditions.c
index b235c5b..050027d 100644
--- a/src/style-conditions.c
+++ b/src/style-conditions.c
@@ -98,7 +98,7 @@ gnm_style_cond_is_valid (GnmStyleCond const *cond)
 		gboolean need = (ui < N);
 		gboolean have = (cond->deps[ui].texpr != NULL);
 		if (have != need)
-			return FALSE;		    
+			return FALSE;
 	}
 
 	return TRUE;
diff --git a/src/tools/analysis-one-mean-test.c b/src/tools/analysis-one-mean-test.c
index 5e6cc0f..245db27 100644
--- a/src/tools/analysis-one-mean-test.c
+++ b/src/tools/analysis-one-mean-test.c
@@ -110,26 +110,26 @@ analysis_tool_one_mean_test_engine_run (data_analysis_output_t *dao,
 		expr = gnm_expr_new_funcall1 (fd_var, expr_range_clean);
 		dao_set_cell_array_expr (dao, col, 4, expr);
 
-		dao_set_cell_expr (dao, col, 6,  gnm_expr_new_binary 
+		dao_set_cell_expr (dao, col, 6,  gnm_expr_new_binary
 				   (make_cellref (0,-5), GNM_EXPR_OP_SUB, gnm_expr_new_constant (value_new_int (1))));
 
-		expr_stddev = gnm_expr_new_funcall1 
+		expr_stddev = gnm_expr_new_funcall1
 			(fd_sqrt, gnm_expr_new_binary (make_cellref (0,-1), GNM_EXPR_OP_DIV, make_cellref (0,-4)));
-		expr = gnm_expr_new_binary 
+		expr = gnm_expr_new_binary
 			(gnm_expr_new_binary (make_cellref (0,-3), GNM_EXPR_OP_SUB, make_cellref (0,-2)),
 			 GNM_EXPR_OP_DIV,
 			 expr_stddev);
 		dao_set_cell_array_expr (dao, col, 5, expr);
 
 		expr_abs = gnm_expr_new_funcall1 (fd_abs, make_cellref (0,-3));
-		expr = gnm_expr_new_funcall3 (fd_tdist, expr_abs, make_cellref (0,-2), 
+		expr = gnm_expr_new_funcall3 (fd_tdist, expr_abs, make_cellref (0,-2),
 					      gnm_expr_new_constant (value_new_int (1)));
 		dao_set_cell_expr (dao, col, 8, expr);
 
 		expr_abs = gnm_expr_new_funcall1 (fd_abs, make_cellref (0,-4));
-		expr = gnm_expr_new_funcall3 (fd_tdist, expr_abs, make_cellref (0,-3), 
+		expr = gnm_expr_new_funcall3 (fd_tdist, expr_abs, make_cellref (0,-3),
 					      gnm_expr_new_constant (value_new_int (2)));
-		dao_set_cell_expr (dao, col, 9, expr);		
+		dao_set_cell_expr (dao, col, 9, expr);
 	}
 	gnm_func_unref (fd_count);
 	gnm_func_unref (fd_mean);
diff --git a/src/tools/analysis-wilcoxon-mann-whitney.c b/src/tools/analysis-wilcoxon-mann-whitney.c
index 3aee39b..eb5316a 100644
--- a/src/tools/analysis-wilcoxon-mann-whitney.c
+++ b/src/tools/analysis-wilcoxon-mann-whitney.c
@@ -47,7 +47,7 @@ GnmExpr const *analysis_tool_combine_area (GnmValue *val_1, GnmValue *val_2, Wor
 
 		range_init_rangeref (&r_1, &val_1->v_range.cell);
 		range_init_rangeref (&r_2, &val_2->v_range.cell);
-		
+
 		if (r_1.start.row == r_2.start.row &&
 		    range_height (&r_1) == range_height (&r_2)) {
 			if (r_1.end.col == r_2.start.col - 1) {
@@ -56,7 +56,7 @@ GnmExpr const *analysis_tool_combine_area (GnmValue *val_1, GnmValue *val_2, Wor
 			} else if (r_2.end.col == r_1.start.col - 1) {
 				combined = TRUE;
 				r_1.start.col = r_2.start.col;
-			} 
+			}
 		} else if (r_1.start.col == r_2.start.col &&
 			   range_width (&r_1) == range_width (&r_2)) {
 			if (r_1.end.row == r_2.start.row - 1) {
@@ -65,7 +65,7 @@ GnmExpr const *analysis_tool_combine_area (GnmValue *val_1, GnmValue *val_2, Wor
 			} else if (r_2.end.row == r_1.start.row - 1) {
 				combined = TRUE;
 				r_1.start.row = r_2.start.row;
-			} 			
+			}
 		}
 
 		if (combined) {
@@ -73,17 +73,17 @@ GnmExpr const *analysis_tool_combine_area (GnmValue *val_1, GnmValue *val_2, Wor
 			return gnm_expr_new_constant (val);
 		}
 	}
-	
+
 	fd_array = gnm_func_lookup_or_add_placeholder
 		("ARRAY", wb, FALSE);
 	gnm_func_ref (fd_array);
 
-	expr = gnm_expr_new_funcall2 (fd_array, 
+	expr = gnm_expr_new_funcall2 (fd_array,
 				      gnm_expr_new_constant (value_dup (val_1)),
 				      gnm_expr_new_constant (value_dup (val_2)));
 
 	gnm_func_unref (fd_array);
-	
+
 	return expr;
 }
 
@@ -132,7 +132,7 @@ analysis_tool_wilcoxon_mann_whitney_engine_run (data_analysis_output_t *dao,
 	gnm_func_ref (fd_if);
 	fd_isblank = gnm_func_lookup_or_add_placeholder ("ISBLANK", wb, FALSE);
 	gnm_func_ref (fd_isblank);
-	
+
 	dao_set_italic (dao, 0, 0, 0, 8);
 	dao_set_italic (dao, 0, 1, 3, 1);
 	dao_set_merge (dao, 0, 0, 3, 0);
diff --git a/src/tools/gnm-solver.c b/src/tools/gnm-solver.c
index 837299e..b4277b1 100644
--- a/src/tools/gnm-solver.c
+++ b/src/tools/gnm-solver.c
@@ -1327,7 +1327,7 @@ gnm_solver_get_limits (GnmSolver *solver, gnm_float **pmin, gnm_float **pmax)
 
 	vinput = gnm_solver_param_get_input (params);
 	if (!vinput) return;
-		
+
 	gnm_sheet_range_from_value (&sr, vinput);
 	if (!sr.sheet) sr.sheet = params->sheet;
 	h = range_height (&sr.range);
diff --git a/src/wbc-gtk.c b/src/wbc-gtk.c
index da8de99..723581f 100644
--- a/src/wbc-gtk.c
+++ b/src/wbc-gtk.c
@@ -5854,7 +5854,7 @@ wbcg_get_nth_scg (WBCGtk *wbcg, int i)
 Sheet *
 wbcg_focus_cur_scg (WBCGtk *wbcg)
 {
-	SheetControlGUI *scg;	
+	SheetControlGUI *scg;
 
 	g_return_val_if_fail (IS_WBC_GTK (wbcg), NULL);
 
diff --git a/src/widgets/gnumeric-expr-entry.c b/src/widgets/gnumeric-expr-entry.c
index 205ada7..2053bea 100644
--- a/src/widgets/gnumeric-expr-entry.c
+++ b/src/widgets/gnumeric-expr-entry.c
@@ -732,7 +732,7 @@ gee_update_env (GnmExprEntry *gee)
 static gboolean
 gee_delete_tooltip (GnmExprEntry *gee, gboolean remove_completion)
 {
-	gboolean has_tooltip = (gee->tooltip.tooltip != NULL && 
+	gboolean has_tooltip = (gee->tooltip.tooltip != NULL &&
 				gee->tooltip.timerid == 0);
 
 	if (gee->tooltip.timerid) {
@@ -773,7 +773,7 @@ cb_gee_focus_out_event (GtkWidget         *widget,
 			GdkEventFocus     *event,
 			gpointer           user_data);
 
-static gboolean 
+static gboolean
 cb_show_tooltip (gpointer user_data)
 {
 	GnmExprEntry *gee = GNM_EXPR_ENTRY (user_data);
@@ -998,10 +998,10 @@ gee_set_tooltip_completion (GnmExprEntry *gee, GSList *list, guint start, guint
 		if (had_tool_tip)
 			gtk_widget_show_all (gee->tooltip.tooltip);
 		else
-			gee->tooltip.timerid = g_timeout_add_full 
-				(G_PRIORITY_DEFAULT, 750, 
-				 cb_show_tooltip, 
-				 gee, 
+			gee->tooltip.timerid = g_timeout_add_full
+				(G_PRIORITY_DEFAULT, 750,
+				 cb_show_tooltip,
+				 gee,
 				 NULL);
 	}
 	g_string_free (str, TRUE);
diff --git a/src/widgets/widget-editable-label.c b/src/widgets/widget-editable-label.c
index 0ce3840..dbd7cc8 100644
--- a/src/widgets/widget-editable-label.c
+++ b/src/widgets/widget-editable-label.c
@@ -219,7 +219,7 @@ el_get_preferred_width (GtkWidget *w, gint *minimal_width, gint *natural_width)
 	layout = gtk_entry_get_layout (GTK_ENTRY (w));
 	pango_layout_get_extents (layout, NULL, &logical_rect);
 	gtk_style_context_get_padding (ctxt, flags, &border);
-	
+
 	*minimal_width = *natural_width = logical_rect.width / PANGO_SCALE
 					 + border.left + border.right;
 }
@@ -284,7 +284,7 @@ el_draw (GtkWidget *w, cairo_t *cr)
 		pango_cairo_show_layout (cr, layout);
 		return TRUE;
 	}
-	
+
 	return parent_class->draw (w, cr);
 }
 



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