Merge branch 'wip/kabus/scroll_to_null_tile' into 'main'

listbase: Fix a null dereference

See merge request GNOME/gtk!7240
This commit is contained in:
Benjamin Otte 2024-05-14 19:48:42 +00:00
commit 32ea1cf32d
3 changed files with 9 additions and 3 deletions

View File

@ -2188,7 +2188,8 @@ gtk_column_view_set_header_factory (GtkColumnView *self,
/**
* gtk_column_view_scroll_to:
* @self: The columnview to scroll in
* @pos: position of the item
* @pos: position of the item. Must be less than the number of
* items in the view.
* @column: (nullable) (transfer none): The column to scroll to
* or %NULL to not scroll columns.
* @flags: actions to perform
@ -2211,6 +2212,7 @@ gtk_column_view_scroll_to (GtkColumnView *self,
GtkScrollInfo *scroll)
{
g_return_if_fail (GTK_IS_COLUMN_VIEW (self));
g_return_if_fail (pos < gtk_list_base_get_n_items (GTK_LIST_BASE (self)));
g_return_if_fail (column == NULL || GTK_IS_COLUMN_VIEW_COLUMN (column));
if (column)
{

View File

@ -1576,7 +1576,8 @@ gtk_grid_view_get_tab_behavior (GtkGridView *self)
/**
* gtk_grid_view_scroll_to:
* @self: The gridview to scroll in
* @pos: position of the item
* @pos: position of the item. Must be less than the number of
* items in the view.
* @flags: actions to perform
* @scroll: (nullable) (transfer full): details of how to perform
* the scroll operation or %NULL to scroll into view
@ -1596,6 +1597,7 @@ gtk_grid_view_scroll_to (GtkGridView *self,
GtkScrollInfo *scroll)
{
g_return_if_fail (GTK_IS_GRID_VIEW (self));
g_return_if_fail (pos < gtk_list_base_get_n_items (GTK_LIST_BASE (self)));
gtk_list_base_scroll_to (GTK_LIST_BASE (self), pos, flags, scroll);
}

View File

@ -1356,7 +1356,8 @@ gtk_list_view_get_tab_behavior (GtkListView *self)
/**
* gtk_list_view_scroll_to:
* @self: The listview to scroll in
* @pos: position of the item
* @pos: position of the item. Must be less than the number of
* items in the view.
* @flags: actions to perform
* @scroll: (nullable) (transfer full): details of how to perform
* the scroll operation or %NULL to scroll into view
@ -1376,6 +1377,7 @@ gtk_list_view_scroll_to (GtkListView *self,
GtkScrollInfo *scroll)
{
g_return_if_fail (GTK_IS_LIST_VIEW (self));
g_return_if_fail (pos < gtk_list_base_get_n_items (GTK_LIST_BASE (self)));
gtk_list_base_scroll_to (GTK_LIST_BASE (self), pos, flags, scroll);
}