1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-11-23 09:20:16 +01:00

Use standard library style members of wxArrayString (and wxString) ...

... which will make it easier to change the types of those containers to
std::vectors of other string-like classes

for wxString,

IsEmpty => empty
Clear => clear
Alloc => reserve

for wxArrayString,

Count => size
GetCount => size
IsEmpty => empty
Add => push_back
Clear => clear
Empty => clear
Sort => std::sort (only with default comparator)
SetCount => resize
Last => back
Item => operator []
Alloc => reserve
This commit is contained in:
Paul Licameli
2019-02-11 19:10:48 -05:00
parent 5daa67dfe6
commit 2db49dc1f0
115 changed files with 728 additions and 728 deletions

View File

@@ -155,7 +155,7 @@ void LabelDialog::PopulateLabels()
wxGridCellAttr *attr;
mGrid->SetColAttr(Col_Track, (attr = safenew wxGridCellAttr));
attr->SetEditor(mChoiceEditor);
mTrackNames.Add(_("New..."));
mTrackNames.push_back(_("New..."));
// Initialize and set the time column attributes
mGrid->SetColAttr(Col_Stime, (attr = safenew wxGridCellAttr));
@@ -384,7 +384,7 @@ bool LabelDialog::TransferDataFromWindow()
}
// Create any added tracks
while (tndx < (int)mTrackNames.GetCount() - 1) {
while (tndx < (int)mTrackNames.size() - 1) {
// Extract the name
wxString name = mTrackNames[tndx + 1].AfterFirst(wxT('-')).Mid(1);
@@ -434,9 +434,9 @@ bool LabelDialog::Validate()
wxString LabelDialog::TrackName(int & index, const wxString &dflt)
{
// Generate a NEW track name if the passed index is out of range
if (index < 1 || index >= (int)mTrackNames.GetCount()) {
index = mTrackNames.GetCount();
mTrackNames.Add(wxString::Format(wxT("%d - %s"), index, dflt));
if (index < 1 || index >= (int)mTrackNames.size()) {
index = mTrackNames.size();
mTrackNames.push_back(wxString::Format(wxT("%d - %s"), index, dflt));
}
// Return the track name
@@ -665,7 +665,7 @@ void LabelDialog::OnExport(wxCommandEvent & WXUNUSED(event))
}
// Extract the actual name.
wxString fName = mTrackNames[mTrackNames.GetCount() - 1].AfterFirst(wxT('-')).Mid(1);
wxString fName = mTrackNames[mTrackNames.size() - 1].AfterFirst(wxT('-')).Mid(1);
fName = FileNames::SelectFile(FileNames::Operation::Export,
_("Export Labels As:"),