diff options
author | Chris Toshok <toshok@helixcode.com> | 2000-12-04 17:59:31 +0800 |
---|---|---|
committer | Chris Toshok <toshok@src.gnome.org> | 2000-12-04 17:59:31 +0800 |
commit | b7efb0befa9d8b141c4ddac54c194bc4f94f4134 (patch) | |
tree | fcf70768172de02eedb55d043a0f6f0332218ed4 /widgets/table | |
parent | 8ee09aa6bda9c725845978627b5682efc467f53e (diff) | |
download | gsoc2013-evolution-b7efb0befa9d8b141c4ddac54c194bc4f94f4134.tar.gz gsoc2013-evolution-b7efb0befa9d8b141c4ddac54c194bc4f94f4134.tar.zst gsoc2013-evolution-b7efb0befa9d8b141c4ddac54c194bc4f94f4134.zip |
need to zero out the bits corresponding to the rows not selected in the
2000-12-04 Chris Toshok <toshok@helixcode.com>
* e-table-selection-model.c (e_table_selection_model_select_all):
need to zero out the bits corresponding to the rows not selected
in the last full 32 bit mask. This fixes a crash in the subscribe
UI (or potentially anywhere that uses
selection_model_select_all/selection_model_foreach.)
svn path=/trunk/; revision=6770
Diffstat (limited to 'widgets/table')
-rw-r--r-- | widgets/table/e-table-selection-model.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/widgets/table/e-table-selection-model.c b/widgets/table/e-table-selection-model.c index e8f5dcd38f..d39e7b3c14 100644 --- a/widgets/table/e-table-selection-model.c +++ b/widgets/table/e-table-selection-model.c @@ -524,7 +524,19 @@ e_table_selection_model_select_all (ETableSelectionModel *selection) for (i = 0; i < (selection->row_count + 31) / 32; i ++) { selection->selection[i] = ONES; } - + + /* need to zero out the bits corresponding to the rows not + selected in the last full 32 bit mask */ + if (selection->row_count % 32) { + int unselected_mask = 0; + int num_unselected_in_last_byte = 32 - selection->row_count % 32; + + for (i = 0; i < num_unselected_in_last_byte; i ++) + unselected_mask |= 1 << i; + + selection->selection[(selection->row_count + 31) / 32 - 1] &= ~unselected_mask; + } + selection->cursor_col = 0; selection->cursor_row = 0; selection->selection_start_row = 0; |