From: Steve Brokenshire Date: Wed, 11 Jan 2017 19:58:05 +0000 (+0000) Subject: CalendarObject: Update code X-Git-Tag: release-0.02~25 X-Git-Url: http://Server1/repobrowser/?a=commitdiff_plain;h=c1695c7e62609eadcb15afdf2316b2321a7da9b9;p=xestiacalendar%2F.git CalendarObject: Update code --- diff --git a/source/objects/calendarobject/CalendarObject-Save.cpp b/source/objects/calendarobject/CalendarObject-Save.cpp index 895cacb..4142495 100644 --- a/source/objects/calendarobject/CalendarObject-Save.cpp +++ b/source/objects/calendarobject/CalendarObject-Save.cpp @@ -20,8 +20,6 @@ CalendarObjectSaveResult CalendarObject::SaveFile(string SaveFilename){ return CALENDAROBJECTSAVE_CANNOTOPEN; } - FileStream.close(); - // Process the data into a string. CalendarObjectSaveResult SaveResult = CALENDAROBJECTSAVE_UNITTESTFAIL; @@ -29,6 +27,10 @@ CalendarObjectSaveResult CalendarObject::SaveFile(string SaveFilename){ SaveResult = SaveString(&SaveStringData); + FileStream.write(SaveStringData.c_str(), SaveStringData.size()); + + FileStream.close(); + return SaveResult; } @@ -90,12 +92,14 @@ CalendarObjectSaveResult CalendarObject::SaveString(string *SaveStringData){ *SaveStringData += "PRODID:-//Xestia//Calendar Version "; *SaveStringData += XSDCAL_VERSION; - *SaveStringData += "\n"; + *SaveStringData += "//KW\n"; #endif SaveObjectData(SaveStringData); *SaveStringData += "END:VCALENDAR"; + + return CALENDAROBJECTSAVE_OK; } \ No newline at end of file