author | zautrix <zautrix> | 2004-07-10 17:03:16 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-07-10 17:03:16 (UTC) |
commit | cf2f3f98a4811668f9e9d0d5f44ea5b51d268cef (patch) (side-by-side diff) | |
tree | 963322cd4c539c084feb43dfde5eabe52ae4385f /libkcal/recurrence.cpp | |
parent | 8cc6d456812b5a9a386e81c9e46baccd56029537 (diff) | |
download | kdepimpi-cf2f3f98a4811668f9e9d0d5f44ea5b51d268cef.zip kdepimpi-cf2f3f98a4811668f9e9d0d5f44ea5b51d268cef.tar.gz kdepimpi-cf2f3f98a4811668f9e9d0d5f44ea5b51d268cef.tar.bz2 |
Fixed some problems with the recurrence
-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 @@ -651,13 +651,13 @@ void Recurrence::addMonthlyPos_(short _rPos, const QBitArray &_rDays) if (mParent) mParent->updated(); } 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()) { if (_rDay == *it) return; // this day is already in the list - avoid duplication } @@ -722,13 +722,26 @@ void Recurrence::addYearlyMonthPos(short _rPos, const QBitArray &_rDays) } 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) { if (mRecurReadOnly || (recurs != rYearlyMonth && recurs != rYearlyDay && recurs != rYearlyPos) || _rNum <= 0) // invalid day/month number return; |