From 6a147dfefdf8abe201ee4cb854581d777c29d58e Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 7 Jan 2008 01:20:45 +0000 Subject: [PATCH] compilation fix after wxDateTime::ParseFormat() changes git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@51060 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/generic/gridctrl.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/generic/gridctrl.cpp b/src/generic/gridctrl.cpp index e8da62f564..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.c_str(), 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; } -- 2.45.2