From c1695c7e62609eadcb15afdf2316b2321a7da9b9 Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Wed, 11 Jan 2017 19:58:05 +0000 Subject: [PATCH] CalendarObject: Update code --- source/objects/calendarobject/CalendarObject-Save.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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 -- 2.39.5