diff options
author | Dalai Felinto <dalai@blender.org> | 2022-06-03 16:52:28 +0300 |
---|---|---|
committer | Dalai Felinto <dalai@blender.org> | 2022-06-03 17:13:28 +0300 |
commit | 0b38b8dafaa237ec2e7427db969055e84d2c72c9 (patch) | |
tree | a00e0f1b41c2676139a9181f6509a8907875994b /source/blender/editors/space_spreadsheet/spreadsheet_row_filter.cc | |
parent | 074010ad6d0c93da4b22345c1746c3ae2981dff9 (diff) |
Spreadsheet Editor: Support int 8 attribute
This was leading to some crashes and warnings such as:
"Code marked as unreachable has been executed. Please report this as a bug."
Differential Revision: https://developer.blender.org/D15116
Diffstat (limited to 'source/blender/editors/space_spreadsheet/spreadsheet_row_filter.cc')
-rw-r--r-- | source/blender/editors/space_spreadsheet/spreadsheet_row_filter.cc | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/source/blender/editors/space_spreadsheet/spreadsheet_row_filter.cc b/source/blender/editors/space_spreadsheet/spreadsheet_row_filter.cc index 3ae4536b652..4f3d43ded92 100644 --- a/source/blender/editors/space_spreadsheet/spreadsheet_row_filter.cc +++ b/source/blender/editors/space_spreadsheet/spreadsheet_row_filter.cc @@ -73,6 +73,35 @@ static void apply_row_filter(const SpreadsheetRowFilter &row_filter, } } } + else if (column_data.type().is<int8_t>()) { + const int value = row_filter.value_int; + switch (row_filter.operation) { + case SPREADSHEET_ROW_FILTER_EQUAL: { + apply_filter_operation( + column_data.typed<int8_t>(), + [&](const int cell) { return cell == value; }, + prev_mask, + new_indices); + break; + } + case SPREADSHEET_ROW_FILTER_GREATER: { + apply_filter_operation( + column_data.typed<int8_t>(), + [value](const int cell) { return cell > value; }, + prev_mask, + new_indices); + break; + } + case SPREADSHEET_ROW_FILTER_LESS: { + apply_filter_operation( + column_data.typed<int8_t>(), + [&](const int cell) { return cell < value; }, + prev_mask, + new_indices); + break; + } + } + } else if (column_data.type().is<int>()) { const int value = row_filter.value_int; switch (row_filter.operation) { |