Kanji timer: don't FlagAsModified if no changes are made

Originally committed to SVN as r943.
This commit is contained in:
Dan Donovan 2007-03-08 18:57:55 +00:00
parent 4dd9a52482
commit cd4332ac04

View file

@ -170,17 +170,19 @@ END_EVENT_TABLE()
void DialogKanjiTimer::OnClose(wxCommandEvent &event) { void DialogKanjiTimer::OnClose(wxCommandEvent &event) {
Options.SetBool(_T("kanji timer interpolation"),Interpolate->IsChecked()); Options.SetBool(_T("kanji timer interpolation"),Interpolate->IsChecked());
Options.Save(); Options.Save();
bool modified = LinesToChange.empty();
while(LinesToChange.empty()==false) { while(LinesToChange.empty()==false) {
std::pair<int,wxString> p = LinesToChange.back(); std::pair<int,wxString> p = LinesToChange.back();
LinesToChange.pop_back(); LinesToChange.pop_back();
AssDialogue *line = grid->GetDialogue(p.first); AssDialogue *line = grid->GetDialogue(p.first);
line->Text = p.second; line->Text = p.second;
} }
grid->ass->FlagAsModified(_("kanji timing")); if (modified) {
grid->CommitChanges(); grid->ass->FlagAsModified(_("kanji timing"));
LinesToChange.clear(); grid->CommitChanges();
LinesToChange.clear();
}
Close(); Close();
} }