Commit 630d088b authored by Morten Welinder's avatar Morten Welinder Committed by Morten Welinder

Don't crash if we don't get an iter. (cb_motion_notify_event): Handle

2004-12-15  Morten Welinder  <terra@gnome.org>

	* gui-utils/go-action-combo-stack.c (get_key_at_path): Don't crash
	if we don't get an iter.
	(cb_motion_notify_event): Handle empty tree case.
parent 68f96b1d
......@@ -10,6 +10,7 @@ Morten:
* Make it possible to change rotation of formats.
* Draw rotated text.
* Print rotated text.
* Fix torn off undo/redo crash.
--------------------------------------------------------------------------
Gnumeric 1.4.1
......
2004-12-15 Morten Welinder <terra@gnome.org>
* gui-utils/go-action-combo-stack.c (get_key_at_path): Don't crash
if we don't get an iter.
(cb_motion_notify_event): Handle empty tree case.
2004-12-09 Jody Goldberg <jody@gnome.org>
* Release 1.4.1
......
......@@ -96,8 +96,8 @@ get_key_at_path (GtkTreeView *view, GtkTreePath *pos)
gpointer res = NULL;
GtkTreeIter iter;
GtkTreeModel *model = gtk_tree_view_get_model (view);
gtk_tree_model_get_iter (model, &iter, pos);
gtk_tree_model_get (model, &iter, KEY_COL, &res, -1);
if (gtk_tree_model_get_iter (model, &iter, pos))
gtk_tree_model_get (model, &iter, KEY_COL, &res, -1);
return res;
}
......@@ -143,11 +143,13 @@ cb_motion_notify_event (GtkWidget *widget, GdkEventMotion *event,
sel = gtk_tree_view_get_selection (stack->list);
gtk_tree_selection_unselect_all (sel);
if (!gtk_tree_view_get_path_at_pos (stack->list,
event->x, event->y, &pos, NULL, NULL, NULL))
pos = gtk_tree_path_new_from_indices (
gtk_tree_model_iter_n_children (model, NULL) - 1,
-1);
if (!gtk_tree_view_get_path_at_pos
(stack->list, event->x, event->y, &pos, NULL, NULL, NULL)) {
int n = gtk_tree_model_iter_n_children (model, NULL);
if (n == 0)
return TRUE;
pos = gtk_tree_path_new_from_indices (n - 1, -1);
}
stack->last_key = get_key_at_path (stack->list, pos);
start = gtk_tree_path_new_first ();
......
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