Print Page | Close Window

Cosmetic 'bug' in CXTPPropertyGridItemDate

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Property Grid
Forum Description: Topics Related to Codejock Property Grid
URL: http://forum.codejock.com/forum_posts.asp?TID=6404
Printed Date: 22 November 2024 at 10:46am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Cosmetic 'bug' in CXTPPropertyGridItemDate
Posted By: mgampi
Subject: Cosmetic 'bug' in CXTPPropertyGridItemDate
Date Posted: 13 February 2007 at 2:40pm
Hi,
After a few hours of debugging I found a 'cosmetic bug' in CXTPPropertyGridItemDate::SetValue(). When CXTPPropertyGridItemDate::ParseDateTime fails, SetValue() uses COleDateTime::ParseDateTime() to get a result. This function uses the locale ID provided as third parameter to determine the string format. The function only succeeds, when the string format is in Russian date format. I believe this should be changed to LANG_USER_DEFAULT.
I also suggest to NLS enable the date item by default to prevent from always calling SetDateFormat() and SetMask() to get locale dependant date entry.

void CXTPPropertyGridItemDate::SetValue(CString strValue)

{
    COleDateTime dt;
    TRY
    {
        if (ParseDateTime(dt, strValue))
        {
            SetDate(dt);
        }
        else if (dt.ParseDateTime(strValue, VAR_DATEVALUEONLY, LANG_RUSSIAN))


-------------
Martin

Product: Xtreme Toolkit v 22.1.0, new Projects v 24.0.0
Platform: Windows 10 v 22H2 (64bit)
Language: VC++ 2022



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net