modules-other-gail-gailtreeview.c-Incorporate-review-sugg.patch 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. From: Brady Minardi <bradyminardi@fake-box.com>
  2. Date: Sat, 14 Jul 2018 14:45:28 +0000
  3. Subject: modules/other/gail/gailtreeview.c: Incorporate review suggestions
  4. Incorporate review suggestions by Emmanuele Bassi.
  5. Origin: upstream, 2.24.33, commit:8f8336cd9410c39ac53da40de69907a0844024d5
  6. ---
  7. modules/other/gail/gailtreeview.c | 15 ++++++++++-----
  8. 1 file changed, 10 insertions(+), 5 deletions(-)
  9. diff --git a/modules/other/gail/gailtreeview.c b/modules/other/gail/gailtreeview.c
  10. index ee8fa00..23923c5 100644
  11. --- a/modules/other/gail/gailtreeview.c
  12. +++ b/modules/other/gail/gailtreeview.c
  13. @@ -223,7 +223,7 @@ static void adjustment_changed (GtkAdjustment
  14. /* Misc */
  15. -static void set_iter_nth_row (GtkTreeView *tree_view,
  16. +static gboolean set_iter_nth_row (GtkTreeView *tree_view,
  17. GtkTreeIter *iter,
  18. gint row);
  19. static gint get_row_from_tree_path (GtkTreeView *tree_view,
  20. @@ -1466,8 +1466,10 @@ gail_tree_view_add_row_selection (AtkTable *table,
  21. }
  22. else
  23. {
  24. - set_iter_nth_row (tree_view, &iter_to_row, row);
  25. - gtk_tree_selection_select_iter (selection, &iter_to_row);
  26. + if (set_iter_nth_row (tree_view, &iter_to_row, row))
  27. + gtk_tree_selection_select_iter (selection, &iter_to_row);
  28. + else
  29. + return FALSE;
  30. }
  31. }
  32. @@ -3236,7 +3238,7 @@ update_cell_value (GailRendererCell *renderer_cell,
  33. return gail_renderer_cell_update_cache (renderer_cell, emit_change_signal);
  34. }
  35. -static void
  36. +static gboolean
  37. set_iter_nth_row (GtkTreeView *tree_view,
  38. GtkTreeIter *iter,
  39. gint row)
  40. @@ -3245,7 +3247,10 @@ set_iter_nth_row (GtkTreeView *tree_view,
  41. tree_model = gtk_tree_view_get_model (tree_view);
  42. gtk_tree_model_get_iter_first (tree_model, iter);
  43. - iter = return_iter_nth_row (tree_view, tree_model, iter, 0 , row);
  44. + if (return_iter_nth_row (tree_view, tree_model, iter, 0 , row) != NULL)
  45. + return TRUE;
  46. +
  47. + return FALSE;
  48. }
  49. static gint