-rw-r--r-- | libkcal/recurrence.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/libkcal/recurrence.cpp b/libkcal/recurrence.cpp index 5fc5d1f..dd74e10 100644 --- a/libkcal/recurrence.cpp +++ b/libkcal/recurrence.cpp @@ -655,5 +655,5 @@ 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; @@ -726,5 +726,18 @@ const QPtrList<int> &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) { |