toolbar: Limit item position to number of contained elements

Greater values don't make much sense.

https://bugzilla.gnome.org/show_bug.cgi?id=682080
This commit is contained in:
Timm Bäder 2016-05-10 19:16:19 +02:00
parent e463e09577
commit 63be0deb0f

View File

@ -2789,7 +2789,9 @@ gtk_toolbar_insert (GtkToolbar *toolbar,
{
g_return_if_fail (GTK_IS_TOOLBAR (toolbar));
g_return_if_fail (GTK_IS_TOOL_ITEM (item));
pos = MIN (pos, (int)g_list_length (toolbar->priv->content));
if (pos >= 0)
pos = logical_to_physical (toolbar, pos);