X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a2ec9439a33e222d2b64911db770a8fb72a0385c..86948c99a6f0fd177b09b3db0ef702739ec62a27:/src/common/cmdline.cpp diff --git a/src/common/cmdline.cpp b/src/common/cmdline.cpp index e75b99c4be..12012e6807 100644 --- a/src/common/cmdline.cpp +++ b/src/common/cmdline.cpp @@ -17,10 +17,6 @@ // headers // ---------------------------------------------------------------------------- -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) - #pragma implementation "cmdline.h" -#endif - // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" @@ -124,7 +120,7 @@ struct wxCmdLineOption void SetStrVal(const wxString& val) { Check(wxCMD_LINE_VAL_STRING); m_strVal = val; m_hasVal = true; } #if wxUSE_DATETIME - void SetDateVal(const wxDateTime val) + void SetDateVal(const wxDateTime& val) { Check(wxCMD_LINE_VAL_DATE); m_dateVal = val; m_hasVal = true; } #endif // wxUSE_DATETIME @@ -170,8 +166,8 @@ WX_DECLARE_OBJARRAY(wxCmdLineParam, wxArrayParams); #include "wx/arrimpl.cpp" -WX_DEFINE_OBJARRAY(wxArrayOptions); -WX_DEFINE_OBJARRAY(wxArrayParams); +WX_DEFINE_OBJARRAY(wxArrayOptions) +WX_DEFINE_OBJARRAY(wxArrayParams) // the parser internal state struct wxCmdLineParserData @@ -245,7 +241,10 @@ void wxCmdLineParserData::SetArguments(const wxString& cmdLine) { m_arguments.clear(); - m_arguments.push_back(wxTheApp ? wxTheApp->argv[0] : _T("")); + if(wxTheApp && wxTheApp->argc > 0) + m_arguments.push_back(wxTheApp->argv[0]); + else + m_arguments.push_back(wxEmptyString); wxArrayString args = wxCmdLineParser::ConvertStringToArgs(cmdLine); @@ -1224,4 +1223,3 @@ wxArrayString wxCmdLineParser::ConvertStringToArgs(const wxChar *p) return args; } -