Source cleaning: whitespaces, tabs, TRUE/true, FALSE/false, -1/wxID_ANY/wxDefaultCoord, !!/!IsEmpty().
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29077 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -171,7 +171,7 @@ public:
|
||||
{
|
||||
wxDateTimeHolidayAuthority::AddAuthority(new wxDateTimeWorkDays);
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
virtual void OnExit()
|
||||
@@ -275,8 +275,8 @@ wxDateTime::wxDateTime_t GetNumOfDaysInMonth(int year, wxDateTime::Month month)
|
||||
static int GetTimeZone()
|
||||
{
|
||||
#ifdef WX_GMTOFF_IN_TM
|
||||
// set to TRUE when the timezone is set
|
||||
static bool s_timezoneSet = FALSE;
|
||||
// set to true when the timezone is set
|
||||
static bool s_timezoneSet = false;
|
||||
static long gmtoffset = LONG_MAX; // invalid timezone
|
||||
|
||||
// ensure that the timezone variable is set by calling localtime
|
||||
@@ -288,7 +288,7 @@ static int GetTimeZone()
|
||||
struct tm *tm;
|
||||
|
||||
tm = localtime(&t);
|
||||
s_timezoneSet = TRUE;
|
||||
s_timezoneSet = true;
|
||||
|
||||
// note that GMT offset is the opposite of time zone and so to return
|
||||
// consistent results in both WX_GMTOFF_IN_TM and !WX_GMTOFF_IN_TM
|
||||
@@ -500,7 +500,7 @@ static bool GetNumericToken(size_t len, const wxChar*& p, unsigned long *number)
|
||||
break;
|
||||
}
|
||||
|
||||
return !!s && s.ToULong(number);
|
||||
return !s.IsEmpty() && s.ToULong(number);
|
||||
}
|
||||
|
||||
// scans all alphabetic characters and returns the resulting string
|
||||
@@ -691,7 +691,7 @@ bool wxDateTime::IsLeapYear(int year, wxDateTime::Calendar cal)
|
||||
{
|
||||
wxFAIL_MSG(_T("unknown calendar"));
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1002,7 +1002,7 @@ wxDateTime wxDateTime::GetBeginDST(int year, Country country)
|
||||
dt += wxTimeSpan::Hours(1);
|
||||
|
||||
// disable DST tests because it could result in an infinite recursion!
|
||||
dt.MakeGMT(TRUE);
|
||||
dt.MakeGMT(true);
|
||||
}
|
||||
else switch ( country )
|
||||
{
|
||||
@@ -1103,7 +1103,7 @@ wxDateTime wxDateTime::GetEndDST(int year, Country country)
|
||||
dt += wxTimeSpan::Hours(1);
|
||||
|
||||
// disable DST tests because it could result in an infinite recursion!
|
||||
dt.MakeGMT(TRUE);
|
||||
dt.MakeGMT(true);
|
||||
}
|
||||
else switch ( country )
|
||||
{
|
||||
@@ -1662,10 +1662,10 @@ bool wxDateTime::SetToTheWeek(wxDateTime_t numWeek,
|
||||
if ( GetYear() != year )
|
||||
{
|
||||
// oops... numWeek was too big
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
wxDateTime& wxDateTime::SetToLastMonthDay(Month month,
|
||||
@@ -1770,9 +1770,9 @@ bool wxDateTime::SetToWeekDay(WeekDay weekday,
|
||||
Month month,
|
||||
int year)
|
||||
{
|
||||
wxCHECK_MSG( weekday != Inv_WeekDay, FALSE, _T("invalid weekday") );
|
||||
wxCHECK_MSG( weekday != Inv_WeekDay, false, _T("invalid weekday") );
|
||||
|
||||
// we don't check explicitly that -5 <= n <= 5 because we will return FALSE
|
||||
// we don't check explicitly that -5 <= n <= 5 because we will return false
|
||||
// anyhow in such case - but may be should still give an assert for it?
|
||||
|
||||
// take the current month/year if none specified
|
||||
@@ -1824,12 +1824,12 @@ bool wxDateTime::SetToWeekDay(WeekDay weekday,
|
||||
{
|
||||
*this = dt;
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
// no such day in this month
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2087,17 +2087,17 @@ wxString wxDateTime::Format(const wxChar *format, const TimeZone& tz) const
|
||||
fmt = _T("%02d");
|
||||
}
|
||||
|
||||
bool restart = TRUE;
|
||||
bool restart = true;
|
||||
while ( restart )
|
||||
{
|
||||
restart = FALSE;
|
||||
restart = false;
|
||||
|
||||
// start of the format specification
|
||||
switch ( *p )
|
||||
{
|
||||
case _T('a'): // a weekday name
|
||||
case _T('A'):
|
||||
// second parameter should be TRUE for abbreviated names
|
||||
// second parameter should be true for abbreviated names
|
||||
res += GetWeekDayName(tm.GetWeekDay(),
|
||||
*p == _T('a') ? Name_Abbr : Name_Full);
|
||||
break;
|
||||
@@ -2328,7 +2328,7 @@ wxString wxDateTime::Format(const wxChar *format, const TimeZone& tz) const
|
||||
fmt.Prepend(_T('%'));
|
||||
fmt.Append(_T('d'));
|
||||
|
||||
restart = TRUE;
|
||||
restart = true;
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -2661,17 +2661,17 @@ const wxChar *wxDateTime::ParseFormat(const wxChar *date,
|
||||
unsigned long num;
|
||||
|
||||
// what fields have we found?
|
||||
bool haveWDay = FALSE,
|
||||
haveYDay = FALSE,
|
||||
haveDay = FALSE,
|
||||
haveMon = FALSE,
|
||||
haveYear = FALSE,
|
||||
haveHour = FALSE,
|
||||
haveMin = FALSE,
|
||||
haveSec = FALSE;
|
||||
bool haveWDay = false,
|
||||
haveYDay = false,
|
||||
haveDay = false,
|
||||
haveMon = false,
|
||||
haveYear = false,
|
||||
haveHour = false,
|
||||
haveMin = false,
|
||||
haveSec = false;
|
||||
|
||||
bool hourIsIn12hFormat = FALSE, // or in 24h one?
|
||||
isPM = FALSE; // AM by default
|
||||
bool hourIsIn12hFormat = false, // or in 24h one?
|
||||
isPM = false; // AM by default
|
||||
|
||||
// and the value of the items we have (init them to get rid of warnings)
|
||||
wxDateTime_t sec = 0,
|
||||
@@ -2760,7 +2760,7 @@ const wxChar *wxDateTime::ParseFormat(const wxChar *date,
|
||||
return (wxChar *)NULL;
|
||||
}
|
||||
}
|
||||
haveWDay = TRUE;
|
||||
haveWDay = true;
|
||||
break;
|
||||
|
||||
case _T('b'): // a month name
|
||||
@@ -2774,7 +2774,7 @@ const wxChar *wxDateTime::ParseFormat(const wxChar *date,
|
||||
return (wxChar *)NULL;
|
||||
}
|
||||
}
|
||||
haveMon = TRUE;
|
||||
haveMon = true;
|
||||
break;
|
||||
|
||||
case _T('c'): // locale default date and time representation
|
||||
@@ -2805,7 +2805,7 @@ const wxChar *wxDateTime::ParseFormat(const wxChar *date,
|
||||
Tm tm = dt.GetTm();
|
||||
|
||||
haveDay = haveMon = haveYear =
|
||||
haveHour = haveMin = haveSec = TRUE;
|
||||
haveHour = haveMin = haveSec = true;
|
||||
|
||||
hour = tm.hour;
|
||||
min = tm.min;
|
||||
@@ -2829,7 +2829,7 @@ const wxChar *wxDateTime::ParseFormat(const wxChar *date,
|
||||
|
||||
// we can't check whether the day range is correct yet, will
|
||||
// do it later - assume ok for now
|
||||
haveDay = TRUE;
|
||||
haveDay = true;
|
||||
mday = (wxDateTime_t)num;
|
||||
break;
|
||||
|
||||
@@ -2840,7 +2840,7 @@ const wxChar *wxDateTime::ParseFormat(const wxChar *date,
|
||||
return (wxChar *)NULL;
|
||||
}
|
||||
|
||||
haveHour = TRUE;
|
||||
haveHour = true;
|
||||
hour = (wxDateTime_t)num;
|
||||
break;
|
||||
|
||||
@@ -2851,8 +2851,8 @@ const wxChar *wxDateTime::ParseFormat(const wxChar *date,
|
||||
return (wxChar *)NULL;
|
||||
}
|
||||
|
||||
haveHour = TRUE;
|
||||
hourIsIn12hFormat = TRUE;
|
||||
haveHour = true;
|
||||
hourIsIn12hFormat = true;
|
||||
hour = (wxDateTime_t)(num % 12); // 12 should be 0
|
||||
break;
|
||||
|
||||
@@ -2863,7 +2863,7 @@ const wxChar *wxDateTime::ParseFormat(const wxChar *date,
|
||||
return (wxChar *)NULL;
|
||||
}
|
||||
|
||||
haveYDay = TRUE;
|
||||
haveYDay = true;
|
||||
yday = (wxDateTime_t)num;
|
||||
break;
|
||||
|
||||
@@ -2874,7 +2874,7 @@ const wxChar *wxDateTime::ParseFormat(const wxChar *date,
|
||||
return (wxChar *)NULL;
|
||||
}
|
||||
|
||||
haveMon = TRUE;
|
||||
haveMon = true;
|
||||
mon = (Month)(num - 1);
|
||||
break;
|
||||
|
||||
@@ -2885,7 +2885,7 @@ const wxChar *wxDateTime::ParseFormat(const wxChar *date,
|
||||
return (wxChar *)NULL;
|
||||
}
|
||||
|
||||
haveMin = TRUE;
|
||||
haveMin = true;
|
||||
min = (wxDateTime_t)num;
|
||||
break;
|
||||
|
||||
@@ -2898,7 +2898,7 @@ const wxChar *wxDateTime::ParseFormat(const wxChar *date,
|
||||
return (wxChar *)NULL; // no am/pm strings defined
|
||||
if ( token.CmpNoCase(pm) == 0 )
|
||||
{
|
||||
isPM = TRUE;
|
||||
isPM = true;
|
||||
}
|
||||
else if ( token.CmpNoCase(am) != 0 )
|
||||
{
|
||||
@@ -2918,7 +2918,7 @@ const wxChar *wxDateTime::ParseFormat(const wxChar *date,
|
||||
return (wxChar *)NULL;
|
||||
}
|
||||
|
||||
haveHour = haveMin = haveSec = TRUE;
|
||||
haveHour = haveMin = haveSec = true;
|
||||
|
||||
Tm tm = dt.GetTm();
|
||||
hour = tm.hour;
|
||||
@@ -2937,7 +2937,7 @@ const wxChar *wxDateTime::ParseFormat(const wxChar *date,
|
||||
return (wxChar *)NULL;
|
||||
}
|
||||
|
||||
haveHour = haveMin = TRUE;
|
||||
haveHour = haveMin = true;
|
||||
|
||||
Tm tm = dt.GetTm();
|
||||
hour = tm.hour;
|
||||
@@ -2951,7 +2951,7 @@ const wxChar *wxDateTime::ParseFormat(const wxChar *date,
|
||||
return (wxChar *)NULL;
|
||||
}
|
||||
|
||||
haveSec = TRUE;
|
||||
haveSec = true;
|
||||
sec = (wxDateTime_t)num;
|
||||
break;
|
||||
|
||||
@@ -2965,7 +2965,7 @@ const wxChar *wxDateTime::ParseFormat(const wxChar *date,
|
||||
return (wxChar *)NULL;
|
||||
}
|
||||
|
||||
haveHour = haveMin = haveSec = TRUE;
|
||||
haveHour = haveMin = haveSec = true;
|
||||
|
||||
Tm tm = dt.GetTm();
|
||||
hour = tm.hour;
|
||||
@@ -2981,7 +2981,7 @@ const wxChar *wxDateTime::ParseFormat(const wxChar *date,
|
||||
return (wxChar *)NULL;
|
||||
}
|
||||
|
||||
haveWDay = TRUE;
|
||||
haveWDay = true;
|
||||
wday = (WeekDay)num;
|
||||
break;
|
||||
|
||||
@@ -2998,7 +2998,7 @@ const wxChar *wxDateTime::ParseFormat(const wxChar *date,
|
||||
{
|
||||
input = result;
|
||||
|
||||
haveDay = haveMon = haveYear = TRUE;
|
||||
haveDay = haveMon = haveYear = true;
|
||||
|
||||
year = 1900 + tm.tm_year;
|
||||
mon = (Month)tm.tm_mon;
|
||||
@@ -3042,7 +3042,7 @@ const wxChar *wxDateTime::ParseFormat(const wxChar *date,
|
||||
|
||||
Tm tm = dt.GetTm();
|
||||
|
||||
haveDay = haveMon = haveYear = TRUE;
|
||||
haveDay = haveMon = haveYear = true;
|
||||
|
||||
year = tm.year;
|
||||
mon = tm.mon;
|
||||
@@ -3064,7 +3064,7 @@ const wxChar *wxDateTime::ParseFormat(const wxChar *date,
|
||||
return (wxChar *)NULL;
|
||||
}
|
||||
|
||||
haveHour = haveMin = haveSec = TRUE;
|
||||
haveHour = haveMin = haveSec = true;
|
||||
|
||||
hour = tm.tm_hour;
|
||||
min = tm.tm_min;
|
||||
@@ -3092,7 +3092,7 @@ const wxChar *wxDateTime::ParseFormat(const wxChar *date,
|
||||
return (wxChar *)NULL;
|
||||
}
|
||||
|
||||
haveHour = haveMin = haveSec = TRUE;
|
||||
haveHour = haveMin = haveSec = true;
|
||||
|
||||
Tm tm = dt.GetTm();
|
||||
hour = tm.hour;
|
||||
@@ -3111,7 +3111,7 @@ const wxChar *wxDateTime::ParseFormat(const wxChar *date,
|
||||
return (wxChar *)NULL;
|
||||
}
|
||||
|
||||
haveYear = TRUE;
|
||||
haveYear = true;
|
||||
|
||||
// TODO should have an option for roll over date instead of
|
||||
// hard coding it here
|
||||
@@ -3125,7 +3125,7 @@ const wxChar *wxDateTime::ParseFormat(const wxChar *date,
|
||||
return (wxChar *)NULL;
|
||||
}
|
||||
|
||||
haveYear = TRUE;
|
||||
haveYear = true;
|
||||
year = (wxDateTime_t)num;
|
||||
break;
|
||||
|
||||
@@ -3342,10 +3342,10 @@ const wxChar *wxDateTime::ParseDate(const wxChar *date)
|
||||
// have the ability to back track.
|
||||
|
||||
// what do we have?
|
||||
bool haveDay = FALSE, // the months day?
|
||||
haveWDay = FALSE, // the day of week?
|
||||
haveMon = FALSE, // the month?
|
||||
haveYear = FALSE; // the year?
|
||||
bool haveDay = false, // the months day?
|
||||
haveWDay = false, // the day of week?
|
||||
haveMon = false, // the month?
|
||||
haveYear = false; // the year?
|
||||
|
||||
// and the value of the items we have (init them to get rid of warnings)
|
||||
WeekDay wday = Inv_WeekDay;
|
||||
@@ -3369,21 +3369,21 @@ const wxChar *wxDateTime::ParseDate(const wxChar *date)
|
||||
{
|
||||
// guess what this number is
|
||||
|
||||
bool isDay = FALSE,
|
||||
isMonth = FALSE,
|
||||
isYear = FALSE;
|
||||
bool isDay = false,
|
||||
isMonth = false,
|
||||
isYear = false;
|
||||
|
||||
if ( !haveMon && val > 0 && val <= 12 )
|
||||
{
|
||||
// assume it is month
|
||||
isMonth = TRUE;
|
||||
isMonth = true;
|
||||
}
|
||||
else // not the month
|
||||
{
|
||||
if ( haveDay )
|
||||
{
|
||||
// this can only be the year
|
||||
isYear = TRUE;
|
||||
isYear = true;
|
||||
}
|
||||
else // may be either day or year
|
||||
{
|
||||
@@ -3395,11 +3395,11 @@ const wxChar *wxDateTime::ParseDate(const wxChar *date)
|
||||
if ( (val == 0) || (val > (unsigned long)maxDays) )
|
||||
{
|
||||
// no
|
||||
isYear = TRUE;
|
||||
isYear = true;
|
||||
}
|
||||
else // yes, suppose it's the day
|
||||
{
|
||||
isDay = TRUE;
|
||||
isDay = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3409,7 +3409,7 @@ const wxChar *wxDateTime::ParseDate(const wxChar *date)
|
||||
if ( haveYear )
|
||||
break;
|
||||
|
||||
haveYear = TRUE;
|
||||
haveYear = true;
|
||||
|
||||
year = (wxDateTime_t)val;
|
||||
}
|
||||
@@ -3418,13 +3418,13 @@ const wxChar *wxDateTime::ParseDate(const wxChar *date)
|
||||
if ( haveDay )
|
||||
break;
|
||||
|
||||
haveDay = TRUE;
|
||||
haveDay = true;
|
||||
|
||||
day = (wxDateTime_t)val;
|
||||
}
|
||||
else if ( isMonth )
|
||||
{
|
||||
haveMon = TRUE;
|
||||
haveMon = true;
|
||||
|
||||
mon = (Month)(val - 1);
|
||||
}
|
||||
@@ -3444,7 +3444,7 @@ const wxChar *wxDateTime::ParseDate(const wxChar *date)
|
||||
// no need to check in month range as always < 12, but
|
||||
// the days are counted from 1 unlike the months
|
||||
day = (wxDateTime_t)mon + 1;
|
||||
haveDay = TRUE;
|
||||
haveDay = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -3456,7 +3456,7 @@ const wxChar *wxDateTime::ParseDate(const wxChar *date)
|
||||
|
||||
mon = mon2;
|
||||
|
||||
haveMon = TRUE;
|
||||
haveMon = true;
|
||||
}
|
||||
else // not a valid month name
|
||||
{
|
||||
@@ -3469,7 +3469,7 @@ const wxChar *wxDateTime::ParseDate(const wxChar *date)
|
||||
break;
|
||||
}
|
||||
|
||||
haveWDay = TRUE;
|
||||
haveWDay = true;
|
||||
}
|
||||
else // not a valid weekday name
|
||||
{
|
||||
@@ -3524,7 +3524,7 @@ const wxChar *wxDateTime::ParseDate(const wxChar *date)
|
||||
break;
|
||||
}
|
||||
|
||||
haveDay = TRUE;
|
||||
haveDay = true;
|
||||
|
||||
day = (wxDateTime_t)(n + 1);
|
||||
}
|
||||
@@ -3567,10 +3567,10 @@ const wxChar *wxDateTime::ParseDate(const wxChar *date)
|
||||
{
|
||||
day = year;
|
||||
|
||||
haveMon = TRUE;
|
||||
haveYear = FALSE;
|
||||
haveMon = true;
|
||||
haveYear = false;
|
||||
}
|
||||
//else: no, can't exchange, leave haveMon == FALSE
|
||||
//else: no, can't exchange, leave haveMon == false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3910,11 +3910,11 @@ bool wxDateTimeHolidayAuthority::IsHoliday(const wxDateTime& dt)
|
||||
{
|
||||
if ( ms_authorities[n]->DoIsHoliday(dt) )
|
||||
{
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
/* static */
|
||||
|
Reference in New Issue
Block a user