From 92963bc943369de8f795981df31084d2a5a77fc7 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 25 May 2000 14:50:14 +0000 Subject: [PATCH] added missing wxDateSpan methods git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@7486 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/datetime.inl | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/include/wx/datetime.inl b/include/wx/datetime.inl index 756e2fb693..65099bb35f 100644 --- a/include/wx/datetime.inl +++ b/include/wx/datetime.inl @@ -479,6 +479,18 @@ inline wxDateSpan& wxDateSpan::operator+=(const wxDateSpan& other) return *this; } +inline wxDateSpan& wxDateSpan::Add(const wxDateSpan& other) +{ + return *this += other; +} + +inline wxDateSpan wxDateSpan::Add(const wxDateSpan& other) const +{ + wxDateSpan ds(*this); + ds.Add(other); + return ds; +} + inline wxDateSpan& wxDateSpan::Multiply(int factor) { m_years *= factor; @@ -491,7 +503,9 @@ inline wxDateSpan& wxDateSpan::Multiply(int factor) inline wxDateSpan wxDateSpan::Multiply(int factor) const { - return wxDateSpan(*this).Multiply(factor); + wxDateSpan ds(*this); + ds.Multiply(factor); + return ds; } inline wxDateSpan wxDateSpan::Negate() const @@ -509,6 +523,23 @@ inline wxDateSpan& wxDateSpan::Neg() return *this; } +inline wxDateSpan& wxDateSpan::operator-=(const wxDateSpan& other) +{ + return *this += other.Negate(); +} + +inline wxDateSpan& wxDateSpan::Subtract(const wxDateSpan& other) +{ + return *this -= other; +} + +inline wxDateSpan wxDateSpan::Subtract(const wxDateSpan& other) const +{ + wxDateSpan ds(*this); + ds.Subtract(other); + return ds; +} + #undef MILLISECONDS_PER_DAY #undef MODIFY_AND_RETURN