fix #136202 (gtk_toolbar_insert_stock crashes if stock lookup fails)

parent c0dfbacb
2004-03-06 Gustavo J. A. M. Carneiro <gustavo@users.sourceforge.net>
* gtk/gtktoolbar.c (internal_insert_element): Check return value
of gtk_stock_lookup; if stock lookup fails, just use stock_id as
label, instead of crashing. Fixes #136202.
2004-03-05 Federico Mena Quintero <federico@ximian.com>
* gdk/linux-fb/gdkglobals-fb.c: Make <config.h> the very first
......
2004-03-06 Gustavo J. A. M. Carneiro <gustavo@users.sourceforge.net>
* gtk/gtktoolbar.c (internal_insert_element): Check return value
of gtk_stock_lookup; if stock lookup fails, just use stock_id as
label, instead of crashing. Fixes #136202.
2004-03-05 Federico Mena Quintero <federico@ximian.com>
* gdk/linux-fb/gdkglobals-fb.c: Make <config.h> the very first
......
2004-03-06 Gustavo J. A. M. Carneiro <gustavo@users.sourceforge.net>
* gtk/gtktoolbar.c (internal_insert_element): Check return value
of gtk_stock_lookup; if stock lookup fails, just use stock_id as
label, instead of crashing. Fixes #136202.
2004-03-05 Federico Mena Quintero <federico@ximian.com>
* gdk/linux-fb/gdkglobals-fb.c: Make <config.h> the very first
......
2004-03-06 Gustavo J. A. M. Carneiro <gustavo@users.sourceforge.net>
* gtk/gtktoolbar.c (internal_insert_element): Check return value
of gtk_stock_lookup; if stock lookup fails, just use stock_id as
label, instead of crashing. Fixes #136202.
2004-03-05 Federico Mena Quintero <federico@ximian.com>
* gdk/linux-fb/gdkglobals-fb.c: Make <config.h> the very first
......
2004-03-06 Gustavo J. A. M. Carneiro <gustavo@users.sourceforge.net>
* gtk/gtktoolbar.c (internal_insert_element): Check return value
of gtk_stock_lookup; if stock lookup fails, just use stock_id as
label, instead of crashing. Fixes #136202.
2004-03-05 Federico Mena Quintero <federico@ximian.com>
* gdk/linux-fb/gdkglobals-fb.c: Make <config.h> the very first
......
......@@ -3636,12 +3636,13 @@ internal_insert_element (GtkToolbar *toolbar,
if (text && use_stock)
{
GtkStockItem stock_item;
gtk_stock_lookup (text, &stock_item);
if (!icon)
icon = gtk_image_new_from_stock (text, toolbar->icon_size);
if (gtk_stock_lookup (text, &stock_item))
{
if (!icon)
icon = gtk_image_new_from_stock (text, toolbar->icon_size);
text = free_me = _gtk_toolbar_elide_underscores (stock_item.label);
text = free_me = _gtk_toolbar_elide_underscores (stock_item.label);
}
}
if (text)
......
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