diff --git a/aegisub/src/subs_grid.cpp b/aegisub/src/subs_grid.cpp index e0fa9fcaf..3b93600b1 100644 --- a/aegisub/src/subs_grid.cpp +++ b/aegisub/src/subs_grid.cpp @@ -192,42 +192,3 @@ void SubtitlesGrid::AdjoinLines(int n1,int n2,bool setStart) { context->ass->Commit(_("adjoin"), AssFile::COMMIT_DIAG_TIME); } - -/// @brief Retrieve a list of selected lines in the actual ASS file (ie. not as displayed in the grid but as represented in the file) -/// @return -/// -std::vector SubtitlesGrid::GetAbsoluteSelection() const { - Selection sel = GetSelectedSet(); - - std::vector result; - result.reserve(sel.size()); - - int line_index = 0; - for (entryIter it = context->ass->Line.begin(); it != context->ass->Line.end(); ++it, ++line_index) { - if (sel.find(dynamic_cast(*it)) != sel.end()) - result.push_back(line_index); - } - - return result; -} - -/// @brief Update list of selected lines from absolute selection -/// @param selection -/// -void SubtitlesGrid::SetSelectionFromAbsolute(std::vector &selection) { - Selection newsel; - - std::sort(selection.begin(), selection.end()); - - int i = 0; - std::list::iterator j = context->ass->Line.begin(); - - for (size_t selveci = 0; selveci < selection.size(); ++selveci) { - while (i != selection[selveci] && j != context->ass->Line.end()) ++i, ++j; - if (j == context->ass->Line.end()) break; /// @todo Report error somehow - AssDialogue *dlg = dynamic_cast(*j); - if (dlg) newsel.insert(dlg); - } - - SetSelectedSet(newsel); -} diff --git a/aegisub/src/subs_grid.h b/aegisub/src/subs_grid.h index 5945846b0..1ed9dd977 100644 --- a/aegisub/src/subs_grid.h +++ b/aegisub/src/subs_grid.h @@ -59,10 +59,4 @@ public: void AdjoinLines(int first,int last,bool setStart); void RecombineLines(); - - /// Retrieve a list of selected lines in the actual ASS file (i.e. not as displayed in the grid but as represented in the file) - std::vector GetAbsoluteSelection() const; - /// @brief Update list of selected lines from absolute selection - /// @param selection Sorted list of selections - void SetSelectionFromAbsolute(std::vector &selection); };