From: Steve Brokenshire Date: Wed, 1 Jun 2016 22:52:10 +0000 (+0100) Subject: Added GEO property for saving data from a CalendarEventObject. X-Git-Tag: release-0.02~246 X-Git-Url: http://Server1/repobrowser/?a=commitdiff_plain;h=5437997ccd50ef7ad5a1307ddf316e4762703ef3;p=xestiacalendar%2F.git Added GEO property for saving data from a CalendarEventObject. Added the code and unit tests for the GEO property. --- 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";