diff options
author | Sven Neumann <sven@gimp.org> | 2003-03-13 12:24:20 +0000 |
---|---|---|
committer | Sven Neumann <neo@src.gnome.org> | 2003-03-13 12:24:20 +0000 |
commit | 34276445ff6b8554eec95fad0b304cbc858a07bb (patch) | |
tree | 8d61667e5dcb2aa4b188a1a6b4f41397bd4d4456 /gtk/gtkcellrendererpixbuf.c | |
parent | b2698b3a58e9e070085475c2bc862b085ae8facd (diff) | |
download | gtk+-34276445ff6b8554eec95fad0b304cbc858a07bb.tar.gz |
removed redundant calls to g_object_notify().
2003-03-13 Sven Neumann <sven@gimp.org>
* gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_set_property):
removed redundant calls to g_object_notify().
(gtk_cell_renderer_pixbuf_get_size): removed redundant casts, see
bug #108236.
* gtk/gtktextiter.c (_gtk_text_iter_get_segment_char)
(_gtk_text_iter_get_segment_byte): return 0, not NULL (these
functions return an integer value).
Diffstat (limited to 'gtk/gtkcellrendererpixbuf.c')
-rw-r--r-- | gtk/gtkcellrendererpixbuf.c | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/gtk/gtkcellrendererpixbuf.c b/gtk/gtkcellrendererpixbuf.c index 5c4f792cff..fc50718780 100644 --- a/gtk/gtkcellrendererpixbuf.c +++ b/gtk/gtkcellrendererpixbuf.c @@ -279,17 +279,14 @@ gtk_cell_renderer_pixbuf_set_property (GObject *object, if (cellinfo->stock_id) g_free (cellinfo->stock_id); cellinfo->stock_id = g_strdup (g_value_get_string (value)); - g_object_notify (G_OBJECT (object), "stock_id"); break; case PROP_STOCK_SIZE: cellinfo->stock_size = g_value_get_enum (value); - g_object_notify (G_OBJECT (object), "stock_size"); break; case PROP_STOCK_DETAIL: if (cellinfo->stock_detail) g_free (cellinfo->stock_detail); cellinfo->stock_detail = g_strdup (g_value_get_string (value)); - g_object_notify (G_OBJECT (object), "stock_detail"); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec); @@ -348,7 +345,7 @@ gtk_cell_renderer_pixbuf_get_size (GtkCellRenderer *cell, { GtkCellRendererPixbuf *cellpixbuf = (GtkCellRendererPixbuf *) cell; GtkCellRendererPixbufInfo *cellinfo = g_object_get_data (G_OBJECT (cell), CELLINFO_KEY); - gint pixbuf_width = 0; + gint pixbuf_width = 0; gint pixbuf_height = 0; gint calc_width; gint calc_height; @@ -358,22 +355,22 @@ gtk_cell_renderer_pixbuf_get_size (GtkCellRenderer *cell, if (cellpixbuf->pixbuf) { - pixbuf_width = gdk_pixbuf_get_width (cellpixbuf->pixbuf); + pixbuf_width = gdk_pixbuf_get_width (cellpixbuf->pixbuf); pixbuf_height = gdk_pixbuf_get_height (cellpixbuf->pixbuf); } if (cellpixbuf->pixbuf_expander_open) { - pixbuf_width = MAX (pixbuf_width, gdk_pixbuf_get_width (cellpixbuf->pixbuf_expander_open)); + pixbuf_width = MAX (pixbuf_width, gdk_pixbuf_get_width (cellpixbuf->pixbuf_expander_open)); pixbuf_height = MAX (pixbuf_height, gdk_pixbuf_get_height (cellpixbuf->pixbuf_expander_open)); } if (cellpixbuf->pixbuf_expander_closed) { - pixbuf_width = MAX (pixbuf_width, gdk_pixbuf_get_width (cellpixbuf->pixbuf_expander_closed)); + pixbuf_width = MAX (pixbuf_width, gdk_pixbuf_get_width (cellpixbuf->pixbuf_expander_closed)); pixbuf_height = MAX (pixbuf_height, gdk_pixbuf_get_height (cellpixbuf->pixbuf_expander_closed)); } - calc_width = (gint) GTK_CELL_RENDERER (cellpixbuf)->xpad * 2 + pixbuf_width; - calc_height = (gint) GTK_CELL_RENDERER (cellpixbuf)->ypad * 2 + pixbuf_height; + calc_width = (gint) cell->xpad * 2 + pixbuf_width; + calc_height = (gint) cell->ypad * 2 + pixbuf_height; if (x_offset) *x_offset = 0; if (y_offset) *y_offset = 0; @@ -382,14 +379,16 @@ gtk_cell_renderer_pixbuf_get_size (GtkCellRenderer *cell, { if (x_offset) { - *x_offset = ((gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL) ? - (1.0 - GTK_CELL_RENDERER (cellpixbuf)->xalign) : GTK_CELL_RENDERER (cellpixbuf)->xalign) * (cell_area->width - calc_width - (2 * GTK_CELL_RENDERER (cellpixbuf)->xpad)); - *x_offset = MAX (*x_offset, 0) + GTK_CELL_RENDERER (cellpixbuf)->xpad; + *x_offset = (((gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL) ? + 1.0 - cell->xalign : cell->xalign) * + (cell_area->width - calc_width - 2 * cell->xpad)); + *x_offset = MAX (*x_offset, 0) + cell->xpad; } if (y_offset) { - *y_offset = GTK_CELL_RENDERER (cellpixbuf)->yalign * (cell_area->height - calc_height - (2 * GTK_CELL_RENDERER (cellpixbuf)->ypad)); - *y_offset = MAX (*y_offset, 0) + GTK_CELL_RENDERER (cellpixbuf)->ypad; + *y_offset = (cell->yalign * + (cell_area->height - calc_height - 2 * cell->ypad)); + *y_offset = MAX (*y_offset, 0) + cell->ypad; } } @@ -444,7 +443,7 @@ gtk_cell_renderer_pixbuf_render (GtkCellRenderer *cell, pix_rect.x += cell_area->x; pix_rect.y += cell_area->y; - pix_rect.width -= cell->xpad * 2; + pix_rect.width -= cell->xpad * 2; pix_rect.height -= cell->ypad * 2; if (gdk_rectangle_intersect (cell_area, &pix_rect, &draw_rect) && |