Fix T98446: Spreadsheets filter not working on Name column

This commit is contained in:
Dalai Felinto 2022-05-30 16:11:52 +02:00
parent a9a4bcc3d1
commit afd81e26af
Notes: blender-bot 2023-02-14 00:20:15 +01:00
Referenced by issue #98446, Spreadsheets filter not working on Name column
1 changed files with 22 additions and 26 deletions

View File

@ -190,33 +190,29 @@ static void apply_row_filter(const SpreadsheetRowFilter &row_filter,
}
else if (column_data.type().is<InstanceReference>()) {
const StringRef value = row_filter.value_string;
switch (row_filter.operation) {
case SPREADSHEET_ROW_FILTER_EQUAL: {
apply_filter_operation(
column_data.typed<InstanceReference>(),
[&](const InstanceReference cell) {
switch (cell.type()) {
case InstanceReference::Type::Object: {
return value == (reinterpret_cast<ID &>(cell.object()).name + 2);
}
case InstanceReference::Type::Collection: {
return value == (reinterpret_cast<ID &>(cell.collection()).name + 2);
}
case InstanceReference::Type::GeometrySet: {
return false;
}
case InstanceReference::Type::None: {
return false;
}
}
BLI_assert_unreachable();
apply_filter_operation(
column_data.typed<InstanceReference>(),
[&](const InstanceReference cell) {
switch (cell.type()) {
case InstanceReference::Type::Object: {
return value == (reinterpret_cast<ID &>(cell.object()).name + 2);
}
case InstanceReference::Type::Collection: {
return value == (reinterpret_cast<ID &>(cell.collection()).name + 2);
}
case InstanceReference::Type::GeometrySet: {
return false;
},
prev_mask,
new_indices);
break;
}
}
}
case InstanceReference::Type::None: {
return false;
}
}
BLI_assert_unreachable();
return false;
},
prev_mask,
new_indices);
}
}