Don't update the initial line state after undo

This commit is contained in:
Thomas Goyne 2012-11-02 21:10:45 -07:00
parent 9a36e5cfe1
commit 31d2054ab3
2 changed files with 8 additions and 2 deletions

View file

@ -27,10 +27,15 @@ InitialLineState::InitialLineState(agi::Context *c)
}
void InitialLineState::OnActiveLineChanged(AssDialogue *new_line) {
if (new_line)
if (new_line) {
if (new_line->Id == line_id) return;
line_id = new_line->Id;
initial_text = new_line->Text;
else
}
else {
line_id = 0;
initial_text.clear();
}
InitialStateChanged(initial_text);
}

View file

@ -24,6 +24,7 @@ class AssDialogue;
class InitialLineState {
agi::signal::Connection active_line_connection;
wxString initial_text;
int line_id;
agi::signal::Signal<wxString const&> InitialStateChanged;
void OnActiveLineChanged(AssDialogue *new_line);