From 532632a69feb48f5877026b7d3ebfe89d26f5666 Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Thu, 2 Jun 2016 23:07:20 +0100 Subject: [PATCH] Added TRANSP property for saving data from a CalendarEventObject. Added the code and unit tests for the TRANSP property. --- .../calendarevent/CalendarEvent-Save.cpp | 26 +++++++++++++++++++ source/tests/xestiacalendar_icaleventsave.h | 1 + 2 files changed, 27 insertions(+) diff --git a/source/objects/calendarevent/CalendarEvent-Save.cpp b/source/objects/calendarevent/CalendarEvent-Save.cpp index c149557..e66baf8 100644 --- a/source/objects/calendarevent/CalendarEvent-Save.cpp +++ b/source/objects/calendarevent/CalendarEvent-Save.cpp @@ -522,6 +522,32 @@ void CalendarEventObject::SaveObjectData(string *SaveData){ } + // Process the TRANSP value. + + if (TimeTransparencyData.size() > 0){ + + DataLine += "TRANSP"; + + if (TimeTransparencyDataTokens.size() > 0){ + + DataLine += ";"; + DataLine += TimeTransparencyDataTokens; + + } + + DataLine += ":"; + DataLine += TimeTransparencyData; + DataLine += "\n"; + + DataLineProcessed = OutputText(&DataLine); + + *SaveData += DataLineProcessed; + + DataLine.clear(); + DataLineProcessed.clear(); + + } + *SaveData += "END:VEVENT\n"; } \ No newline at end of file diff --git a/source/tests/xestiacalendar_icaleventsave.h b/source/tests/xestiacalendar_icaleventsave.h index 0e92588..5004d12 100644 --- a/source/tests/xestiacalendar_icaleventsave.h +++ b/source/tests/xestiacalendar_icaleventsave.h @@ -90,6 +90,7 @@ TEST(iCalendarSaveEvent, SaveEventTests){ "PRIORITY;STATUS=DEFAULT:5\n" "SEQUENCE;TEST=YAY:3\n" "STATUS;LANGUAGE=kw;FAVOURITE=RICHTEA;NOTLIKE=UNKNOWN:2.0;Success\n" + "TRANSP;OPAQUE=NOTYET:TRANSPARENT\n" "END:VEVENT\n" "END:VCARD"; -- 2.39.5