mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-17 23:10:22 +00:00
GtkListBox: Add g_return_if_fail checks to public row functions
This commit is contained in:
parent
1f9fd5a952
commit
5d121a8aaa
@ -2623,6 +2623,8 @@ gtk_list_box_row_changed (GtkListBoxRow *row)
|
||||
{
|
||||
GtkListBox *list_box = gtk_list_box_row_get_box (row);
|
||||
|
||||
g_return_if_fail (GTK_IS_LIST_BOX_ROW (row));
|
||||
|
||||
if (list_box)
|
||||
gtk_list_box_got_row_changed (GTK_LIST_BOX (list_box), row);
|
||||
}
|
||||
@ -2644,6 +2646,8 @@ gtk_list_box_row_get_header (GtkListBoxRow *row)
|
||||
{
|
||||
GtkListBoxRowPrivate *priv = gtk_list_box_row_get_instance_private (row);
|
||||
|
||||
g_return_val_if_fail (GTK_IS_LIST_BOX_ROW (row), NULL);
|
||||
|
||||
return priv->header;
|
||||
}
|
||||
|
||||
@ -2664,6 +2668,9 @@ gtk_list_box_row_set_header (GtkListBoxRow *row,
|
||||
{
|
||||
GtkListBoxRowPrivate *priv = gtk_list_box_row_get_instance_private (row);
|
||||
|
||||
g_return_if_fail (GTK_IS_LIST_BOX_ROW (row));
|
||||
g_return_if_fail (header == NULL || GTK_IS_WIDGET (header));
|
||||
|
||||
if (priv->header)
|
||||
g_object_unref (priv->header);
|
||||
|
||||
@ -2688,6 +2695,8 @@ gtk_list_box_row_get_index (GtkListBoxRow *row)
|
||||
{
|
||||
GtkListBoxRowPrivate *priv = gtk_list_box_row_get_instance_private (row);
|
||||
|
||||
g_return_val_if_fail (GTK_IS_LIST_BOX_ROW (row), -1);
|
||||
|
||||
if (priv->iter != NULL)
|
||||
return g_sequence_iter_get_position (priv->iter);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user