X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2415cf6725d5cfb11f52d29e5d28dfdaa197b366..bab5e0d028e874cd0b472e583d4ab625f4378495:/include/wx/datetime.h?ds=inline diff --git a/include/wx/datetime.h b/include/wx/datetime.h index 75eb188a9f..3420179e5a 100644 --- a/include/wx/datetime.h +++ b/include/wx/datetime.h @@ -408,7 +408,7 @@ public: // helper classes // ------------------------------------------------------------------------ - // a class representing a time zone: basicly, this is just an offset + // a class representing a time zone: basically, this is just an offset // (in seconds) from GMT class WXDLLIMPEXP_BASE TimeZone { @@ -693,7 +693,7 @@ public: // default assignment operator is ok // calendar calculations (functions which set the date only leave the time - // unchanged, e.g. don't explictly zero it): SetXXX() functions modify the + // unchanged, e.g. don't explicitly zero it): SetXXX() functions modify the // object itself, GetXXX() ones return a new object. // ------------------------------------------------------------------------ @@ -1211,15 +1211,23 @@ public: // if the overloads above were used. // // And then we also have to provide the overloads for wxCStrData, as usual. - wxAnyStrPtr ParseRfc822Date(const wxCStrData& date) - { return ParseRfc822Date(wxString(date)); } + // Unfortunately those ones can't return anything as we don't have any + // sufficiently long-lived wxAnyStrPtr to return from them: any temporary + // strings it would point to would be destroyed when this function returns + // making it impossible to dereference the return value. So we just don't + // return anything from here which at least allows to keep compatibility + // with the code not testing the return value. Other uses of this method + // need to be converted to use one of the new bool-returning overloads + // above. + void ParseRfc822Date(const wxCStrData& date) + { ParseRfc822Date(wxString(date)); } const char* ParseRfc822Date(const char* date); const wchar_t* ParseRfc822Date(const wchar_t* date); - wxAnyStrPtr ParseFormat(const wxCStrData& date, - const wxString& format = wxDefaultDateTimeFormat, - const wxDateTime& dateDef = wxDefaultDateTime) - { return ParseFormat(wxString(date), format, dateDef); } + void ParseFormat(const wxCStrData& date, + const wxString& format = wxDefaultDateTimeFormat, + const wxDateTime& dateDef = wxDefaultDateTime) + { ParseFormat(wxString(date), format, dateDef); } const char* ParseFormat(const char* date, const wxString& format = wxDefaultDateTimeFormat, const wxDateTime& dateDef = wxDefaultDateTime); @@ -1227,18 +1235,18 @@ public: const wxString& format = wxDefaultDateTimeFormat, const wxDateTime& dateDef = wxDefaultDateTime); - wxAnyStrPtr ParseDateTime(const wxCStrData& datetime) - { return ParseDateTime(wxString(datetime)); } + void ParseDateTime(const wxCStrData& datetime) + { ParseDateTime(wxString(datetime)); } const char* ParseDateTime(const char* datetime); const wchar_t* ParseDateTime(const wchar_t* datetime); - wxAnyStrPtr ParseDate(const wxCStrData& date) - { return ParseDate(wxString(date)); } + void ParseDate(const wxCStrData& date) + { ParseDate(wxString(date)); } const char* ParseDate(const char* date); const wchar_t* ParseDate(const wchar_t* date); - wxAnyStrPtr ParseTime(const wxCStrData& time) - { return ParseTime(wxString(time)); } + void ParseTime(const wxCStrData& time) + { ParseTime(wxString(time)); } const char* ParseTime(const char* time); const wchar_t* ParseTime(const wchar_t* time);