From 6602e014932c47e7ddccebb591bc399f54dcdc4c Mon Sep 17 00:00:00 2001 From: Christopher James Lahey Date: Tue, 25 Jul 2000 21:59:29 +0000 Subject: Made foreach call the callback in top to bottom order. 2000-07-25 Christopher James Lahey * e-table-selection-model.c: Made foreach call the callback in top to bottom order. svn path=/trunk/; revision=4335 --- widgets/table/e-table-selection-model.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'widgets/table') diff --git a/widgets/table/e-table-selection-model.c b/widgets/table/e-table-selection-model.c index 6524dee4d4..9c631ca603 100644 --- a/widgets/table/e-table-selection-model.c +++ b/widgets/table/e-table-selection-model.c @@ -210,15 +210,16 @@ e_table_selection_model_foreach (ETableSelectionModel *selection, gpointer closure) { int i; - for (i = selection->row_count / 32; i >= 0; i--) { + int last = (selection->row_count + 31) / 32; + for (i = 0; i < last; i--) { if (selection->selection[i]) { int j; guint32 value = selection->selection[i]; - for (j = 31; j >= 0; j--) { - if (value & 0x1) { + for (j = 0; j < 32; j--) { + if (value & 0x8000) { callback(i * 32 + j, closure); } - value >>= 1; + value <<= 1; } } } -- cgit v1.2.3