diff --git a/aegisub/src/ass_file.cpp b/aegisub/src/ass_file.cpp index 148f76c2f..6118340ca 100644 --- a/aegisub/src/ass_file.cpp +++ b/aegisub/src/ass_file.cpp @@ -279,6 +279,8 @@ bool AssFile::CanSave() { // I strongly advice you against touching this function unless you know what you're doing; // even moving things out of order might break ASS parsing - AMZ. void AssFile::AddLine(wxString data,wxString group,int &version,wxString *outGroup) { + if (data.empty()) return; + // Group AssEntry *entry = NULL; wxString origGroup = group; @@ -344,7 +346,7 @@ void AssFile::AddLine(wxString data,wxString group,int &version,wxString *outGro } // Dialogue - if (lowGroup == _T("[events]")) { + else if (lowGroup == _T("[events]")) { if (data.StartsWith(_T("Dialogue:")) || data.StartsWith(_T("Comment:"))) { AssDialogue *diag = new AssDialogue(data,version); //diag->ParseASSTags(); diff --git a/aegisub/src/subtitle_format_ass.cpp b/aegisub/src/subtitle_format_ass.cpp index 9439b7376..8bdbddd3d 100644 --- a/aegisub/src/subtitle_format_ass.cpp +++ b/aegisub/src/subtitle_format_ass.cpp @@ -136,9 +136,6 @@ void ASSSubtitleFormat::ReadFile(wxString filename,wxString encoding) { // Not-so-special case for other groups, just set it else { curgroup = wxbuffer; - // default from extension in all other sections - //version = 1; - //if (filename.Right(4).Lower() == _T(".ssa")) version = 0; } } @@ -155,9 +152,6 @@ void ASSSubtitleFormat::ReadFile(wxString filename,wxString encoding) { throw wxString(_T("Error processing line: ")) + wxbuffer; } } - - // Add one last empty line in case it didn't end with one - if (!wxbuffer.IsEmpty()) AddLine(_T(""),curgroup,version); }