From 37d1e74edfa20b80088ceeb2dd7a43aa80c4eb18 Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Tue, 28 Jun 2016 22:38:56 +0100 Subject: [PATCH] Made FN used ProcessData to add data and then append to SaveData --- .../cdo/ContactDataObject-Save.cpp | 39 +++++++++++-------- 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/source/contacteditor/cdo/ContactDataObject-Save.cpp b/source/contacteditor/cdo/ContactDataObject-Save.cpp index 3673839..01af8ed 100644 --- a/source/contacteditor/cdo/ContactDataObject-Save.cpp +++ b/source/contacteditor/cdo/ContactDataObject-Save.cpp @@ -44,17 +44,19 @@ ContactSaveStatus ContactDataObject::SaveString(wxString *SaveData){ // Process FN. + wxString ProcessData = ""; + for (std::map::iterator FNIter = FullNamesList.begin(); FNIter != FullNamesList.end(); FNIter++){ - SaveData->Append("FN"); + ProcessData.Append("FN"); // Check if there is a value for TYPE. if (FullNamesListType[FNIter->first].size() > 0){ - SaveData->Append(";TYPE="); - SaveData->Append(FullNamesListType[FNIter->first]); + ProcessData.Append(";TYPE="); + ProcessData.Append(FullNamesListType[FNIter->first]); } @@ -62,8 +64,8 @@ ContactSaveStatus ContactDataObject::SaveString(wxString *SaveData){ if (FullNamesListLanguage[FNIter->first].size() > 0){ - SaveData->Append(";LANGUAGE="); - SaveData->Append(FullNamesListLanguage[FNIter->first]); + ProcessData.Append(";LANGUAGE="); + ProcessData.Append(FullNamesListLanguage[FNIter->first]); } @@ -71,8 +73,8 @@ ContactSaveStatus ContactDataObject::SaveString(wxString *SaveData){ if (FullNamesListAltID[FNIter->first].size() > 0){ - SaveData->Append(";ALTID="); - SaveData->Append(FullNamesListAltID[FNIter->first]); + ProcessData.Append(";ALTID="); + ProcessData.Append(FullNamesListAltID[FNIter->first]); } @@ -80,8 +82,8 @@ ContactSaveStatus ContactDataObject::SaveString(wxString *SaveData){ if (FullNamesListPID[FNIter->first].size() > 0){ - SaveData->Append(";PID="); - SaveData->Append(FullNamesListPID[FNIter->first]); + ProcessData.Append(";PID="); + ProcessData.Append(FullNamesListPID[FNIter->first]); } @@ -89,8 +91,8 @@ ContactSaveStatus ContactDataObject::SaveString(wxString *SaveData){ if (FullNamesListPref[FNIter->first] > 0){ - SaveData->Append(";PREF="); - SaveData->Append(wxString::Format("%i", FullNamesListPref[FNIter->first])); + ProcessData.Append(";PREF="); + ProcessData.Append(wxString::Format("%i", FullNamesListPref[FNIter->first])); } @@ -98,14 +100,19 @@ ContactSaveStatus ContactDataObject::SaveString(wxString *SaveData){ if (FullNamesListTokens[FNIter->first].size() > 0){ - SaveData->Append(";"); - SaveData->Append(FullNamesListTokens[FNIter->first]); + ProcessData.Append(";"); + ProcessData.Append(FullNamesListTokens[FNIter->first]); } - SaveData->Append(":"); - SaveData->Append(FNIter->second); - SaveData->Append("\n"); + ProcessData.Append(":"); + ProcessData.Append(FNIter->second); + ProcessData.Append("\n"); + + ProcessData = OutputText(&ProcessData); + + SaveData->Append(ProcessData); + ProcessData.clear(); } -- 2.39.5