From 5437997ccd50ef7ad5a1307ddf316e4762703ef3 Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Wed, 1 Jun 2016 23:52:10 +0100 Subject: [PATCH] Added GEO property for saving data from a CalendarEventObject. Added the code and unit tests for the GEO property. --- .../calendarevent/CalendarEvent-Save.cpp | 28 +++++++++++++++++++ source/tests/xestiacalendar_icaleventsave.h | 1 + 2 files changed, 29 insertions(+) diff --git a/source/objects/calendarevent/CalendarEvent-Save.cpp b/source/objects/calendarevent/CalendarEvent-Save.cpp index 849a196..ceeb1c4 100644 --- a/source/objects/calendarevent/CalendarEvent-Save.cpp +++ b/source/objects/calendarevent/CalendarEvent-Save.cpp @@ -284,6 +284,34 @@ void CalendarEventObject::SaveObjectData(string *SaveData){ } + // Process the GEO value. + + if (GeographicData.size() > 0){ + + if (GeographicTokens.size() > 0){ + + DataLine += "GEO;"; + DataLine += GeographicTokens; + + } else { + + DataLine += "GEO"; + + } + + DataLine += ":"; + DataLine += GeographicData; + 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 ef5f60a..b365b11 100644 --- a/source/tests/xestiacalendar_icaleventsave.h +++ b/source/tests/xestiacalendar_icaleventsave.h @@ -82,6 +82,7 @@ TEST(iCalendarSaveEvent, SaveEventTests){ "CREATED;CARAMEL=PLEASE:20160123T081100Z\n" "DESCRIPTION;ALTREP=\"null:nodata\";LANGUAGE=kw;EXAMPLE=TOKEN;MOREDATA=YES:This \n" " is a description of the event.\n" + "GEO;EXAMPLE=MEEP:5.0;5.0\n" "END:VEVENT\n" "END:VCARD"; -- 2.39.5