From cf2f3f98a4811668f9e9d0d5f44ea5b51d268cef Mon Sep 17 00:00:00 2001 From: zautrix Date: Sat, 10 Jul 2004 17:03:16 +0000 Subject: Fixed some problems with the recurrence --- (limited to 'libkcal/recurrence.cpp') diff --git a/libkcal/recurrence.cpp b/libkcal/recurrence.cpp index 5fc5d1f..dd74e10 100644 --- a/libkcal/recurrence.cpp +++ b/libkcal/recurrence.cpp @@ -654,7 +654,7 @@ void Recurrence::addMonthlyPos_(short _rPos, const QBitArray &_rDays) void Recurrence::addMonthlyDay(short _rDay) { - if (mRecurReadOnly || recurs != rMonthlyDay + if (mRecurReadOnly || (recurs != rMonthlyDay && recurs != rYearlyMonth) || _rDay == 0 || _rDay > 31 || _rDay < -31) // invalid day number return; for (int* it = rMonthDays.first(); it; it = rMonthDays.next()) { @@ -725,7 +725,20 @@ const QPtrList &Recurrence::yearNums() const { return rYearNums; } - +void Recurrence::addYearlyMonth(short _rPos ) +{ + if (mRecurReadOnly || recurs != rYearlyMonth) // invalid day/month number + return; + rMonthPos *tmpPos = new rMonthPos; + if ( _rPos > 0) { + tmpPos->rPos = _rPos; + tmpPos->negative = false; + } else { + tmpPos->rPos = -_rPos; // take abs() + tmpPos->negative = true; + } + rMonthPositions.append(tmpPos); +} void Recurrence::addYearlyNum(short _rNum) { if (mRecurReadOnly -- cgit v0.9.0.2