diff options
author | Christopher James Lahey <clahey@helixcode.com> | 2000-07-26 05:59:29 +0800 |
---|---|---|
committer | Chris Lahey <clahey@src.gnome.org> | 2000-07-26 05:59:29 +0800 |
commit | 6602e014932c47e7ddccebb591bc399f54dcdc4c (patch) | |
tree | ff724ddea526e5acf323a0e5c0fcbbe95319ade4 | |
parent | 20e7e5d6502063bd4c05ffd35bc1657e6345ab94 (diff) | |
download | gsoc2013-evolution-6602e014932c47e7ddccebb591bc399f54dcdc4c.tar gsoc2013-evolution-6602e014932c47e7ddccebb591bc399f54dcdc4c.tar.gz gsoc2013-evolution-6602e014932c47e7ddccebb591bc399f54dcdc4c.tar.bz2 gsoc2013-evolution-6602e014932c47e7ddccebb591bc399f54dcdc4c.tar.lz gsoc2013-evolution-6602e014932c47e7ddccebb591bc399f54dcdc4c.tar.xz gsoc2013-evolution-6602e014932c47e7ddccebb591bc399f54dcdc4c.tar.zst gsoc2013-evolution-6602e014932c47e7ddccebb591bc399f54dcdc4c.zip |
Made foreach call the callback in top to bottom order.
2000-07-25 Christopher James Lahey <clahey@helixcode.com>
* e-table-selection-model.c: Made foreach call the callback in top
to bottom order.
svn path=/trunk/; revision=4335
-rw-r--r-- | widgets/e-table/ChangeLog | 5 | ||||
-rw-r--r-- | widgets/e-table/e-table-selection-model.c | 9 | ||||
-rw-r--r-- | widgets/table/e-table-selection-model.c | 9 |
3 files changed, 15 insertions, 8 deletions
diff --git a/widgets/e-table/ChangeLog b/widgets/e-table/ChangeLog index e8e1483f2d..39e7449fd9 100644 --- a/widgets/e-table/ChangeLog +++ b/widgets/e-table/ChangeLog @@ -1,5 +1,10 @@ 2000-07-25 Christopher James Lahey <clahey@helixcode.com> + * e-table-selection-model.c: Made foreach call the callback in top + to bottom order. + +2000-07-25 Christopher James Lahey <clahey@helixcode.com> + * e-table-selection-model.c, e-table-selection-model.h: Replaced get_selection_list with foreach. diff --git a/widgets/e-table/e-table-selection-model.c b/widgets/e-table/e-table-selection-model.c index 6524dee4d4..9c631ca603 100644 --- a/widgets/e-table/e-table-selection-model.c +++ b/widgets/e-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; } } } 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; } } } |