1
0
mirror of https://github.com/cookiengineer/audacity synced 2026-03-18 20:26:32 +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

@@ -439,7 +439,7 @@ void ExtImportPrefs::DoOnRuleTableSelect (int toprow)
PluginList->DeleteAllItems();
int fcount;
fcount = item->filters.Count();
fcount = item->filters.size();
int shift = 0;
for (int i = 0; i < fcount; i++)
{
@@ -493,14 +493,14 @@ void ExtImportPrefs::OnRuleTableEdit (wxGridEvent& event)
switch (col)
{
case 0:
item->extensions.Clear();
item->extensions.clear();
break;
case 1:
item->mime_types.Clear();
item->mime_types.clear();
break;
}
for (size_t i = 0; i < vals.Count(); i++)
for (size_t i = 0; i < vals.size(); i++)
{
wxString trimmed = vals[i];
@@ -529,17 +529,17 @@ Audacity to trim spaces for you?"
switch (col)
{
case 0:
item->extensions.Add (trimmed);
item->extensions.push_back(trimmed);
break;
case 1:
item->mime_types.Add (trimmed);
item->mime_types.push_back(trimmed);
break;
}
}
if (fixSpaces == wxYES)
{
wxString vals_as_string;
for (size_t i = 0; i < vals.Count(); i++)
for (size_t i = 0; i < vals.size(); i++)
{
if (i > 0)
vals_as_string.Append (wxT(":"));
@@ -554,19 +554,19 @@ Audacity to trim spaces for you?"
void ExtImportPrefs::AddItemToTable (int index, const ExtImportItem *item)
{
wxString extensions, mime_types;
if (item->extensions.Count() > 0)
if (item->extensions.size() > 0)
{
extensions.Append (item->extensions[0]);
for (unsigned int i = 1; i < item->extensions.Count(); i++)
for (unsigned int i = 1; i < item->extensions.size(); i++)
{
extensions.Append (wxT(":"));
extensions.Append (item->extensions[i]);
}
}
if (item->mime_types.Count() > 0)
if (item->mime_types.size() > 0)
{
mime_types.Append (item->mime_types[0]);
for (unsigned int i = 1; i < item->mime_types.Count(); i++)
for (unsigned int i = 1; i < item->mime_types.size(); i++)
{
mime_types.Append (wxT(":"));
mime_types.Append (item->mime_types[i]);