forked from mia/Aegisub
Write the version comments under the [Script Info] header. Closes #1567.
This commit is contained in:
parent
8470ffdbf0
commit
8566960312
1 changed files with 3 additions and 3 deletions
|
@ -110,17 +110,17 @@ static inline wxString format(AssEntryGroup group, bool ssa) {
|
||||||
void AssSubtitleFormat::WriteFile(const AssFile *src, wxString const& filename, wxString const& encoding) const {
|
void AssSubtitleFormat::WriteFile(const AssFile *src, wxString const& filename, wxString const& encoding) const {
|
||||||
TextFileWriter file(filename, encoding);
|
TextFileWriter file(filename, encoding);
|
||||||
|
|
||||||
|
file.WriteLineToFile("[Script Info]");
|
||||||
file.WriteLineToFile(wxString("; Script generated by Aegisub ") + GetAegisubLongVersionString());
|
file.WriteLineToFile(wxString("; Script generated by Aegisub ") + GetAegisubLongVersionString());
|
||||||
file.WriteLineToFile("; http://www.aegisub.org/");
|
file.WriteLineToFile("; http://www.aegisub.org/");
|
||||||
|
|
||||||
bool ssa = filename.Right(4).Lower() == ".ssa";
|
bool ssa = filename.Right(4).Lower() == ".ssa";
|
||||||
AssEntryGroup group = ENTRY_GROUP_MAX;
|
AssEntryGroup group = ENTRY_INFO;
|
||||||
|
|
||||||
for (auto const& line : src->Line) {
|
for (auto const& line : src->Line) {
|
||||||
if (line.Group() != group) {
|
if (line.Group() != group) {
|
||||||
// Add a blank line between each group
|
// Add a blank line between each group
|
||||||
if (group != ENTRY_GROUP_MAX)
|
file.WriteLineToFile("");
|
||||||
file.WriteLineToFile("");
|
|
||||||
|
|
||||||
file.WriteLineToFile(line.GroupHeader(ssa));
|
file.WriteLineToFile(line.GroupHeader(ssa));
|
||||||
file.WriteLineToFile(format(line.Group(), ssa), false);
|
file.WriteLineToFile(format(line.Group(), ssa), false);
|
||||||
|
|
Loading…
Reference in a new issue