MCPcopy Create free account
hub / github.com/TypesettingTools/Aegisub / SelectRow

Method SelectRow

src/base_grid.cpp:226–245  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

224}
225
226void 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
247void BaseGrid::OnSeek() {
248 int lines = GetClientSize().GetHeight() / lineHeight + 1;

Callers

nothing calls this directly

Calls 3

SetSelectedSetMethod · 0.80
eraseMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected