From 119e1b17abb33cb11a973262f29c4be5b65d9232 Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Mon, 27 Jun 2016 23:18:53 +0100 Subject: [PATCH] Added code for saving data in the ContactDataObject [FN] Code added to the SaveString function of ContactDataObject for saving the FN data. --- .../cdo/ContactDataObject-Save.cpp | 58 ++++++++++++++++++- 1 file changed, 57 insertions(+), 1 deletion(-) diff --git a/source/contacteditor/cdo/ContactDataObject-Save.cpp b/source/contacteditor/cdo/ContactDataObject-Save.cpp index 8a0f2b7..4046edf 100644 --- a/source/contacteditor/cdo/ContactDataObject-Save.cpp +++ b/source/contacteditor/cdo/ContactDataObject-Save.cpp @@ -47,7 +47,63 @@ ContactSaveStatus ContactDataObject::SaveString(wxString *SaveData){ for (std::map::iterator FNIter = FullNamesList.begin(); FNIter != FullNamesList.end(); FNIter++){ - SaveData->Append("FN:"); + SaveData->Append("FN"); + + // Check if there is a value for TYPE. + + if (FullNamesListType[FNIter->first].size() > 0){ + + SaveData->Append(";TYPE="); + SaveData->Append(FullNamesListType[FNIter->first]); + + } + + // Check if there is a value for LANGUAGE. + + if (FullNamesListLanguage[FNIter->first].size() > 0){ + + SaveData->Append(";LANGUAGE="); + SaveData->Append(FullNamesListLanguage[FNIter->first]); + + } + + // Check if there is a value for ALTID. + + if (FullNamesListAltID[FNIter->first].size() > 0){ + + SaveData->Append(";ALTID="); + SaveData->Append(FullNamesListAltID[FNIter->first]); + + } + + // Check if there is a value for PID. + + if (FullNamesListPID[FNIter->first].size() > 0){ + + SaveData->Append(";PID="); + SaveData->Append(FullNamesListPID[FNIter->first]); + + } + + // Check if there is a value for PREF. + + if (FullNamesListPref[FNIter->first] > 0){ + + SaveData->Append(";PREF="); + SaveData->Append(wxString::Format("%i", FullNamesListPref[FNIter->first])); + + } + + // Check if there is a value for tokens. + + if (FullNamesListTokens[FNIter->first].size() > 0){ + + SaveData->Append(";"); + SaveData->Append(FullNamesListTokens[FNIter->first]); + + } + + SaveData->Append(":"); SaveData->Append(FNIter->second); SaveData->Append("\n"); -- 2.39.2