generic-poky/openembedded/packages/gtk+/gtk+-2.6.4-1.osso7/gtktreemodelfilter.c.diff

53 lines
1.8 KiB
Diff

--- gtk+-2.6.4/gtk/gtktreemodelfilter.c 2005-02-24 16:43:53.000000000 +0200
+++ gtk+-2.6.4/gtk/gtktreemodelfilter.c 2005-04-06 16:19:38.177734464 +0300
@@ -1210,14 +1210,22 @@
if (gtk_tree_path_get_depth (filter->priv->virtual_root) >=
gtk_tree_path_get_depth (c_path))
{
- gint level;
+ gint level, i;
gint *v_indices, *c_indices;
+ gboolean common_prefix = TRUE;
level = gtk_tree_path_get_depth (c_path) - 1;
v_indices = gtk_tree_path_get_indices (filter->priv->virtual_root);
c_indices = gtk_tree_path_get_indices (c_path);
- if (v_indices[level] >= c_indices[level])
+ for (i = 0; i < level; i++)
+ if (v_indices[i] != c_indices[i])
+ {
+ common_prefix = FALSE;
+ break;
+ }
+
+ if (common_prefix && v_indices[level] >= c_indices[level])
(v_indices[level])++;
}
}
@@ -1455,14 +1463,22 @@
if (gtk_tree_path_get_depth (filter->priv->virtual_root) >=
gtk_tree_path_get_depth (c_path))
{
- gint level;
+ gint level, i;
gint *v_indices, *c_indices;
+ gboolean common_prefix = TRUE;
level = gtk_tree_path_get_depth (c_path) - 1;
v_indices = gtk_tree_path_get_indices (filter->priv->virtual_root);
c_indices = gtk_tree_path_get_indices (c_path);
- if (v_indices[level] > c_indices[level])
+ for (i = 0; i < level; i++)
+ if (v_indices[i] != c_indices[i])
+ {
+ common_prefix = FALSE;
+ break;
+ }
+
+ if (common_prefix && v_indices[level] > c_indices[level])
(v_indices[level])--;
}
}