+ FilenameFinal = wxSContactFilename;
+
+ }
+
+ // Setup the data and write it into the account folder.
+
+ // Begin preperations to write the contact to a file.
+
+ bool FNFirst = TRUE;
+ std::map<int,int>::iterator intiter;
+ std::map<int,wxString>::iterator striter;
+
+ ContactData.Add(wxT("BEGIN"), wxT("VCARD"), FALSE);
+ ContactData.Add(wxT("VERSION"), wxT("4.0"), FALSE);
+
+ // Setup the version string.
+
+ strValue.Append(wxT("-//Xestia//Address Book Version "));
+ strValue.Append(wxT(XSDAB_VERSION));
+ strValue.Append(wxT("//KW"));
+
+ ContactData.Add(wxT("PRODID"), strValue, FALSE);
+
+ // Process the REV property.
+
+ wxDateTime DateTimeSave;
+ DateTimeSave = DateTimeSave.SetToCurrent();
+ wxString DateTimeSaveValue;
+
+ DateTimeSaveValue += wxString::Format("%04i", DateTimeSave.GetYear());
+ DateTimeSaveValue += wxString::Format("%02i", (DateTimeSave.GetMonth() + 1));
+ DateTimeSaveValue += wxString::Format("%02i", DateTimeSave.GetDay());
+ DateTimeSaveValue += "T";
+ DateTimeSaveValue += wxString::Format("%02i", DateTimeSave.GetHour());
+ DateTimeSaveValue += wxString::Format("%02i", DateTimeSave.GetMinute());
+ DateTimeSaveValue += wxString::Format("%02i", DateTimeSave.GetSecond());
+
+ if (!ContactEditorData.RevisionTokens.IsEmpty()){
+
+ ContactData.AddRaw("REV;" + ContactEditorData.RevisionTokens, DateTimeSaveValue);
+
+ } else {
+
+ ContactData.AddRaw("REV", DateTimeSaveValue);
+
+ }
+
+ // Process the XML properties.
+
+ for (std::map<int,wxString>::iterator iter = ContactEditorData.XMLList.begin();
+ iter != ContactEditorData.XMLList.end(); ++iter){
+
+ wxString strOrigValue;
+
+ strOrigValue = ContactEditorData.XMLList.find(iter->first)->second;
+
+ ResetUnusedString(&strOrigValue);
+
+ ProcessSaveData(wxT("XML"), &strValue2, &boolValue2, &boolValue,
+ &iter, &strOrigValue, &ContactData,
+ wxT("ALTID"), &ContactEditorData.XMLListAltID );