Delete SubtitlesGrid::SetSelectionFromAbsolute and SubtitlesGrid::GetAbsoluteSelection

Nothing uses them anymore (and nothing should be using them).
This commit is contained in:
Thomas Goyne 2012-10-15 07:03:25 -07:00
parent 53433426bb
commit b52099f0fa
2 changed files with 0 additions and 45 deletions

View file

@ -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<int> SubtitlesGrid::GetAbsoluteSelection() const {
Selection sel = GetSelectedSet();
std::vector<int> 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<AssDialogue*>(*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<int> &selection) {
Selection newsel;
std::sort(selection.begin(), selection.end());
int i = 0;
std::list<AssEntry*>::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<AssDialogue*>(*j);
if (dlg) newsel.insert(dlg);
}
SetSelectedSet(newsel);
}

View file

@ -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<int> GetAbsoluteSelection() const;
/// @brief Update list of selected lines from absolute selection
/// @param selection Sorted list of selections
void SetSelectionFromAbsolute(std::vector<int> &selection);
};