X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1d5fda5dc6f875a20210cd6d7f6b5b794519bd52..b96ad10292136c937f71d46ecd7339e59e084c76:/src/generic/gridctrl.cpp diff --git a/src/generic/gridctrl.cpp b/src/generic/gridctrl.cpp index 1dd5e68813..0d69504f65 100644 --- a/src/generic/gridctrl.cpp +++ b/src/generic/gridctrl.cpp @@ -65,7 +65,8 @@ wxString wxGridCellDateTimeRenderer::GetString(const wxGrid& grid, int row, int { void * tempval = table->GetValueAsCustom(row, col,wxGRID_VALUE_DATETIME); - if (tempval){ + if (tempval) + { val = *((wxDateTime *)tempval); hasDatetime = true; delete (wxDateTime *)tempval; @@ -76,13 +77,14 @@ wxString wxGridCellDateTimeRenderer::GetString(const wxGrid& grid, int row, int if (!hasDatetime ) { text = table->GetValue(row, col); - hasDatetime = (val.ParseFormat( text, m_iformat, m_dateDef ) != (wxChar *)NULL) ; + const char * const end = val.ParseFormat(text, m_iformat, m_dateDef); + hasDatetime = end && !*end; } if ( hasDatetime ) text = val.Format(m_oformat, m_tz ); - //If we faild to parse string just show what we where given? + // If we failed to parse string just show what we where given? return text; }