1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-26 00:03:52 +02:00

Less use of wxArrayString::Index() ...

... instead use the utility make_iterator_range and its index() or contains()
method.  This generic utility works with any container defining begin() and
end().

This further lessens dependency on wxWidgets container idioms.
This commit is contained in:
Paul Licameli
2019-03-04 02:13:40 -05:00
parent c68e336247
commit dd8eb9e3d9
21 changed files with 42 additions and 37 deletions

View File

@@ -77,7 +77,7 @@ LangChoiceDialog::LangChoiceDialog(wxWindow * parent,
{
SetName(GetTitle());
GetLanguages(mLangCodes, mLangNames);
int ndx = mLangCodes.Index(GetSystemLanguageCode());
int ndx = make_iterator_range( mLangCodes ).index( GetSystemLanguageCode() );
wxString lang;
if (ndx != wxNOT_FOUND) {
@@ -111,7 +111,7 @@ void LangChoiceDialog::OnOk(wxCommandEvent & WXUNUSED(event))
mLang = mLangCodes[ndx];
wxString slang = GetSystemLanguageCode();
int sndx = mLangCodes.Index(slang);
int sndx = make_iterator_range( mLangCodes ).index( slang );
wxString sname;
if (sndx == wxNOT_FOUND) {