corrected bug in wxTimeSpan::IsShorterThan() for equal time spans (ticket #9539)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53988 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2008-06-05 23:51:04 +00:00
parent 82a4610423
commit f7541d4807
2 changed files with 7 additions and 1 deletions

View File

@ -272,6 +272,7 @@ All:
now thread-safe if the standard library provided with your compiler is.
- Added wxCmdLineParser::AddUsageText() (Marcin 'Malcom' Malich).
- Fix reading/writing UTF-7-encoded text streams.
- Corrected bug in wxTimeSpan::IsShorterThan() for equal time spans.
All (Unix):

View File

@ -1433,7 +1433,7 @@ public:
// compare two timestamps: works with the absolute values, i.e. 1
// hour is shorter than -2 hours. Also, it will return false if the
// timespans are equal in absolute value.
bool IsShorterThan(const wxTimeSpan& t) const { return !IsLongerThan(t); }
bool IsShorterThan(const wxTimeSpan& t) const;
inline bool operator<(const wxTimeSpan &ts) const
{
@ -2203,6 +2203,11 @@ inline bool wxTimeSpan::IsLongerThan(const wxTimeSpan& ts) const
return GetValue().Abs() > ts.GetValue().Abs();
}
inline bool wxTimeSpan::IsShorterThan(const wxTimeSpan& ts) const
{
return GetValue().Abs() < ts.GetValue().Abs();
}
// ----------------------------------------------------------------------------
// wxDateSpan
// ----------------------------------------------------------------------------