| 224 | } |
| 225 | |
| 226 | void BaseGrid::SelectRow(int row, bool addToSelected, bool select) { |
| 227 | if (row < 0 || (size_t)row >= index_line_map.size()) return; |
| 228 | |
| 229 | AssDialogue *line = index_line_map[row]; |
| 230 | |
| 231 | if (!addToSelected) { |
| 232 | context->selectionController->SetSelectedSet(Selection{line}); |
| 233 | return; |
| 234 | } |
| 235 | |
| 236 | bool selected = !!context->selectionController->GetSelectedSet().count(line); |
| 237 | if (select != selected) { |
| 238 | auto selection = context->selectionController->GetSelectedSet(); |
| 239 | if (select) |
| 240 | selection.insert(line); |
| 241 | else |
| 242 | selection.erase(line); |
| 243 | context->selectionController->SetSelectedSet(std::move(selection)); |
| 244 | } |
| 245 | } |
| 246 | |
| 247 | void BaseGrid::OnSeek() { |
| 248 | int lines = GetClientSize().GetHeight() / lineHeight + 1; |
nothing calls this directly
no test coverage detected