Stick to the standard order of sections when inserting lines

This commit is contained in:
Thomas Goyne 2012-12-09 15:44:03 -08:00
parent 205d408f3e
commit 96b3656742
3 changed files with 5 additions and 5 deletions

View File

@ -26,19 +26,19 @@
wxString const& AssEntry::GroupHeader(bool ssa) const {
static wxString ass_headers[] = {
"[Script Info]",
"[Events]",
"[V4+ Styles]",
"[Fonts]",
"[Graphics]",
"[Events]",
""
};
static wxString ssa_headers[] = {
"[Script Info]",
"[Events]",
"[V4 Styles]",
"[Fonts]",
"[Graphics]",
"[Events]",
""
};

View File

@ -40,10 +40,10 @@
enum AssEntryGroup {
ENTRY_INFO = 0,
ENTRY_DIALOGUE,
ENTRY_STYLE,
ENTRY_FONT,
ENTRY_GRAPHIC,
ENTRY_DIALOGUE,
ENTRY_GROUP_MAX
};

View File

@ -274,13 +274,13 @@ void AssFile::InsertLine(AssEntry *entry) {
entryIter it = Line.end();
do {
--it;
if (it->Group() == entry->Group()) {
if (it->Group() <= entry->Group()) {
Line.insert(++it, *entry);
return;
}
} while (it != Line.begin());
Line.push_back(*entry);
Line.push_front(*entry);
}
void AssFile::InsertAttachment(wxString filename) {