tSwap iterators in gtk_list_store_swap - vaccinewars - be a doctor and try to v… | |
git clone git://src.adamsgaard.dk/vaccinewars | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit ce18bc615c475854bc4b4bcd0e5750092a7c8cdf | |
parent 3de454d0ab7052f5dbbb98742b61f7f23bfce7f7 | |
Author: Ben Webb <[email protected]> | |
Date: Sat, 28 Nov 2020 21:54:07 -0800 | |
Swap iterators in gtk_list_store_swap | |
Since our Win32 implementation uses row | |
indices for iterators, we need to swap these | |
ttoo when we swap the rows, in order for things | |
tto be consistent with regular GTK. | |
Diffstat: | |
M src/gtkport/treeview.c | 7 +++++++ | |
1 file changed, 7 insertions(+), 0 deletions(-) | |
--- | |
diff --git a/src/gtkport/treeview.c b/src/gtkport/treeview.c | |
t@@ -407,12 +407,19 @@ void gtk_list_store_set(GtkListStore *list_store, GtkTre… | |
void gtk_list_store_swap(GtkListStore *store, GtkTreeIter *a, GtkTreeIter *b) | |
{ | |
+ GtkTreeIter tmp; | |
GtkListStoreRow rowa = g_array_index(store->rows, GtkListStoreRow, *a); | |
GtkListStoreRow rowb = g_array_index(store->rows, GtkListStoreRow, *b); | |
g_array_index(store->rows, GtkListStoreRow, *a) = rowb; | |
g_array_index(store->rows, GtkListStoreRow, *b) = rowa; | |
store->need_sort = TRUE; | |
+ | |
+ /* Swap the iterators too since in our implementation they are just row | |
+ indices */ | |
+ tmp = *a; | |
+ *a = *b; | |
+ *b = tmp; | |
} | |
void gtk_tree_model_get(GtkTreeModel *tree_model, GtkTreeIter *iter, ...) |