1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-04-30 15:49:41 +02:00

More use of std:: style members of wxString...

... replacing:

Length => length
Len => length
This commit is contained in:
Paul Licameli 2019-03-06 14:53:39 -05:00
parent 2db49dc1f0
commit c68e336247
38 changed files with 100 additions and 100 deletions

View File

@ -1016,7 +1016,7 @@ wxString AboutDialog::GetCreditsByRole(AboutDialog::Role role)
// Strip last <br>, if any
if (s.Right(4) == wxT("<br>"))
s = s.Left(s.Length() - 4);
s = s.Left(s.length() - 4);
return s;
}

View File

@ -1756,7 +1756,7 @@ bool AudacityApp::InitTempDir()
wxString temp = wxT("");
#ifdef __WXGTK__
if (tempFromPrefs.Length() > 0 && tempFromPrefs[0] != wxT('/'))
if (tempFromPrefs.length() > 0 && tempFromPrefs[0] != wxT('/'))
tempFromPrefs = wxT("");
#endif
@ -1940,7 +1940,7 @@ bool AudacityApp::CreateSingleInstanceChecker(const wxString &dir)
for (size_t i = 0, cnt = filenames.size(); i < cnt; i++)
{
const wxString param = filenames[i];
sock->WriteMsg((const wxChar *) param, (param.Len() + 1) * sizeof(wxChar));
sock->WriteMsg((const wxChar *) param, (param.length() + 1) * sizeof(wxChar));
}
}
else

View File

@ -512,7 +512,7 @@ void AutoSaveFile::WriteAttr(const wxString & name, const wxString & value)
mBuffer.PutC(FT_String);
WriteName(name);
int len = value.Length() * sizeof(wxChar);
int len = value.length() * sizeof(wxChar);
mBuffer.Write(&len, sizeof(len));
mBuffer.Write(value.wx_str(), len);
@ -580,7 +580,7 @@ void AutoSaveFile::WriteData(const wxString & value)
{
mBuffer.PutC(FT_Data);
int len = value.Length() * sizeof(wxChar);
int len = value.length() * sizeof(wxChar);
mBuffer.Write(&len, sizeof(len));
mBuffer.Write(value.wx_str(), len);
@ -590,7 +590,7 @@ void AutoSaveFile::Write(const wxString & value)
{
mBuffer.PutC(FT_Raw);
int len = value.Length() * sizeof(wxChar);
int len = value.length() * sizeof(wxChar);
mBuffer.Write(&len, sizeof(len));
mBuffer.Write(value.wx_str(), len);
@ -649,8 +649,8 @@ void AutoSaveFile::CheckSpace(wxMemoryOutputStream & os)
void AutoSaveFile::WriteName(const wxString & name)
{
wxASSERT(name.Length() * sizeof(wxChar) <= SHRT_MAX);
short len = name.Length() * sizeof(wxChar);
wxASSERT(name.length() * sizeof(wxChar) <= SHRT_MAX);
short len = name.length() * sizeof(wxChar);
short id;
if (mNames.count(name))

View File

@ -348,7 +348,7 @@ MacroCommandsCatalog::MacroCommandsCatalog( const AudacityProject *project )
wxString squashed = label;
squashed.Replace( " ", "" );
suffix = squashed.Length() < wxMin( 18, mNames[i].Length());
suffix = squashed.length() < wxMin( 18, mNames[i].length());
}
if( suffix )

View File

@ -957,7 +957,7 @@ void MacrosWindow::OnAdd(wxCommandEvent & WXUNUSED(event))
name = d.GetValue().Strip(wxString::both);
if (name.Length() == 0) {
if (name.length() == 0) {
AudacityMessageBox(_("Name must not be blank"),
GetTitle(),
wxOK | wxICON_ERROR,

View File

@ -297,11 +297,11 @@ void BenchmarkDialog::HoldPrint(bool hold)
void BenchmarkDialog::FlushPrint()
{
while(mToPrint.Length() > 100) {
while(mToPrint.length() > 100) {
mText->AppendText(mToPrint.Left(100));
mToPrint = mToPrint.Right(mToPrint.Length() - 100);
mToPrint = mToPrint.Right(mToPrint.length() - 100);
}
if (mToPrint.Length() > 0)
if (mToPrint.length() > 0)
mText->AppendText(mToPrint);
mToPrint = wxT("");
}

View File

@ -138,7 +138,7 @@ wxString FileNames::LowerCaseAppNameInPath( const wxString & dirIn){
// BUG 1577 Capitalisation of Audacity in path...
if( dir.EndsWith( "Audacity" ) )
{
int nChars = dir.Length() - wxString( "Audacity" ).Length();
int nChars = dir.length() - wxString( "Audacity" ).length();
dir = dir.Left( nChars ) + "audacity";
}
return dir;

View File

@ -163,7 +163,7 @@ wxString Internat::ToDisplayString(double numberToConvert,
if (result.Find(decSep) != -1)
{
// Strip trailing zeros, but leave one, and decimal separator.
int pos = result.Length() - 1;
int pos = result.length() - 1;
while ((pos > 1) &&
(result.GetChar(pos) == wxT('0')) &&
(result.GetChar(pos - 1) != decSep))
@ -290,8 +290,8 @@ bool Internat::SanitiseFilename(wxString &name, const wxString &sub)
wxString Internat::StripAccelerators(const wxString &s)
{
wxString result;
result.reserve(s.Length());
for(size_t i = 0; i < s.Length(); i++) {
result.reserve(s.length());
for(size_t i = 0; i < s.length(); i++) {
if (s[i] == '\t')
break;
if (s[i] != '&' && s[i] != '.')

View File

@ -1014,7 +1014,7 @@ bool LabelTrack::CutSelectedText()
left = text.Left(init);
// get right-remaining text
if (cur < (int)text.Length())
if (cur < (int)text.length())
right = text.Mid(cur);
// set title to the combination of the two remainders
@ -1028,7 +1028,7 @@ bool LabelTrack::CutSelectedText()
}
// set cursor positions
mInitialCursorPos = mCurrentCursorPos = left.Length();
mInitialCursorPos = mCurrentCursorPos = left.length();
return true;
}
@ -1082,7 +1082,7 @@ bool LabelTrack::PasteSelectedText(double sel0, double sel1)
}
// Convert control characters to blanks
for (int i = 0; i < (int)text.Length(); i++) {
for (int i = 0; i < (int)text.length(); i++) {
if (wxIscntrl(text[i])) {
text[i] = wxT(' ');
}
@ -1095,11 +1095,11 @@ bool LabelTrack::PasteSelectedText(double sel0, double sel1)
if (init > cur)
std::swap(init, cur);
left = title.Left(init);
if (cur < (int)title.Length())
if (cur < (int)title.length())
right = title.Mid(cur);
title = left + text + right;
mInitialCursorPos = mCurrentCursorPos = left.Length() + text.Length();
mInitialCursorPos = mCurrentCursorPos = left.length() + text.length();
return true;
}
@ -1865,7 +1865,7 @@ bool LabelTrack::OnKeyDown(SelectedRegion &newSel, wxKeyEvent & event)
case WXK_BACK:
{
int len = title.Length();
int len = title.length();
//IF the label is not blank THEN get rid of a letter or letters according to cursor position
if (len > 0)
@ -1895,7 +1895,7 @@ bool LabelTrack::OnKeyDown(SelectedRegion &newSel, wxKeyEvent & event)
case WXK_DELETE:
case WXK_NUMPAD_DELETE:
{
int len = title.Length();
int len = title.length();
//If the label is not blank get rid of a letter according to cursor position
if (len > 0)
@ -1992,7 +1992,7 @@ bool LabelTrack::OnKeyDown(SelectedRegion &newSel, wxKeyEvent & event)
mSelIndex = (mSelIndex + (int)mLabels.size()) % (int)mLabels.size(); // wrap round if necessary
{
LabelStruct &newLabel = mLabels[mSelIndex];
mCurrentCursorPos = newLabel.title.Length();
mCurrentCursorPos = newLabel.title.length();
mInitialCursorPos = mCurrentCursorPos;
//Set the selection region to be equal to the selection bounds of the tabbed-to label.
newSel = newLabel.selectedRegion;
@ -2040,7 +2040,7 @@ bool LabelTrack::OnKeyDown(SelectedRegion &newSel, wxKeyEvent & event)
if (mSelIndex >= 0 && mSelIndex < len) {
const auto &labelStruct = mLabels[mSelIndex];
mCurrentCursorPos = labelStruct.title.Length();
mCurrentCursorPos = labelStruct.title.length();
mInitialCursorPos = mCurrentCursorPos;
//Set the selection region to be equal to the selection bounds of the tabbed-to label.
newSel = labelStruct.selectedRegion;
@ -2267,11 +2267,11 @@ void LabelTrack::RemoveSelectedText()
if (init > 0)
left = title.Left(init);
if (cur < (int)title.Length())
if (cur < (int)title.length())
right = title.Mid(cur);
title = left + right;
mInitialCursorPos = mCurrentCursorPos = left.Length();
mInitialCursorPos = mCurrentCursorPos = left.length();
}
void LabelTrack::Unselect()

View File

@ -109,7 +109,7 @@ wxString GetSystemLanguageCode()
if (info) {
wxString fullCode = info->CanonicalName;
if (fullCode.Length() < 2)
if (fullCode.length() < 2)
return wxT("en");
wxString code = fullCode.Left(2);
@ -238,7 +238,7 @@ void GetLanguages(wxArrayString &langCodes, wxArrayString &langNames)
// name but associate it with the full code. This allows someone
// to drop in a NEW language and still get reasonable behavior.
if (fullCode.Length() < 2)
if (fullCode.length() < 2)
continue;
if (localLanguageName[code] != wxT("")) {

View File

@ -169,7 +169,7 @@ void LyricsPanel::Add(double t, const wxString &syllable, wxString &highlightTex
// same time.
prevSyllable.text += syllable;
prevSyllable.textWithSpace += syllable;
prevSyllable.char1 += syllable.Length();
prevSyllable.char1 += syllable.length();
return;
}
}
@ -179,21 +179,21 @@ void LyricsPanel::Add(double t, const wxString &syllable, wxString &highlightTex
thisSyllable.t = t;
thisSyllable.text = syllable;
thisSyllable.char0 = mText.Length();
thisSyllable.char0 = mText.length();
// Put a space between syllables unless the previous one
// ended in a hyphen
if (i > 0 &&
// mSyllables[i-1].text.Length() > 0 &&
// mSyllables[i-1].text.length() > 0 &&
mSyllables[i - 1].text.Right(1) != wxT("-"))
thisSyllable.textWithSpace = wxT(" ") + syllable;
else
thisSyllable.textWithSpace = syllable;
mText += thisSyllable.textWithSpace;
thisSyllable.char1 = mText.Length();
thisSyllable.char1 = mText.length();
int nTextLen = thisSyllable.textWithSpace.Length();
int nTextLen = thisSyllable.textWithSpace.length();
if ((nTextLen > 0) && (thisSyllable.textWithSpace.Right(1) == wxT("_")))
highlightText += (thisSyllable.textWithSpace.Left(nTextLen - 1) + wxT("\n"));
else
@ -631,8 +631,8 @@ void LyricsPanel::HandlePaint_BouncingBall(wxDC &dc)
}
wxString text = mSyllables[i].text;
if (text.Length() > 0 && text.Right(1) == wxT("_")) {
text = text.Left(text.Length() - 1);
if (text.length() > 0 && text.Right(1) == wxT("_")) {
text = text.Left(text.length() - 1);
}
dc.DrawText(text,

View File

@ -1096,7 +1096,7 @@ wxBitmap* MixerBoard::GetMusicalInstrumentBitmap(const Track* pTrack)
nScore +=
nPointsPerMatch +
// Longer keywords get more points.
(2 * mMusicalInstruments[nInstrIndex]->mKeywords[nKeywordIndex].Length());
(2 * mMusicalInstruments[nInstrIndex]->mKeywords[nKeywordIndex].length());
}
}

View File

@ -3050,7 +3050,7 @@ wxString PluginManager::ConvertID(const PluginID & ID)
if (ID.StartsWith(wxT("base64:")))
{
wxString id = ID.Mid(7);
ArrayOf<char> buf{ id.Length() / 4 * 3 };
ArrayOf<char> buf{ id.length() / 4 * 3 };
id = wxString::FromUTF8(buf.get(), b64decode(id, buf.get()));
return id;
}

View File

@ -1551,7 +1551,7 @@ wxString AudacityProject::GetName()
wxString name = wxFileNameFromPath(mFileName);
// Chop off the extension
size_t len = name.Len();
size_t len = name.length();
if (len > 4 && name.Mid(len - 4) == wxT(".aup"))
name = name.Mid(0, len - 4);
@ -3095,8 +3095,8 @@ void AudacityProject::OpenFile(const wxString &fileNameArg, bool addtohistory)
SetProjectTitle();
const wxString autoSaveExt = wxT(".autosave");
if (mFileName.Length() >= autoSaveExt.Length() &&
mFileName.Right(autoSaveExt.Length()) == autoSaveExt)
if (mFileName.length() >= autoSaveExt.length() &&
mFileName.Right(autoSaveExt.length()) == autoSaveExt)
{
AutoSaveFile asf;
if (!asf.Decode(fileName))
@ -3472,10 +3472,10 @@ bool AudacityProject::HandleXMLTag(const wxChar *tag, const wxChar **attrs)
realFileDir.RemoveLastDir();
wxString realFileName = value;
if (realFileName.Length() >= 5 &&
if (realFileName.length() >= 5 &&
realFileName.Right(5) == wxT("_data"))
{
realFileName = realFileName.Left(realFileName.Length() - 5);
realFileName = realFileName.Left(realFileName.length() - 5);
}
if (realFileName.empty())
@ -3564,7 +3564,7 @@ bool AudacityProject::HandleXMLTag(const wxChar *tag, const wxChar **attrs)
// above is inaccurate.
if (!bFileVersionFound ||
(fileVersion.Length() != 5) || // expecting '1.1.0', for example
(fileVersion.length() != 5) || // expecting '1.1.0', for example
// JKC: I commentted out next line. IsGoodInt is not for
// checking dotted numbers.
//!XMLValueChecker::IsGoodInt(fileVersion) ||
@ -3694,8 +3694,8 @@ void AudacityProject::WriteXML(XMLWriter &xmlFile, bool bWantSaveCopy)
//TIMER_START( "AudacityProject::WriteXML", xml_writer_timer );
// Warning: This block of code is duplicated in Save, for now...
wxString project = mFileName;
if (project.Len() > 4 && project.Mid(project.Len() - 4) == wxT(".aup"))
project = project.Mid(0, project.Len() - 4);
if (project.length() > 4 && project.Mid(project.length() - 4) == wxT(".aup"))
project = project.Mid(0, project.length() - 4);
wxString projName = wxFileNameFromPath(project) + wxT("_data");
// End Warning -DMM
@ -3926,8 +3926,8 @@ bool AudacityProject::DoSave (const bool fromSaveAs,
if (fromSaveAs) {
// This block of code is duplicated in WriteXML, for now...
project = mFileName;
if (project.Len() > 4 && project.Mid(project.Len() - 4) == wxT(".aup"))
project = project.Mid(0, project.Len() - 4);
if (project.length() > 4 && project.Mid(project.length() - 4) == wxT(".aup"))
project = project.Mid(0, project.length() - 4);
projName = wxFileNameFromPath(project) + wxT("_data");
projPath = wxPathOnly(project);

View File

@ -189,7 +189,7 @@ bool Shuttle::TransferEnum( const wxString & Name, int & iValue,
wxString str = mValueString;
if( str.Left( 1 ) == wxT('"') && str.Right( 1 ) == wxT('"') )
{
str = str.Mid( 2, str.Length() - 2 );
str = str.Mid( 2, str.length() - 2 );
}
for( int i = 0; i < nChoices; i++ )
@ -283,7 +283,7 @@ bool ShuttleCli::ExchangeWithMaster(const wxString & Name)
i=mParams.Find( wxT(" ")+Name+wxT("=") );
if( i>=0 )
{
int j=i+2+Name.Length();
int j=i+2+Name.length();
wxString terminator = wxT(' ');
if(mParams.GetChar(j) == wxT('"')) //Strings are surrounded by quotes
{
@ -296,7 +296,7 @@ bool ShuttleCli::ExchangeWithMaster(const wxString & Name)
j++;
}
i=j;
while( j<(int)mParams.Length() && mParams.GetChar(j) != terminator )
while( j<(int)mParams.length() && mParams.GetChar(j) != terminator )
j++;
mValueString = mParams.Mid(i,j-i);
return true;

View File

@ -1302,7 +1302,7 @@ void TrackInfo::CloseTitleDrawFunction
wxCoord textWidth, textHeight;
dc->GetTextExtent(titleStr, &textWidth, &textHeight);
while (textWidth > allowableWidth) {
titleStr = titleStr.Left(titleStr.Length() - 1);
titleStr = titleStr.Left(titleStr.length() - 1);
dc->GetTextExtent(titleStr, &textWidth, &textHeight);
}

View File

@ -261,7 +261,7 @@ BlockFilePtr ODDecodeBlockFile::BuildFromXML(DirManager &dm, const wxChar **attr
if (!wxStricmp(attr, wxT("summaryfile")) &&
// Can't use XMLValueChecker::IsGoodFileName here, but do part of its test.
XMLValueChecker::IsGoodFileString(strValue) &&
(strValue.Length() + 1 + dm.GetProjectDataDir().Length() <= PLATFORM_MAX_PATH))
(strValue.length() + 1 + dm.GetProjectDataDir().length() <= PLATFORM_MAX_PATH))
{
if (!dm.AssignFile(summaryFileName, strValue, false))
// Make sure summaryFileName is back to uninitialized state so we can detect problem later.

View File

@ -295,7 +295,7 @@ BlockFilePtr ODPCMAliasBlockFile::BuildFromXML(DirManager &dm, const wxChar **at
if (!wxStricmp(attr, wxT("summaryfile")) &&
// Can't use XMLValueChecker::IsGoodFileName here, but do part of its test.
XMLValueChecker::IsGoodFileString(strValue) &&
(strValue.Length() + 1 + dm.GetProjectDataDir().Length() <= PLATFORM_MAX_PATH))
(strValue.length() + 1 + dm.GetProjectDataDir().length() <= PLATFORM_MAX_PATH))
{
if (!dm.AssignFile(summaryFileName, strValue, false))
// Make sure summaryFileName is back to uninitialized state so we can detect problem later.

View File

@ -142,7 +142,7 @@ BlockFilePtr PCMAliasBlockFile::BuildFromXML(DirManager &dm, const wxChar **attr
if (!wxStricmp(attr, wxT("summaryfile")) &&
// Can't use XMLValueChecker::IsGoodFileName here, but do part of its test.
XMLValueChecker::IsGoodFileString(strValue) &&
(strValue.Length() + 1 + dm.GetProjectDataDir().Length() <= PLATFORM_MAX_PATH))
(strValue.length() + 1 + dm.GetProjectDataDir().length() <= PLATFORM_MAX_PATH))
{
if (!dm.AssignFile(summaryFileName, strValue, false))
// Make sure summaryFileName is back to uninitialized state so we can detect problem later.

View File

@ -456,7 +456,7 @@ BlockFilePtr SimpleBlockFile::BuildFromXML(DirManager &dm, const wxChar **attrs)
if (!wxStricmp(attr, wxT("filename")) &&
// Can't use XMLValueChecker::IsGoodFileName here, but do part of its test.
XMLValueChecker::IsGoodFileString(strValue) &&
(strValue.Length() + 1 + dm.GetProjectDataDir().Length() <= PLATFORM_MAX_PATH))
(strValue.length() + 1 + dm.GetProjectDataDir().length() <= PLATFORM_MAX_PATH))
{
if (!dm.AssignFile(fileName, strValue, false))
// Make sure fileName is back to uninitialized state so we can detect problem later.

View File

@ -173,7 +173,7 @@ void CommandBuilder::BuildCommand(const wxString &cmdName,
splitAt = cmdParams.Find(wxT(' '))+1;
if (splitAt < 1)
{
splitAt = cmdParams.Len();
splitAt = cmdParams.length();
}
cmdParams = cmdParams.Mid(splitAt);
}

View File

@ -304,7 +304,7 @@ private:
if (keyDown)
{
wxString chars = GetUnicodeString(temp);
for (size_t i = 0, cnt = chars.Length(); i < cnt; i++)
for (size_t i = 0, cnt = chars.length(); i < cnt; i++)
{
temp = event;
temp.SetEventType(wxEVT_CHAR);

View File

@ -159,7 +159,7 @@ public:
if (!v.Convert(&val))
return false;
SetConverted(val);
for(size_t i=0; i != val.Len(); i++)
for(size_t i=0; i != val.length(); i++)
if( val[i] != '0' && val[i] != '1' && val[i] != 'x' && val[i] != 'X')
return false;
return true;

View File

@ -407,7 +407,7 @@ void EffectDtmf::Recalculate()
{
// remember that dtmfDutyCycle is in range (0.0-100.0)
dtmfNTones = (int) dtmfSequence.Length();
dtmfNTones = (int) dtmfSequence.length();
if (dtmfNTones==0) {
// no tones, all zero: don't do anything

View File

@ -369,7 +369,7 @@ void EffectNormalize::PopulateOrExchange(ShuttleGui & S)
wxString prompt1 = _("Normalize peak amplitude to");
#ifdef EXPERIMENTAL_R128_NORM
wxString prompt2 = _("Normalize loudness to");
wxString longerPrompt = ((prompt1.Length() > prompt2.Length()) ? prompt1 : prompt2) + " ";
wxString longerPrompt = ((prompt1.length() > prompt2.length()) ? prompt1 : prompt2) + " ";
#else
wxString longerPrompt = prompt1 + " ";
#endif

View File

@ -1553,7 +1553,7 @@ std::vector<ComponentInterfaceSymbol> NyquistEffect::ParseChoice(const wxString
// un-internationalized names, ignoring leading and trailing spaces
// on each; and the whole may be quoted
auto choices = wxStringTokenize(
text[0] == wxT('"') ? text.Mid(1, text.Length() - 2) : text,
text[0] == wxT('"') ? text.Mid(1, text.length() - 2) : text,
wxT(",")
);
for (auto &choice : choices)
@ -1595,7 +1595,7 @@ wxString NyquistEffect::UnQuote(const wxString &s, bool allowParens,
if (pExtraString)
*pExtraString = wxString{};
int len = s.Length();
int len = s.length();
if (len >= 2 && s[0] == wxT('\"') && s[len - 1] == wxT('\"')) {
auto unquoted = s.Mid(1, len - 2);
return wxGetTranslation( unquoted );
@ -1973,7 +1973,7 @@ bool NyquistEffect::Parse(
// valStr may or may not be a quoted string
ctrl.valStr = len > 5 ? tokens[5] : wxT("");
ctrl.val = GetCtrlValue(ctrl.valStr);
if (ctrl.valStr.Len() > 0 &&
if (ctrl.valStr.length() > 0 &&
(ctrl.valStr[0] == wxT('(') ||
ctrl.valStr[0] == wxT('"')))
ctrl.valStr = UnQuote( ctrl.valStr );
@ -2120,7 +2120,7 @@ bool NyquistEffect::ParseProgram(wxInputStream & stream)
{
bool dollar = false;
wxString line = pgm.ReadLine();
if (line.Length() > 1 &&
if (line.length() > 1 &&
// New in 2.3.0: allow magic comment lines to start with $
// The trick is that xgettext will not consider such lines comments
// and will extract the strings they contain
@ -2144,9 +2144,9 @@ bool NyquistEffect::ParseProgram(wxInputStream & stream)
}
else
{
if(!mFoundType && line.Length() > 0) {
if(!mFoundType && line.length() > 0) {
if (line[0] == wxT('(') ||
(line[0] == wxT('#') && line.Length() > 1 && line[1] == wxT('|')))
(line[0] == wxT('#') && line.length() > 1 && line[1] == wxT('|')))
{
mIsSal = false;
mFoundType = true;

View File

@ -663,7 +663,7 @@ bool Exporter::GetFilename()
}
}
if (mFilename.GetFullPath().Length() >= 256) {
if (mFilename.GetFullPath().length() >= 256) {
AudacityMessageBox(_("Sorry, pathnames longer than 256 characters not supported."));
continue;
}

View File

@ -973,7 +973,7 @@ wxString ExportMultiple::MakeFileName(const wxString &input)
wxString msg;
wxString excluded = ::wxJoin( Internat::GetExcludedCharacters(), wxChar(' ') );
// TODO: For Russian langauge we should have separate cases for 2 and more than 2 letters.
if( excluded.Length() > 1 ){
if( excluded.length() > 1 ){
// i18n-hint: The second %s gives some letters that can't be used.
msg.Printf(_("Label or track \"%s\" is not a legal file name. You cannot use any of: %s\nUse..."), input,
excluded);

View File

@ -534,7 +534,7 @@ ProgressResult FLACImportFileHandle::Import(TrackFactory *trackFactory,
wxString value = mFile->mComments[c].AfterFirst(wxT('='));
if (name.Upper() == wxT("DATE") && !tags->HasTag(TAG_YEAR)) {
long val;
if (value.Length() == 4 && value.ToLong(&val)) {
if (value.length() == 4 && value.ToLong(&val)) {
name = TAG_YEAR;
}
}

View File

@ -27,7 +27,7 @@
bool ImportMIDI(const wxString &fName, NoteTrack * dest)
{
if (fName.Length() <= 4){
if (fName.length() <= 4){
AudacityMessageBox( wxString::Format(
_("Could not open file %s: Filename too short."), fName
) );

View File

@ -370,7 +370,7 @@ ProgressResult OggImportFileHandle::Import(
wxString value = comment.AfterFirst(wxT('='));
if (name.Upper() == wxT("DATE") && !tags->HasTag(TAG_YEAR)) {
long val;
if (value.Length() == 4 && value.ToLong(&val)) {
if (value.length() == 4 && value.ToLong(&val)) {
name = TAG_YEAR;
}
}

View File

@ -667,7 +667,7 @@ void OnApplyMacroDirectly(const CommandContext &context )
#ifdef MACROS_BY_NUMBERS
long item=0;
// Take last three letters (of e.g. Macro007) and convert to a number.
Name.Mid( Name.Length() - 3 ).ToLong( &item, 10 );
Name.Mid( Name.length() - 3 ).ToLong( &item, 10 );
dlg.ApplyMacroToProject( item, false );
#else
dlg.ApplyMacroToProject( Name, false );

View File

@ -138,7 +138,7 @@ auStaticText * SelectionBar::AddTitle( const wxString & Title, wxSizer * pSizer
auStaticText * pTitle = safenew auStaticText(this, Title );
pTitle->SetBackgroundColour( theTheme.Colour( clrMedium ));
pTitle->SetForegroundColour( theTheme.Colour( clrTrackPanelText ) );
pSizer->Add( pTitle,0, wxALIGN_CENTER_VERTICAL | wxRIGHT, (Title.Length() == 1 ) ? 0:5);
pSizer->Add( pTitle,0, wxALIGN_CENTER_VERTICAL | wxRIGHT, (Title.length() == 1 ) ? 0:5);
return pTitle;
}

View File

@ -779,10 +779,10 @@ KeyView::RefreshLines(bool bSort)
// then it has to be the last character in the searchit string,
// and be preceded by nothing or +.
if ((mViewType == ViewByKey) &&
(mFilter.Len() == 1) &&
(mFilter.length() == 1) &&
(!mFilter.IsSameAs(searchit.Last()) ||
((searchit.Len() > 1) &&
((wxString)(searchit.GetChar(searchit.Len() - 2)) != wxT("+")))))
((searchit.length() > 1) &&
((wxString)(searchit.GetChar(searchit.length() - 2)) != wxT("+")))))
{
// Not suitable so continue to next node
continue;

View File

@ -643,12 +643,12 @@ void NumericConverter::ParseFormatString( const wxString & untranslatedFormat)
unsigned int i;
mNtscDrop = false;
for(i=0; i<format.Length(); i++) {
for(i=0; i<format.length(); i++) {
bool handleDelim = false;
bool handleNum = false;
if (format[i] == '|') {
wxString remainder = format.Right(format.Length() - i - 1);
wxString remainder = format.Right(format.length() - i - 1);
if (remainder == wxT("#"))
mScalingFactor = mSampleRate;
@ -657,7 +657,7 @@ void NumericConverter::ParseFormatString( const wxString & untranslatedFormat)
}
else
remainder.ToDouble(&mScalingFactor);
i = format.Length()-1; // force break out of loop
i = format.length()-1; // force break out of loop
if (delimStr != wxT(""))
handleDelim = true;
if (numStr != wxT(""))
@ -675,7 +675,7 @@ void NumericConverter::ParseFormatString( const wxString & untranslatedFormat)
handleNum = true;
}
if (i == format.Length() - 1) {
if (i == format.length() - 1) {
if (numStr != wxT(""))
handleNum = true;
if (delimStr != wxT(""))
@ -691,7 +691,7 @@ void NumericConverter::ParseFormatString( const wxString & untranslatedFormat)
else if (numStr.Right(1) != wxT("*")) {
numStr.ToLong(&range);
}
if (numStr.GetChar(0)=='0' && numStr.Length()>1)
if (numStr.GetChar(0)=='0' && numStr.length()>1)
zeropad = true;
// Hack: always zeropad
@ -716,9 +716,9 @@ void NumericConverter::ParseFormatString( const wxString & untranslatedFormat)
if (handleDelim) {
bool goToFrac = false;
if (!inFrac && delimStr[delimStr.Length()-1]=='.') {
if (!inFrac && delimStr[delimStr.length()-1]=='.') {
goToFrac = true;
if (delimStr.Length() > 1)
if (delimStr.length() > 1)
delimStr = delimStr.BeforeLast('.');
}
@ -756,9 +756,9 @@ void NumericConverter::ParseFormatString( const wxString & untranslatedFormat)
mValueTemplate = wxT("");
mValueTemplate += mPrefix;
for(j=0; j<(int)mPrefix.Length(); j++)
for(j=0; j<(int)mPrefix.length(); j++)
mValueMask += wxT(".");
pos += mPrefix.Length();
pos += mPrefix.length();
for(i = 0; i < mFields.size(); i++) {
mFields[i].pos = pos;
@ -770,9 +770,9 @@ void NumericConverter::ParseFormatString( const wxString & untranslatedFormat)
pos++;
}
pos += mFields[i].label.Length();
pos += mFields[i].label.length();
mValueTemplate += mFields[i].label;
for(j=0; j<(int)mFields[i].label.Length(); j++)
for(j=0; j<(int)mFields[i].label.length(); j++)
mValueMask += wxT(".");
}
}
@ -1397,7 +1397,7 @@ bool NumericTextCtrl::Layout()
memDC.SetFont(*mLabelFont);
memDC.GetTextExtent(mPrefix, &strW, &strH);
x += strW;
pos += mPrefix.Length();
pos += mPrefix.length();
for(i = 0; i < mFields.size(); i++) {
mFields[i].fieldX = x;
@ -1410,7 +1410,7 @@ bool NumericTextCtrl::Layout()
mFields[i].labelX = x;
memDC.GetTextExtent(mFields[i].label, &strW, &strH);
pos += mFields[i].label.Length();
pos += mFields[i].label.length();
x += strW;
mFields[i].fieldW = x;
}

View File

@ -230,7 +230,7 @@ void NumValidatorBase::OnPaste(wxClipboardTextEvent& event)
int pos;
GetCurrentValueAndInsertionPoint(val, pos);
for (size_t i = 0, cnt = toPaste.Length(); i < cnt; i++)
for (size_t i = 0, cnt = toPaste.length(); i < cnt; i++)
{
const wxChar ch = toPaste[i];

View File

@ -42,7 +42,7 @@
// Length check. Is in part about not supplying malicious strings to file functions.
bool XMLValueChecker::IsGoodString(const wxString & str)
{
size_t len = str.Length();
size_t len = str.length();
int nullIndex = str.Find('\0', false);
if ((len <= PLATFORM_MAX_PATH) && // Shouldn't be any reason for longer strings, except intentional file corruption.
(nullIndex == -1)) // No null characters except terminator.
@ -63,7 +63,7 @@ bool XMLValueChecker::IsGoodFileName(const wxString & strFileName, const wxStrin
{
// Test strFileName.
if (!IsGoodFileString(strFileName) ||
(strDirName.Length() + 1 + strFileName.Length() > PLATFORM_MAX_PATH))
(strDirName.length() + 1 + strFileName.length() > PLATFORM_MAX_PATH))
return false;
// Test the corresponding wxFileName.
@ -78,7 +78,7 @@ bool XMLValueChecker::IsGoodFileString(const wxString &str)
// FILENAME_MAX is 260 in MSVC, but inconsistent across platforms,
// sometimes huge, but we use 260 for all platforms.
(str.Length() <= 260) &&
(str.length() <= 260) &&
(str.Find(wxFileName::GetPathSeparator()) == -1)); // No path separator characters.
}
@ -91,7 +91,7 @@ bool XMLValueChecker::IsGoodSubdirName(const wxString & strSubdirName, const wxS
// where an attacker could craft an AUP file with relative pathnames to get to system files, for example.
if (!IsGoodFileString(strSubdirName) ||
(strSubdirName == wxT(".")) || (strSubdirName == wxT("..")) ||
(strDirName.Length() + 1 + strSubdirName.Length() > PLATFORM_MAX_PATH))
(strDirName.length() + 1 + strSubdirName.length() > PLATFORM_MAX_PATH))
return false;
// Test the corresponding wxFileName.
@ -110,7 +110,7 @@ bool XMLValueChecker::IsGoodPathString(const wxString &str)
{
return (IsGoodString(str) &&
!str.empty() &&
(str.Length() <= PLATFORM_MAX_PATH));
(str.length() <= PLATFORM_MAX_PATH));
}
@ -124,8 +124,8 @@ bool XMLValueChecker::IsGoodIntForRange(const wxString & strInt, const wxString
// We're strict about disallowing spaces and commas, and requiring minus sign to be first
// char for negative. No + sign for positive numbers. It's disallowed, not optional.
const size_t lenMAXABS = strMAXABS.Length();
const size_t lenStrInt = strInt.Length();
const size_t lenMAXABS = strMAXABS.length();
const size_t lenStrInt = strInt.length();
if( lenStrInt < 1 )
return false;

View File

@ -226,7 +226,7 @@ void XMLWriter::WriteSubTree(const wxString &value)
wxString XMLWriter::XMLEsc(const wxString & s)
{
wxString result;
int len = s.Length();
int len = s.length();
for(int i=0; i<len; i++) {
wxUChar c = s.GetChar(i);