Commit 5d121a8a authored by Kalev Lember's avatar Kalev Lember

GtkListBox: Add g_return_if_fail checks to public row functions

parent 1f9fd5a9
...@@ -2623,6 +2623,8 @@ gtk_list_box_row_changed (GtkListBoxRow *row) ...@@ -2623,6 +2623,8 @@ gtk_list_box_row_changed (GtkListBoxRow *row)
{ {
GtkListBox *list_box = gtk_list_box_row_get_box (row); GtkListBox *list_box = gtk_list_box_row_get_box (row);
g_return_if_fail (GTK_IS_LIST_BOX_ROW (row));
if (list_box) if (list_box)
gtk_list_box_got_row_changed (GTK_LIST_BOX (list_box), row); gtk_list_box_got_row_changed (GTK_LIST_BOX (list_box), row);
} }
...@@ -2644,6 +2646,8 @@ gtk_list_box_row_get_header (GtkListBoxRow *row) ...@@ -2644,6 +2646,8 @@ gtk_list_box_row_get_header (GtkListBoxRow *row)
{ {
GtkListBoxRowPrivate *priv = gtk_list_box_row_get_instance_private (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; return priv->header;
} }
...@@ -2664,6 +2668,9 @@ gtk_list_box_row_set_header (GtkListBoxRow *row, ...@@ -2664,6 +2668,9 @@ gtk_list_box_row_set_header (GtkListBoxRow *row,
{ {
GtkListBoxRowPrivate *priv = gtk_list_box_row_get_instance_private (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) if (priv->header)
g_object_unref (priv->header); g_object_unref (priv->header);
...@@ -2688,6 +2695,8 @@ gtk_list_box_row_get_index (GtkListBoxRow *row) ...@@ -2688,6 +2695,8 @@ gtk_list_box_row_get_index (GtkListBoxRow *row)
{ {
GtkListBoxRowPrivate *priv = gtk_list_box_row_get_instance_private (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) if (priv->iter != NULL)
return g_sequence_iter_get_position (priv->iter); return g_sequence_iter_get_position (priv->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