summaryrefslogtreecommitdiff
path: root/gtk/gtktreeselection.c
diff options
context:
space:
mode:
authorKristian Rietveld <kris@gtk.org>2002-11-18 19:33:28 +0000
committerKristian Rietveld <kristian@src.gnome.org>2002-11-18 19:33:28 +0000
commitb977d5af8fe25c58120abe4ab5a966fcd53b4d6f (patch)
tree04ec9ff675317ef6bdbc14dc39701670f3f78b58 /gtk/gtktreeselection.c
parentd95f3da34d041fcdc5ad540814c34e22bf50d573 (diff)
downloadgtk+-b977d5af8fe25c58120abe4ab5a966fcd53b4d6f.tar.gz
modify and free tmp instead of path ... (patch from #97927).
Mon Nov 18 20:42:27 2002 Kristian Rietveld <kris@gtk.org> * 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 <kris@gtk.org> * 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 <kris@gtk.org> * 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 <kris@gtk.org> 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.
Diffstat (limited to 'gtk/gtktreeselection.c')
-rw-r--r--gtk/gtktreeselection.c15
1 files changed, 15 insertions, 0 deletions
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);