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).
This commit is contained in:
Sven Neumann 2003-03-13 12:24:20 +00:00 committed by Sven Neumann
parent b2698b3a58
commit 34276445ff
7 changed files with 71 additions and 17 deletions

View File

@ -1,3 +1,14 @@
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).
2003-03-13 Tor Lillqvist <tml@iki.fi> 2003-03-13 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkevents-win32.c (gdk_event_translate): On * gdk/win32/gdkevents-win32.c (gdk_event_translate): On

View File

@ -1,3 +1,14 @@
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).
2003-03-13 Tor Lillqvist <tml@iki.fi> 2003-03-13 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkevents-win32.c (gdk_event_translate): On * gdk/win32/gdkevents-win32.c (gdk_event_translate): On

View File

@ -1,3 +1,14 @@
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).
2003-03-13 Tor Lillqvist <tml@iki.fi> 2003-03-13 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkevents-win32.c (gdk_event_translate): On * gdk/win32/gdkevents-win32.c (gdk_event_translate): On

View File

@ -1,3 +1,14 @@
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).
2003-03-13 Tor Lillqvist <tml@iki.fi> 2003-03-13 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkevents-win32.c (gdk_event_translate): On * gdk/win32/gdkevents-win32.c (gdk_event_translate): On

View File

@ -1,3 +1,14 @@
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).
2003-03-13 Tor Lillqvist <tml@iki.fi> 2003-03-13 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkevents-win32.c (gdk_event_translate): On * gdk/win32/gdkevents-win32.c (gdk_event_translate): On

View File

@ -279,17 +279,14 @@ gtk_cell_renderer_pixbuf_set_property (GObject *object,
if (cellinfo->stock_id) if (cellinfo->stock_id)
g_free (cellinfo->stock_id); g_free (cellinfo->stock_id);
cellinfo->stock_id = g_strdup (g_value_get_string (value)); cellinfo->stock_id = g_strdup (g_value_get_string (value));
g_object_notify (G_OBJECT (object), "stock_id");
break; break;
case PROP_STOCK_SIZE: case PROP_STOCK_SIZE:
cellinfo->stock_size = g_value_get_enum (value); cellinfo->stock_size = g_value_get_enum (value);
g_object_notify (G_OBJECT (object), "stock_size");
break; break;
case PROP_STOCK_DETAIL: case PROP_STOCK_DETAIL:
if (cellinfo->stock_detail) if (cellinfo->stock_detail)
g_free (cellinfo->stock_detail); g_free (cellinfo->stock_detail);
cellinfo->stock_detail = g_strdup (g_value_get_string (value)); cellinfo->stock_detail = g_strdup (g_value_get_string (value));
g_object_notify (G_OBJECT (object), "stock_detail");
break; break;
default: default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec); 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; GtkCellRendererPixbuf *cellpixbuf = (GtkCellRendererPixbuf *) cell;
GtkCellRendererPixbufInfo *cellinfo = g_object_get_data (G_OBJECT (cell), CELLINFO_KEY); GtkCellRendererPixbufInfo *cellinfo = g_object_get_data (G_OBJECT (cell), CELLINFO_KEY);
gint pixbuf_width = 0; gint pixbuf_width = 0;
gint pixbuf_height = 0; gint pixbuf_height = 0;
gint calc_width; gint calc_width;
gint calc_height; gint calc_height;
@ -358,22 +355,22 @@ gtk_cell_renderer_pixbuf_get_size (GtkCellRenderer *cell,
if (cellpixbuf->pixbuf) 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); pixbuf_height = gdk_pixbuf_get_height (cellpixbuf->pixbuf);
} }
if (cellpixbuf->pixbuf_expander_open) 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)); pixbuf_height = MAX (pixbuf_height, gdk_pixbuf_get_height (cellpixbuf->pixbuf_expander_open));
} }
if (cellpixbuf->pixbuf_expander_closed) 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)); 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_width = (gint) cell->xpad * 2 + pixbuf_width;
calc_height = (gint) GTK_CELL_RENDERER (cellpixbuf)->ypad * 2 + pixbuf_height; calc_height = (gint) cell->ypad * 2 + pixbuf_height;
if (x_offset) *x_offset = 0; if (x_offset) *x_offset = 0;
if (y_offset) *y_offset = 0; if (y_offset) *y_offset = 0;
@ -382,14 +379,16 @@ gtk_cell_renderer_pixbuf_get_size (GtkCellRenderer *cell,
{ {
if (x_offset) if (x_offset)
{ {
*x_offset = ((gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL) ? *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)); 1.0 - cell->xalign : cell->xalign) *
*x_offset = MAX (*x_offset, 0) + GTK_CELL_RENDERER (cellpixbuf)->xpad; (cell_area->width - calc_width - 2 * cell->xpad));
*x_offset = MAX (*x_offset, 0) + cell->xpad;
} }
if (y_offset) if (y_offset)
{ {
*y_offset = GTK_CELL_RENDERER (cellpixbuf)->yalign * (cell_area->height - calc_height - (2 * GTK_CELL_RENDERER (cellpixbuf)->ypad)); *y_offset = (cell->yalign *
*y_offset = MAX (*y_offset, 0) + GTK_CELL_RENDERER (cellpixbuf)->ypad; (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.x += cell_area->x;
pix_rect.y += cell_area->y; pix_rect.y += cell_area->y;
pix_rect.width -= cell->xpad * 2; pix_rect.width -= cell->xpad * 2;
pix_rect.height -= cell->ypad * 2; pix_rect.height -= cell->ypad * 2;
if (gdk_rectangle_intersect (cell_area, &pix_rect, &draw_rect) && if (gdk_rectangle_intersect (cell_area, &pix_rect, &draw_rect) &&

View File

@ -519,7 +519,7 @@ _gtk_text_iter_get_segment_byte (const GtkTextIter *iter)
{ {
GtkTextRealIter *real; GtkTextRealIter *real;
g_return_val_if_fail (iter != NULL, NULL); g_return_val_if_fail (iter != NULL, 0);
real = gtk_text_iter_make_real (iter); real = gtk_text_iter_make_real (iter);
@ -538,7 +538,7 @@ _gtk_text_iter_get_segment_char (const GtkTextIter *iter)
{ {
GtkTextRealIter *real; GtkTextRealIter *real;
g_return_val_if_fail (iter != NULL, NULL); g_return_val_if_fail (iter != NULL, 0);
real = gtk_text_iter_make_real (iter); real = gtk_text_iter_make_real (iter);