From: Steve Brokenshire Date: Sun, 5 Jun 2016 22:25:41 +0000 (+0100) Subject: Added SEQUENCE property for saving data from a CalendarJournalObject. X-Git-Tag: release-0.02~190 X-Git-Url: http://Server1/repobrowser/?a=commitdiff_plain;h=6e6ccf0ee2b75766757cb60895afcc9c75691e2d;p=xestiacalendar%2F.git Added SEQUENCE property for saving data from a CalendarJournalObject. Added the code and unit tests for the SEQUENCE property. --- diff --git a/source/objects/calendarjournal/CalendarJournal-Save.cpp b/source/objects/calendarjournal/CalendarJournal-Save.cpp index 2b357fa..44924cc 100644 --- a/source/objects/calendarjournal/CalendarJournal-Save.cpp +++ b/source/objects/calendarjournal/CalendarJournal-Save.cpp @@ -303,6 +303,32 @@ void CalendarJournalObject::SaveObjectData(string *SaveData){ } + // Process the SEQUENCE value. + + if (SequenceData > -1 && SequenceData < 10){ + + DataLine += "SEQUENCE"; + + if (SequenceTokens.size() > 0){ + + DataLine += ";"; + DataLine += SequenceTokens; + + } + + DataLine += ":"; + DataLine += to_string(SequenceData); + DataLine += "\n"; + + DataLineProcessed = OutputText(&DataLine); + + *SaveData += DataLineProcessed; + + DataLine.clear(); + DataLineProcessed.clear(); + + } + *SaveData += "END:VJOURNAL\n"; } \ No newline at end of file diff --git a/source/tests/xestiacalendar_icaljournalsave.h b/source/tests/xestiacalendar_icaljournalsave.h index f60bf8e..13f149b 100644 --- a/source/tests/xestiacalendar_icaljournalsave.h +++ b/source/tests/xestiacalendar_icaljournalsave.h @@ -75,6 +75,7 @@ TEST(iCalendarSaveJournal, SaveEventTests){ " eply@example.com\";LANGUAGE=kw;HAPPY=DAYS:mailto:organiser@example.com\n" "RECURRENCE-ID;TZID=Europe/Truro;RANGE=THISANDFUTURE;VALUE=DATE;EXAMPLE=DATA:2\n" " 0160131\n" + "SEQUENCE;TEST=YAY:7\n" "END:VJOURNAL\n" "END:VCALENDAR";