forked from mia/Aegisub
Always write a newline at the end of ASS files
Originally committed to SVN as r6957.
This commit is contained in:
parent
b265d1fa0e
commit
e774902a29
1 changed files with 1 additions and 7 deletions
|
@ -90,7 +90,6 @@ void ASSSubtitleFormat::WriteFile(const AssFile *src, wxString const& filename,
|
||||||
TextFileWriter file(filename, encoding);
|
TextFileWriter file(filename, encoding);
|
||||||
bool ssa = filename.Right(4).Lower() == ".ssa";
|
bool ssa = filename.Right(4).Lower() == ".ssa";
|
||||||
|
|
||||||
LineList::const_iterator last = src->Line.end(); --last;
|
|
||||||
wxString group = src->Line.front()->group;
|
wxString group = src->Line.front()->group;
|
||||||
for (LineList::const_iterator cur = src->Line.begin(); cur != src->Line.end(); ++cur) {
|
for (LineList::const_iterator cur = src->Line.begin(); cur != src->Line.end(); ++cur) {
|
||||||
// Add a blank line between each group
|
// Add a blank line between each group
|
||||||
|
@ -99,11 +98,6 @@ void ASSSubtitleFormat::WriteFile(const AssFile *src, wxString const& filename,
|
||||||
group = (*cur)->group;
|
group = (*cur)->group;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Only add a line break if there is a next line
|
file.WriteLineToFile(ssa ? (*cur)->GetSSAText() : (*cur)->GetEntryData(), true);
|
||||||
bool lineBreak = cur != last;
|
|
||||||
|
|
||||||
// Write line
|
|
||||||
if (ssa) file.WriteLineToFile((*cur)->GetSSAText(), lineBreak);
|
|
||||||
else file.WriteLineToFile((*cur)->GetEntryData(), lineBreak);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue