Commit 34276445 authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann

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).
parent b2698b3a
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>
* gdk/win32/gdkevents-win32.c (gdk_event_translate): On
......
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>
* gdk/win32/gdkevents-win32.c (gdk_event_translate): On
......
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>
* gdk/win32/gdkevents-win32.c (gdk_event_translate): On
......
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>
* gdk/win32/gdkevents-win32.c (gdk_event_translate): On
......
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>
* gdk/win32/gdkevents-win32.c (gdk_event_translate): On
......
......@@ -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) &&
......
......@@ -519,7 +519,7 @@ _gtk_text_iter_get_segment_byte (const GtkTextIter *iter)
{
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);
......@@ -538,7 +538,7 @@ _gtk_text_iter_get_segment_char (const GtkTextIter *iter)
{
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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment