Replace "" and wxEmptyString with {} in default argument values

This commit is contained in:
Paul Licameli 2019-03-15 14:28:30 -04:00
parent 2d71cc9d60
commit 135c2a71ce
25 changed files with 85 additions and 85 deletions

View File

@ -67,7 +67,7 @@ with the code that still uses it.
class CommandParameters final : public wxFileConfig
{
public:
CommandParameters(const wxString & parms = wxEmptyString)
CommandParameters(const wxString & parms = {})
: wxFileConfig(wxEmptyString,
wxEmptyString,
wxEmptyString,

View File

@ -1152,7 +1152,7 @@ private:
* and would be neater done once. If the device isn't found, return the
* default device index.
*/
static int getRecordDevIndex(const wxString &devName = wxEmptyString);
static int getRecordDevIndex(const wxString &devName = {});
/** \brief get the index of the device selected in the preferences.
*
* If the device isn't found, returns -1
@ -1168,7 +1168,7 @@ private:
* and would be neater done once. If the device isn't found, return the
* default device index.
*/
static int getPlayDevIndex(const wxString &devName = wxEmptyString);
static int getPlayDevIndex(const wxString &devName = {});
/** \brief Array of audio sample rates to try to use
*

View File

@ -56,7 +56,7 @@ class MacroCommands final {
MacroCommands();
public:
bool ApplyMacro( const MacroCommandsCatalog &catalog,
const wxString & filename = wxT(""));
const wxString & filename = {});
bool ApplyCommand( const wxString &friendlyCommand,
const wxString & command, const wxString & params,
CommandContext const * pContext=NULL );

View File

@ -236,7 +236,7 @@ class AUDACITY_DLL_API LabelTrack final : public Track
const LabelStruct *GetLabel(int index) const;
//This returns the index of the label we just added.
int AddLabel(const SelectedRegion &region, const wxString &title = wxT(""),
int AddLabel(const SelectedRegion &region, const wxString &title = {},
int restoreFocus = -1);
//And this tells us the index, if there is a label already there.
int GetLabelIndex(double t, double t1);

View File

@ -30,11 +30,11 @@ END_EVENT_TABLE()
HighlightTextCtrl::HighlightTextCtrl(LyricsPanel* parent,
wxWindowID id,
const wxString& value /*= ""*/,
const wxString& value /* = {} */,
const wxPoint& pos /*= wxDefaultPosition*/,
const wxSize& size /*= wxDefaultSize*/)
: wxTextCtrl(parent, id, // wxWindow* parent, wxWindowID id,
value, // const wxString& value = "",
value, // const wxString& value = {},
pos, // const wxPoint& pos = wxDefaultPosition,
size, // const wxSize& size = wxDefaultSize,
wxTE_MULTILINE | wxTE_READONLY | wxTE_RICH | wxTE_RICH2 | wxTE_AUTO_URL | wxTE_NOHIDESEL), //v | wxHSCROLL)
@ -97,7 +97,7 @@ LyricsPanel::LyricsPanel(wxWindow* parent, wxWindowID id,
mHighlightTextCtrl =
safenew HighlightTextCtrl(this, -1, // wxWindow* parent, wxWindowID id,
wxT(""), // const wxString& value = wxT(""),
wxT(""), // const wxString& value = {},
wxPoint(0, 0), // const wxPoint& pos = wxDefaultPosition,
size); // const wxSize& size = wxDefaultSize
this->SetHighlightFont();

View File

@ -52,7 +52,7 @@ class HighlightTextCtrl final : public wxTextCtrl
public:
HighlightTextCtrl(LyricsPanel* parent,
wxWindowID id,
const wxString& value = wxT(""),
const wxString& value = {},
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize);
virtual ~HighlightTextCtrl() {};

View File

@ -52,10 +52,10 @@ extern int gMenusDirty;
class AUDACITY_DLL_API AudacityPrefs : public wxFileConfig
{
public:
AudacityPrefs(const wxString& appName = wxEmptyString,
const wxString& vendorName = wxEmptyString,
const wxString& localFilename = wxEmptyString,
const wxString& globalFilename = wxEmptyString,
AudacityPrefs(const wxString& appName = {},
const wxString& vendorName = {},
const wxString& localFilename = {},
const wxString& globalFilename = {},
long style = wxCONFIG_USE_LOCAL_FILE | wxCONFIG_USE_GLOBAL_FILE,
const wxMBConv& conv = wxConvAuto());
bool GetEditClipsCanMove();

View File

@ -274,8 +274,8 @@ class AUDACITY_DLL_API AudacityProject final : public wxFrame,
* @return Array of file paths which the user selected to open (multiple
* selections allowed).
*/
static wxArrayString ShowOpenDialog(const wxString &extraformat = wxEmptyString,
const wxString &extrafilter = wxEmptyString);
static wxArrayString ShowOpenDialog(const wxString &extraformat = {},
const wxString &extrafilter = {});
static bool IsAlreadyOpen(const wxString & projPathName);
static void OpenFiles(AudacityProject *proj);

View File

@ -76,7 +76,7 @@ public:
virtual void Define( float & var, const wxChar * key, const float vdefault, const float vmin, const float vmax, const float vscl=1.0f );
virtual void Define( double & var, const wxChar * key, const float vdefault, const float vmin, const float vmax, const float vscl=1.0f );
virtual void Define( double & var, const wxChar * key, const double vdefault, const double vmin, const double vmax, const double vscl=1.0f );
virtual void Define( wxString &var, const wxChar * key, const wxString vdefault, const wxString vmin="", const wxString vmax="", const wxString vscl="" );
virtual void Define( wxString &var, const wxChar * key, const wxString vdefault, const wxString vmin = {}, const wxString vmax = {}, const wxString vscl = {} );
virtual void DefineEnum( int &var, const wxChar * key, const int vdefault,
const EnumValueSymbol strings[], size_t nStrings );
};

View File

@ -43,7 +43,7 @@ class TimerRecordPathCtrl final : public wxTextCtrl
// the text controls to the Tab Order.
public:
TimerRecordPathCtrl(wxWindow * parent, wxWindowID id, const wxString &value
= wxEmptyString, const wxPoint &pos = wxDefaultPosition, const wxSize &
= {}, const wxPoint &pos = wxDefaultPosition, const wxSize &
size = wxDefaultSize, long style = 0, const wxValidator & validator =
wxDefaultValidator, const wxString & name = wxTextCtrlNameStr)
:wxTextCtrl(parent, id, value, pos, size, style, validator, name) {};

View File

@ -33,7 +33,7 @@ class CommandBuilder
OldStyleCommandPointer mCommand;
wxString mError;
void Failure(const wxString &msg = wxEmptyString);
void Failure(const wxString &msg = {});
void Success(const OldStyleCommandPointer &cmd);
void BuildCommand(const wxString &cmdName, const wxString &cmdParams);
void BuildCommand(const wxString &cmdString);

View File

@ -46,9 +46,9 @@ public:
void EndStruct() const;
void StartField(const wxString &name) const;
void EndField() const;
void AddItem(const wxString &value , const wxString &name="" ) const;
void AddBool(const bool value , const wxString &name="" ) const;
void AddItem(const double value , const wxString &name="" ) const;
void AddItem(const wxString &value , const wxString &name = {} ) const;
void AddBool(const bool value , const wxString &name = {} ) const;
void AddItem(const double value , const wxString &name = {} ) const;
AudacityProject &project;
std::unique_ptr<CommandOutputTargets> pOutput;

View File

@ -83,10 +83,10 @@ public:
virtual void EndArray();
virtual void StartStruct();
virtual void EndStruct();
virtual void AddItem(const wxString &value , const wxString &name="" );
virtual void AddBool(const bool value , const wxString &name="" );
virtual void AddItem(const double value , const wxString &name="" );
virtual void StartField( const wxString &name="" );
virtual void AddItem(const wxString &value , const wxString &name = {} );
virtual void AddBool(const bool value , const wxString &name = {} );
virtual void AddItem(const double value , const wxString &name = {} );
virtual void StartField( const wxString &name = {} );
virtual void EndField( );
virtual void Flush();
wxString Escaped( const wxString & str);
@ -103,13 +103,13 @@ public:
void EndArray() override { mTarget.EndArray();}
void StartStruct() override { mTarget.StartStruct();}
void EndStruct() override { mTarget.EndStruct();}
void AddItem(const wxString &value , const wxString &name="" ) override
void AddItem(const wxString &value , const wxString &name = {} ) override
{ mTarget.AddItem(value,name);}
void AddBool(const bool value , const wxString &name="" ) override
void AddBool(const bool value , const wxString &name = {} ) override
{ mTarget.AddBool(value,name);}
void AddItem(const double value , const wxString &name="" ) override
void AddItem(const double value , const wxString &name = {} ) override
{ mTarget.AddItem(value,name);}
void StartField( const wxString &name="" ) override
void StartField( const wxString &name = {} ) override
{ mTarget.StartField(name);}
void EndField( ) override
{ mTarget.EndField();}
@ -126,10 +126,10 @@ public:
virtual void EndArray() override;
virtual void StartStruct() override;
virtual void EndStruct() override;
virtual void AddItem(const wxString &value , const wxString &name="" )override;
virtual void AddBool(const bool value , const wxString &name="" )override;
virtual void AddItem(const double value , const wxString &name="" )override;
virtual void StartField( const wxString &name="" )override;
virtual void AddItem(const wxString &value , const wxString &name = {} )override;
virtual void AddBool(const bool value , const wxString &name = {} )override;
virtual void AddItem(const double value , const wxString &name = {} )override;
virtual void StartField( const wxString &name = {} )override;
virtual void EndField( ) override;
};
@ -141,10 +141,10 @@ public:
virtual void EndArray() override;
virtual void StartStruct() override;
virtual void EndStruct() override;
virtual void AddItem(const wxString &value , const wxString &name="" )override;
virtual void AddBool(const bool value , const wxString &name="" )override;
virtual void AddItem(const double value , const wxString &name="" )override;
virtual void StartField( const wxString &name="" )override;
virtual void AddItem(const wxString &value , const wxString &name = {} )override;
virtual void AddBool(const bool value , const wxString &name = {} )override;
virtual void AddItem(const double value , const wxString &name = {} )override;
virtual void StartField( const wxString &name = {} )override;
virtual void EndField( ) override;
};
@ -367,17 +367,17 @@ public:
if (mStatusTarget)
mStatusTarget->EndField();
}
void AddItem(const wxString &value , const wxString &name="" )
void AddItem(const wxString &value , const wxString &name = {} )
{
if (mStatusTarget)
mStatusTarget->AddItem( value, name );
}
void AddBool(const bool value , const wxString &name="" )
void AddBool(const bool value , const wxString &name = {} )
{
if (mStatusTarget)
mStatusTarget->AddItem( value, name );
}
void AddItem(const double value , const wxString &name="" )
void AddItem(const double value , const wxString &name = {} )
{
if (mStatusTarget)
mStatusTarget->AddItem( value, name );

View File

@ -180,7 +180,7 @@ class AUDACITY_DLL_API Effect /* not final */ : public wxEvtHandler,
bool HasSharedConfigGroup(const wxString & group) override;
bool GetSharedConfigSubgroups(const wxString & group, wxArrayString & subgroups) override;
bool GetSharedConfig(const wxString & group, const wxString & key, wxString & value, const wxString & defval = wxEmptyString) override;
bool GetSharedConfig(const wxString & group, const wxString & key, wxString & value, const wxString & defval = {}) override;
bool GetSharedConfig(const wxString & group, const wxString & key, int & value, int defval = 0) override;
bool GetSharedConfig(const wxString & group, const wxString & key, bool & value, bool defval = false) override;
bool GetSharedConfig(const wxString & group, const wxString & key, float & value, float defval = 0.0) override;
@ -198,7 +198,7 @@ class AUDACITY_DLL_API Effect /* not final */ : public wxEvtHandler,
bool HasPrivateConfigGroup(const wxString & group) override;
bool GetPrivateConfigSubgroups(const wxString & group, wxArrayString & subgroups) override;
bool GetPrivateConfig(const wxString & group, const wxString & key, wxString & value, const wxString & defval = wxEmptyString) override;
bool GetPrivateConfig(const wxString & group, const wxString & key, wxString & value, const wxString & defval = {}) override;
bool GetPrivateConfig(const wxString & group, const wxString & key, int & value, int defval = 0) override;
bool GetPrivateConfig(const wxString & group, const wxString & key, bool & value, bool defval = false) override;
bool GetPrivateConfig(const wxString & group, const wxString & key, float & value, float defval = 0.0) override;
@ -332,15 +332,15 @@ protected:
// is okay, but don't try to undo).
// Pass a fraction between 0.0 and 1.0
bool TotalProgress(double frac, const wxString & = wxEmptyString);
bool TotalProgress(double frac, const wxString & = {});
// Pass a fraction between 0.0 and 1.0, for the current track
// (when doing one track at a time)
bool TrackProgress(int whichTrack, double frac, const wxString & = wxEmptyString);
bool TrackProgress(int whichTrack, double frac, const wxString & = {});
// Pass a fraction between 0.0 and 1.0, for the current track group
// (when doing stereo groups at a time)
bool TrackGroupProgress(int whichGroup, double frac, const wxString & = wxEmptyString);
bool TrackGroupProgress(int whichGroup, double frac, const wxString & = {});
int GetNumWaveTracks() { return mNumTracks; }
int GetNumWaveGroups() { return mNumGroups; }

View File

@ -78,7 +78,7 @@ public:
class EQCurve
{
public:
EQCurve( const wxString & name = wxEmptyString ) { Name = name; }
EQCurve( const wxString & name = {} ) { Name = name; }
EQCurve( const wxChar * name ) { Name = name; }
bool operator < (const EQCurve &that) const
@ -157,8 +157,8 @@ private:
void EnvelopeUpdated(Envelope *env, bool lin);
bool IsLinear();
void LoadCurves(const wxString &fileName = wxEmptyString, bool append = false);
void SaveCurves(const wxString &fileName = wxEmptyString);
void LoadCurves(const wxString &fileName = {}, bool append = false);
void SaveCurves(const wxString &fileName = {});
// Merge NEW curves only or update all factory presets.
void UpdateDefaultCurves( bool updateAll = false);
void Select(int sel);

View File

@ -79,7 +79,7 @@ public:
private:
// EffectReverb implementation
void SetTitle(const wxString & name = wxT(""));
void SetTitle(const wxString & name = {});
#define SpinSliderHandlers(n) \
void On ## n ## Slider(wxCommandEvent & evt); \

View File

@ -197,7 +197,7 @@ private:
void OnTime(wxCommandEvent & evt);
void OnFileButton(wxCommandEvent & evt);
void resolveFilePath(wxString & path, wxString extension = "");
void resolveFilePath(wxString & path, wxString extension = {});
bool validatePath(wxString path);
wxString ToTimeFormat(double t);

View File

@ -34,7 +34,7 @@ class MousePrefs final : public PrefsPanel
void AddItem(wxString const & buttons,
wxString const & tool,
wxString const & action,
wxString const & comment = wxEmptyString);
wxString const & comment = {});
wxListCtrl * mList;
};

View File

@ -112,7 +112,7 @@ public:
wxWindow *parent,
const wxString& message,
const wxString& caption, // don't use = wxGetTextFromUserPromptStr,
const wxString& value = wxEmptyString,
const wxString& value = {},
long style = wxTextEntryDialogStyle,
const wxPoint& pos = wxDefaultPosition)
: wxTabTraversalWrapper< wxTextEntryDialog>

View File

@ -156,7 +156,7 @@ class ToolBarDialog final : public wxDialogWrapper
ToolBarDialog(wxWindow* parent,
wxWindowID id,
const wxString& name = wxEmptyString,
const wxString& name = {},
const wxPoint& pos = wxDefaultPosition);
~ToolBarDialog();
@ -178,7 +178,7 @@ class ToolBarFrame final : public wxMiniFrame
ToolBarFrame(wxWindow* parent,
wxWindowID id,
const wxString& name = wxEmptyString,
const wxString& name = {},
const wxPoint& pos = wxDefaultPosition);
~ToolBarFrame();

View File

@ -1000,9 +1000,9 @@ ProgressDialog::ProgressDialog()
}
ProgressDialog::ProgressDialog(const wxString & title,
const wxString & message /* = wxEmptyString*/,
const wxString & message /* = {}*/,
int flags /* = pdlgDefaultFlags */,
const wxString & sRemainingLabelText /* = wxEmptyString */)
const wxString & sRemainingLabelText /* = {} */)
: wxDialogWrapper()
{
Create(title, message, flags, sRemainingLabelText);
@ -1011,7 +1011,7 @@ ProgressDialog::ProgressDialog(const wxString & title,
ProgressDialog::ProgressDialog(const wxString & title,
const MessageTable &columns,
int flags /* = pdlgDefaultFlags */,
const wxString & sRemainingLabelText /* = wxEmptyString */)
const wxString & sRemainingLabelText /* = {} */)
: wxDialogWrapper()
{
Create(title, columns, flags, sRemainingLabelText);
@ -1132,9 +1132,9 @@ void ProgressDialog::AddMessageAsColumn(wxBoxSizer * pSizer,
}
bool ProgressDialog::Create(const wxString & title,
const wxString & message /* = wxEmptyString */,
const wxString & message /* = {} */,
int flags /* = pdlgDefaultFlags */,
const wxString & sRemainingLabelText /* = wxEmptyString */)
const wxString & sRemainingLabelText /* = {} */)
{
MessageTable columns(1);
columns.back().push_back(message);
@ -1153,7 +1153,7 @@ bool ProgressDialog::Create(const wxString & title,
bool ProgressDialog::Create(const wxString & title,
const MessageTable & columns,
int flags /* = pdlgDefaultFlags */,
const wxString & sRemainingLabelText /* = wxEmptyString */)
const wxString & sRemainingLabelText /* = {} */)
{
Init();
@ -1638,7 +1638,7 @@ TimerProgressDialog::TimerProgressDialog(const wxLongLong_t duration,
const wxString & title,
const MessageTable & columns,
int flags /* = pdlgDefaultFlags */,
const wxString & sRemainingLabelText /* = wxEmptyString */)
const wxString & sRemainingLabelText /* = {} */)
: ProgressDialog(title, columns, flags, sRemainingLabelText)
{
mDuration = duration;

View File

@ -60,9 +60,9 @@ public:
// Display a simple message.
ProgressDialog(const wxString & title,
const wxString & message = wxEmptyString,
const wxString & message = {},
int flags = pdlgDefaultFlags,
const wxString & sRemainingLabelText = wxEmptyString);
const wxString & sRemainingLabelText = {});
using MessageColumn = std::vector< wxString >;
using MessageTable = std::vector< MessageColumn >;
@ -76,15 +76,15 @@ protected:
ProgressDialog(const wxString & title,
const MessageTable & columns,
int flags = pdlgDefaultFlags,
const wxString & sRemainingLabelText = wxEmptyString);
const wxString & sRemainingLabelText = {});
public:
virtual ~ProgressDialog();
bool Create(const wxString & title,
const wxString & message = wxEmptyString,
const wxString & message = {},
int flags = pdlgDefaultFlags,
const wxString & sRemainingLabelText = wxEmptyString);
const wxString & sRemainingLabelText = {});
void Reinit();
@ -92,16 +92,16 @@ protected:
bool Create(const wxString & title,
const MessageTable & columns,
int flags = pdlgDefaultFlags,
const wxString & sRemainingLabelText = wxEmptyString);
const wxString & sRemainingLabelText = {});
public:
ProgressResult Update(int value, const wxString & message = wxEmptyString);
ProgressResult Update(double current, const wxString & message = wxEmptyString);
ProgressResult Update(double current, double total, const wxString & message = wxEmptyString);
ProgressResult Update(wxULongLong_t current, wxULongLong_t total, const wxString & message = wxEmptyString);
ProgressResult Update(wxLongLong current, wxLongLong total, const wxString & message = wxEmptyString);
ProgressResult Update(wxLongLong_t current, wxLongLong_t total, const wxString & message = wxEmptyString);
ProgressResult Update(int current, int total, const wxString & message = wxEmptyString);
ProgressResult Update(int value, const wxString & message = {});
ProgressResult Update(double current, const wxString & message = {});
ProgressResult Update(double current, double total, const wxString & message = {});
ProgressResult Update(wxULongLong_t current, wxULongLong_t total, const wxString & message = {});
ProgressResult Update(wxLongLong current, wxLongLong total, const wxString & message = {});
ProgressResult Update(wxLongLong_t current, wxLongLong_t total, const wxString & message = {});
ProgressResult Update(int current, int total, const wxString & message = {});
void SetMessage(const wxString & message);
protected:
@ -160,7 +160,7 @@ public:
const wxString &title,
const MessageTable & columns,
int flags = pdlgDefaultFlags,
const wxString & sRemainingLabelText = wxEmptyString);
const wxString & sRemainingLabelText = {});
// Oh no, there is an inherited nullary "Update" in wxDialog!
// Choose another name then...

View File

@ -112,7 +112,7 @@ public:
wxDirDialogWrapper(
wxWindow *parent,
const wxString& message = _("Select a directory"),
const wxString& defaultPath = wxT(""),
const wxString& defaultPath = {},
long style = wxDD_DEFAULT_STYLE,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
@ -126,7 +126,7 @@ public:
void Create(
wxWindow *parent,
const wxString& message = _("Select a directory"),
const wxString& defaultPath = wxT(""),
const wxString& defaultPath = {},
long style = wxDD_DEFAULT_STYLE,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
@ -150,8 +150,8 @@ public:
FileDialogWrapper(
wxWindow *parent,
const wxString& message = _("Select a file"),
const wxString& defaultDir = wxEmptyString,
const wxString& defaultFile = wxEmptyString,
const wxString& defaultDir = {},
const wxString& defaultFile = {},
const wxString& wildCard = wxFileSelectorDefaultWildcardStr,
long style = wxFD_DEFAULT_STYLE,
const wxPoint& pos = wxDefaultPosition,
@ -166,8 +166,8 @@ public:
void Create(
wxWindow *parent,
const wxString& message = _("Select a file"),
const wxString& defaultDir = wxEmptyString,
const wxString& defaultFile = wxEmptyString,
const wxString& defaultDir = {},
const wxString& defaultFile = {},
const wxString& wildCard = wxFileSelectorDefaultWildcardStr,
long style = wxFD_DEFAULT_STYLE,
const wxPoint& pos = wxDefaultPosition,

View File

@ -59,7 +59,7 @@ bool XMLValueChecker::IsGoodLongString(const wxString & str)
// "Good" means the name is well-formed and names an existing file or folder.
bool XMLValueChecker::IsGoodFileName(const wxString & strFileName, const wxString & strDirName /* = "" */)
bool XMLValueChecker::IsGoodFileName(const wxString & strFileName, const wxString & strDirName /* = {} */)
{
// Test strFileName.
if (!IsGoodFileString(strFileName) ||
@ -83,7 +83,7 @@ bool XMLValueChecker::IsGoodFileString(const wxString &str)
(str.Find(wxFileName::GetPathSeparator()) == -1)); // No path separator characters.
}
bool XMLValueChecker::IsGoodSubdirName(const wxString & strSubdirName, const wxString & strDirName /* = "" */)
bool XMLValueChecker::IsGoodSubdirName(const wxString & strSubdirName, const wxString & strDirName /* = {} */)
{
// Test strSubdirName.
// Note this prevents path separators, and relative path to parents (strDirName),

View File

@ -33,9 +33,9 @@ public:
// Labels are allowed to be very long. At some future date we will format long labels nicely.
static bool IsGoodLongString(const wxString & str);
static bool IsGoodFileName(const wxString & strFileName, const wxString & strDirName = wxEmptyString);
static bool IsGoodFileName(const wxString & strFileName, const wxString & strDirName = {});
static bool IsGoodFileString(const wxString &str);
static bool IsGoodSubdirName(const wxString & strSubdirName, const wxString & strDirName = wxEmptyString);
static bool IsGoodSubdirName(const wxString & strSubdirName, const wxString & strDirName = {});
static bool IsGoodPathName(const wxString & strPathName);
static bool IsGoodPathString(const wxString &str);