Save selection over undo/redo.

Originally committed to SVN as r4668.
This commit is contained in:
Thomas Goyne 2010-07-09 07:31:43 +00:00
parent 2e5dc176db
commit 5e22a0f151

View file

@ -1168,17 +1168,25 @@ void FrameMain::OnShiftToFrame (wxCommandEvent &) {
/// @brief Undo
void FrameMain::OnUndo(wxCommandEvent&) {
VideoContext::Get()->Stop();
std::vector<int> selected_lines = SubsGrid->GetAbsoluteSelection();
int active_line = SubsGrid->GetDialogueIndex(SubsGrid->GetActiveLine());
AssFile::top->Undo();
UpdateTitle();
SubsGrid->UpdateMaps();
SubsGrid->SetSelectionFromAbsolute(selected_lines);
SubsGrid->SetActiveLine(SubsGrid->GetDialogue(active_line));
}
/// @brief Redo
void FrameMain::OnRedo(wxCommandEvent&) {
VideoContext::Get()->Stop();
std::vector<int> selected_lines = SubsGrid->GetAbsoluteSelection();
int active_line = SubsGrid->GetDialogueIndex(SubsGrid->GetActiveLine());
AssFile::top->Redo();
UpdateTitle();
SubsGrid->UpdateMaps();
SubsGrid->SetSelectionFromAbsolute(selected_lines);
SubsGrid->SetActiveLine(SubsGrid->GetDialogue(active_line));
}
/// @brief Find