]> Pileus Git - ~andy/gtk/commitdiff
GtkTreeViewColumn: fix x_offset returned by cell_get_position()
authorMichael Natterer <mitch@gimp.org>
Sun, 25 Sep 2011 15:43:45 +0000 (17:43 +0200)
committerMichael Natterer <mitch@gimp.org>
Sun, 25 Sep 2011 15:45:57 +0000 (17:45 +0200)
Fixes #640741 - gtk_tree_view_column_get_cell_position() seems to be broken

It is supposed to return the offset within the column, but returned
the offset within the tree, changed by allocation.x of the column's
button (which I don't really unserstand and was clearly not working).

gtk/gtktreeviewcolumn.c

index 00c9a892eb506d4676f9e4031aeddef8dd4eaa42..f2a7ca7e38a87e1cbced75e64a44e7bf5c672b93 100644 (file)
@@ -3109,13 +3109,8 @@ gtk_tree_view_column_cell_get_position (GtkTreeViewColumn *tree_column,
                                      &allocation);
 
   if (x_offset)
-    {
-      GdkRectangle button_allocation;
+    *x_offset = allocation.x - cell_area.x;
 
-      /* Retrieve column offset */
-      gtk_widget_get_allocation (priv->button, &button_allocation);
-      *x_offset = allocation.x - button_allocation.x;
-    }
   if (width)
     *width = allocation.width;