From b977d5af8fe25c58120abe4ab5a966fcd53b4d6f Mon Sep 17 00:00:00 2001 From: Kristian Rietveld Date: Mon, 18 Nov 2002 19:33:28 +0000 Subject: modify and free tmp instead of path ... (patch from #97927). Mon Nov 18 20:42:27 2002 Kristian Rietveld * gtk/gtktreeview.c (gtk_tree_view_expand_to_path): modify and free tmp instead of path ... (patch from #97927). Mon Nov 18 20:31:20 2002 Kristian Rietveld * gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_start_editing): only _set_text if celltext->text is not NULL. (#97815, reported and testcase provided by Vitaly Tishkov). Mon Nov 18 20:28:28 2002 Kristian Rietveld * gtk/gtktreeselection.c (gtk_tree_selection_real_modify_range): also update the anchor_path, makes behaviour consistent with the other selection modification functions. (#96801, reported and testcase provided by Vitaly Tishkov). Mon Nov 18 20:17:56 2002 Kristian Rietveld Hrm, this fixes up lots of mistakes in my swap/move code ... Some of these mistakes where pointed out by Vitaly Tishkov in bugs #97403, #97404, #97412, #97618. * gtktreestore.[ch]: gtk_tree_store_move is now private, use gtk_tree_store_move_{before,after} instead now. Lots of fixes (more like a rewrite :) in the _move and _swap functions. * gtkliststore.[ch]: likewise. --- gtk/gtktreeselection.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'gtk/gtktreeselection.c') diff --git a/gtk/gtktreeselection.c b/gtk/gtktreeselection.c index d0239b5891..38d943ebfc 100644 --- a/gtk/gtktreeselection.c +++ b/gtk/gtktreeselection.c @@ -1147,6 +1147,7 @@ gtk_tree_selection_real_modify_range (GtkTreeSelection *selection, { GtkRBNode *start_node, *end_node; GtkRBTree *start_tree, *end_tree; + GtkTreePath *anchor_path; gboolean dirty = FALSE; switch (gtk_tree_path_compare (start_path, end_path)) @@ -1160,6 +1161,7 @@ gtk_tree_selection_real_modify_range (GtkTreeSelection *selection, start_path, &end_tree, &end_node); + anchor_path = end_path; break; case 0: _gtk_tree_view_find_node (selection->tree_view, @@ -1168,6 +1170,7 @@ gtk_tree_selection_real_modify_range (GtkTreeSelection *selection, &start_node); end_tree = start_tree; end_node = start_node; + anchor_path = start_path; break; case -1: _gtk_tree_view_find_node (selection->tree_view, @@ -1178,12 +1181,24 @@ gtk_tree_selection_real_modify_range (GtkTreeSelection *selection, end_path, &end_tree, &end_node); + anchor_path = start_path; break; } g_return_val_if_fail (start_node != NULL, FALSE); g_return_val_if_fail (end_node != NULL, FALSE); + if (anchor_path) + { + if (selection->tree_view->priv->anchor) + gtk_tree_row_reference_free (selection->tree_view->priv->anchor); + + selection->tree_view->priv->anchor = + gtk_tree_row_reference_new_proxy (G_OBJECT (selection->tree_view), + selection->tree_view->priv->model, + anchor_path); + } + do { dirty |= gtk_tree_selection_real_select_node (selection, start_tree, start_node, (mode == RANGE_SELECT)?TRUE:FALSE); -- cgit v1.2.1