fix #136202 (gtk_toolbar_insert_stock crashes if stock lookup fails)

This commit is contained in:
Gustavo J. A. M. Carneiro 2004-03-06 12:46:25 +00:00
parent c0dfbacbc9
commit 64cac40d2c
6 changed files with 36 additions and 5 deletions

View File

@ -1,3 +1,9 @@
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

View File

@ -1,3 +1,9 @@
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

View File

@ -1,3 +1,9 @@
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

View File

@ -1,3 +1,9 @@
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

View File

@ -1,3 +1,9 @@
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

View File

@ -3636,12 +3636,13 @@ internal_insert_element (GtkToolbar *toolbar,
if (text && use_stock)
{
GtkStockItem stock_item;
gtk_stock_lookup (text, &stock_item);
if (gtk_stock_lookup (text, &stock_item))
{
if (!icon)
icon = gtk_image_new_from_stock (text, toolbar->icon_size);
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)