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