1
0
mirror of https://github.com/cookiengineer/audacity synced 2026-02-08 20:52:09 +01:00

Remove needless uses of wxString::c_str() in wxString::Format...

... and similar wx "variadics," which all treat wxString smartly enough that
you don't need this.

Don't need c_str either to convert wxString to const wxChar * because
wxString has a conversion operator that does the same.
This commit is contained in:
Paul Licameli
2017-10-09 01:03:14 -04:00
parent 0efbf6a190
commit 7fd78183d2
76 changed files with 500 additions and 504 deletions

View File

@@ -89,7 +89,7 @@ void XMLWriter::StartTag(const wxString &name)
Write(wxT("\t"));
}
Write(wxString::Format(wxT("<%s"), name.c_str()));
Write(wxString::Format(wxT("<%s"), name));
mTagstack.Insert(name, 0);
mHasKids[0] = true;
@@ -113,7 +113,7 @@ void XMLWriter::EndTag(const wxString &name)
for (i = 0; i < mDepth - 1; i++) {
Write(wxT("\t"));
}
Write(wxString::Format(wxT("</%s>\n"), name.c_str()));
Write(wxString::Format(wxT("</%s>\n"), name));
}
}
else {
@@ -132,8 +132,8 @@ void XMLWriter::WriteAttr(const wxString &name, const wxString &value)
// may throw from Write()
{
Write(wxString::Format(wxT(" %s=\"%s\""),
name.c_str(),
XMLEsc(value).c_str()));
name,
XMLEsc(value)));
}
void XMLWriter::WriteAttr(const wxString &name, const wxChar *value)
@@ -146,7 +146,7 @@ void XMLWriter::WriteAttr(const wxString &name, int value)
// may throw from Write()
{
Write(wxString::Format(wxT(" %s=\"%d\""),
name.c_str(),
name,
value));
}
@@ -154,7 +154,7 @@ void XMLWriter::WriteAttr(const wxString &name, bool value)
// may throw from Write()
{
Write(wxString::Format(wxT(" %s=\"%d\""),
name.c_str(),
name,
value));
}
@@ -162,7 +162,7 @@ void XMLWriter::WriteAttr(const wxString &name, long value)
// may throw from Write()
{
Write(wxString::Format(wxT(" %s=\"%ld\""),
name.c_str(),
name,
value));
}
@@ -170,7 +170,7 @@ void XMLWriter::WriteAttr(const wxString &name, long long value)
// may throw from Write()
{
Write(wxString::Format(wxT(" %s=\"%lld\""),
name.c_str(),
name,
value));
}
@@ -178,7 +178,7 @@ void XMLWriter::WriteAttr(const wxString &name, size_t value)
// may throw from Write()
{
Write(wxString::Format(wxT(" %s=\"%lld\""),
name.c_str(),
name,
(long long) value));
}
@@ -186,16 +186,16 @@ void XMLWriter::WriteAttr(const wxString &name, float value, int digits)
// may throw from Write()
{
Write(wxString::Format(wxT(" %s=\"%s\""),
name.c_str(),
Internat::ToString(value, digits).c_str()));
name,
Internat::ToString(value, digits)));
}
void XMLWriter::WriteAttr(const wxString &name, double value, int digits)
// may throw from Write()
{
Write(wxString::Format(wxT(" %s=\"%s\""),
name.c_str(),
Internat::ToString(value, digits).c_str()));
name,
Internat::ToString(value, digits)));
}
void XMLWriter::WriteData(const wxString &value)
@@ -219,7 +219,7 @@ void XMLWriter::WriteSubTree(const wxString &value)
mHasKids[0] = true;
}
Write(value.c_str());
Write(value);
}
// See http://www.w3.org/TR/REC-xml for reference