diff --git a/aegisub/src/subs_edit_box.cpp b/aegisub/src/subs_edit_box.cpp index 55a40b4c4..4d0ccfc68 100644 --- a/aegisub/src/subs_edit_box.cpp +++ b/aegisub/src/subs_edit_box.cpp @@ -343,14 +343,20 @@ void SubsEditBox::PopulateList(wxComboBox *combo, boost::flyweight wxEventBlocker blocker(this); std::unordered_set values; - for (auto diag : c->ass->Line | agi::of_type()) - values.insert(diag->*field); - values.erase(""); + for (auto const& line : c->ass->Line) { + if (line.Group() != AssEntryGroup::DIALOGUE) continue; + auto const& value = static_cast(&line)->*field; + if (!value.get().empty()) + values.insert(value); + } + wxArrayString arrstr; arrstr.reserve(values.size()); transform(values.begin(), values.end(), std::back_inserter(arrstr), (wxString (*)(std::string const&))to_wx); + arrstr.Sort(); + combo->Freeze(); long pos = combo->GetInsertionPoint(); wxString value = combo->GetValue();