X-Git-Url: http://Server1/repobrowser/?a=blobdiff_plain;f=source%2Fcontacteditor%2FfrmContactEditor-Save.cpp;h=ffaa5a0845ab347ea1dba93a5cef99e5f4455a73;hb=2b8ca7c8528a738a40d099e2cce5b974bc741699;hp=4f6e12d7350c567edae72987ec542d6e7118cea9;hpb=da64d37d0a13895554e4ad945c46dd0af6d1c0e6;p=xestiaab%2F.git diff --git a/source/contacteditor/frmContactEditor-Save.cpp b/source/contacteditor/frmContactEditor-Save.cpp index 4f6e12d..ffaa5a0 100644 --- a/source/contacteditor/frmContactEditor-Save.cpp +++ b/source/contacteditor/frmContactEditor-Save.cpp @@ -1,6 +1,6 @@ // frmContactEditor-Save.cpp - frmContactEditor save contact subroutines. // -// (c) 2012-2015 Xestia Software Development. +// (c) 2012-2016 Xestia Software Development. // // This file is part of Xestia Address Book. // @@ -29,2304 +29,2582 @@ void frmContactEditor::SaveContact( wxCommandEvent& event ) { - // Check if Display As combo box has a value in it. - // Do not go any further if there is no value. + // Do not save if the account is an unsupported account. + + if (boolUnsupportedAccount == true){ + + wxMessageBox(_("Cannot make changes to a contact from an unsupported account type."), _("Unsupported account"), wxICON_ERROR); + return; + + } + + // Check if Display As combo box has a value in it. + // Do not go any further if there is no value. - wxString cmbDisplayAsValue = cmbDisplayAs->GetValue(); + wxString cmbDisplayAsValue = cmbDisplayAs->GetValue(); - if (cmbDisplayAsValue.IsEmpty()){ + if (cmbDisplayAsValue.IsEmpty()){ - wxMessageBox(_("Display As value cannot be left blank."), _("Display As value empty"), wxICON_ERROR); - return; + wxMessageBox(_("Display As value cannot be left blank."), _("Display As value empty"), wxICON_ERROR); + return; - } + } - // Save the updated contact data. + // Save the updated contact data. - vCard ContactData; - wxString FilenameFinal; - bool ReplaceContact = FALSE; + //vCard ContactData; + wxString FilenameFinal; + bool ReplaceContact = FALSE; - if (StartupEditMode == TRUE){ + if (StartupEditMode == TRUE){ - if (cmbType->GetCurrentSelection() == 1 || - cmbType->GetCurrentSelection() == 3 || - cmbType->GetCurrentSelection() == 4){ + if (cmbType->GetCurrentSelection() == 1 || + cmbType->GetCurrentSelection() == 3 || + cmbType->GetCurrentSelection() == 4){ - if (IsGroup == TRUE){ + if (IsGroup == TRUE){ - // Mark contact for replacing. + // Mark contact for replacing. - ReplaceContact = TRUE; - IsGroup = FALSE; + ReplaceContact = TRUE; + IsGroup = FALSE; - } + } - } else if (cmbType->GetCurrentSelection() == 2){ + } else if (cmbType->GetCurrentSelection() == 2){ - if (IsGroup == FALSE){ + if (IsGroup == FALSE){ - // Mark contact for replacing. + // Mark contact for replacing. - ReplaceContact = TRUE; - IsGroup = TRUE; + ReplaceContact = TRUE; + IsGroup = TRUE; - } + } - } + } - if (ReplaceContact == TRUE){ + if (ReplaceContact == TRUE){ - wxString wxDelSplitFilename; - wxString wxDelFinalFilename; - wxString wxSDelDataURL; - wxStringTokenizer wSTDelFilename(wxSContactFilename, wxT("/")); - while(wSTDelFilename.HasMoreTokens()){ + wxString wxDelSplitFilename; + wxString wxDelFinalFilename; + wxString wxSDelDataURL; + wxStringTokenizer wSTDelFilename(wxSContactFilename, wxT("/")); + + while(wSTDelFilename.HasMoreTokens()){ - wxDelSplitFilename = wSTDelFilename.GetNextToken(); + wxDelSplitFilename = wSTDelFilename.GetNextToken(); - } + } - wxSDelDataURL = wxDelSplitFilename; + wxSDelDataURL = wxDelSplitFilename; - // Delete the contact from the server as it will be useless in certain - // address book clients. + // Delete the contact from the server as it will be useless in certain + // address book clients. - ActMgrPtr->AddTask(2, cmbDisplayAs->GetValue(), wxSContactAccount, wxSDelDataURL, wxDelSplitFilename, wxSContactFilename, wxT("")); + ActMgrPtr->AddTask(2, cmbDisplayAs->GetValue(), wxSContactAccount, wxSDelDataURL, wxDelSplitFilename, wxSContactFilename, wxT("")); - // Clear the filename so the trigger to recreate the UID is done. + // Clear the filename so the trigger to recreate the UID is done. - wxSContactFilename.Clear(); - EditMode = FALSE; + wxSContactFilename.Clear(); + EditMode = FALSE; - } + } - } + } - if (wxSContactFilename.IsEmpty()){ + if (wxSContactFilename.IsEmpty()){ - // Generate a random UUID. + // Generate a random UUID. - UIDToken = GenerateUUID(); - UIDToken = UIDToken.MakeUpper(); + ContactEditorData.UIDToken = GenerateUUID(); + ContactEditorData.UIDToken = ContactEditorData.UIDToken.MakeUpper(); - // Setup the filename. + // Setup the filename. - FilenameFinal = GetAccountDir(wxSContactAccount, FALSE); + FilenameFinal = GetAccountDir(wxSContactAccount, FALSE); #if defined(__HAIKU__) - - //preffilename = wxT("noo"); - + #elif defined(__WIN32__) - FilenameFinal = GetAccountDir(wxSContactAccount, FALSE); - FilenameFinal.Append(UIDToken); - FilenameFinal.Append(wxT(".vcf")); - wxSContactFilename = FilenameFinal; + FilenameFinal = GetAccountDir(wxSContactAccount, FALSE); + FilenameFinal.Append(ContactEditorData.UIDToken); + FilenameFinal.Append(wxT(".vcf")); + wxSContactFilename = FilenameFinal; #else - FilenameFinal = GetAccountDir(wxSContactAccount, FALSE); - FilenameFinal.Append(UIDToken); - FilenameFinal.Append(wxT(".vcf")); - wxSContactFilename = FilenameFinal; + FilenameFinal = GetAccountDir(wxSContactAccount, FALSE); + FilenameFinal.Append(ContactEditorData.UIDToken); + FilenameFinal.Append(wxT(".vcf")); + wxSContactFilename = FilenameFinal; #endif - } else { + } else { - if (UIDToken.IsEmpty()){ + if (ContactEditorData.UIDToken.IsEmpty()){ + + // UID Token is empty. (Shouldn't be). + // Generate a new UID Token. + + ContactEditorData.UIDToken = GenerateUUID(); + ContactEditorData.UIDToken = ContactEditorData.UIDToken.MakeUpper(); + + } + + 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::iterator intiter; + std::map::iterator striter; + + // Set some values for saving. + + ContactEditorData.NameForename = txtForename->GetValue(); + ContactEditorData.NameSurname = txtSurname->GetValue(); + ContactEditorData.NameOtherNames = txtOtherNames->GetValue(); + ContactEditorData.NameTitle = txtTitle->GetValue(); + ContactEditorData.NameSuffix = txtSuffix->GetValue(); + + ContactEditorData.GenderDetails = txtGenderDescription->GetValue(); + + // Process Birthday: Get Day, Month & Year. + + wxDateTime BirthdayDate; + wxDateTime::Month BirthdayMonth; + int BirthdayDay; + int BirthdayYear; + wxString DataBeforeT; + wxString DataAfterT; + wxString FinalBirthdayString; + bool ProcessDataAfterT = FALSE; + + BirthdayDate = dapBirthday->GetValue(); + + if (!txtBirthday->IsEmpty()){ + + // Birthday value is text so use this. + + ContactEditorData.Birthday = txtBirthday->GetValue(); + + } else if (BirthdayDate.IsValid()){ + + BirthdayDay = BirthdayDate.GetDay(); + BirthdayMonth = BirthdayDate.GetMonth(); + BirthdayYear = BirthdayDate.GetYear(); + + // Look for T and replace data before this. + + wxStringTokenizer wSTDate(ContactEditorData.Birthday, wxT("T")); + + while (wSTDate.HasMoreTokens()){ + + if (ProcessDataAfterT == FALSE){ + + DataBeforeT = wSTDate.GetNextToken(); + ProcessDataAfterT = TRUE; + + } else { + + DataAfterT = wSTDate.GetNextToken(); + break; + + } + + } + + // If there is not T then replace altogether. + + wxString FinalBirthdayDay; + wxString FinalBirthdayMonth; + wxString FinalBirthdayYear; + + if (BirthdayDay < 10){ + + FinalBirthdayDay = wxT("0") + wxString::Format(wxT("%i"), BirthdayDay); + + } else { + + FinalBirthdayDay = wxString::Format(wxT("%i"), BirthdayDay); + + } + + if (((int)BirthdayMonth + 1) < 10){ + + FinalBirthdayMonth = wxT("0") + wxString::Format(wxT("%i"), ((int)BirthdayMonth + 1)); + + } else { + + FinalBirthdayMonth = wxString::Format(wxT("%i"), ((int)BirthdayMonth + 1)); + + } + + if (BirthdayYear == 0){ + + FinalBirthdayYear = wxT("--"); + + } else { + + FinalBirthdayYear = wxString::Format(wxT("%i"), BirthdayYear); + + } + + if (!DataAfterT.IsEmpty()){ + + FinalBirthdayString = FinalBirthdayYear + FinalBirthdayMonth + FinalBirthdayDay + wxT("T") + DataAfterT; + + } else { + + FinalBirthdayString = FinalBirthdayYear + FinalBirthdayMonth + FinalBirthdayDay; + + } + + if(!FinalBirthdayString.IsEmpty()){ + + ContactEditorData.Birthday = FinalBirthdayString; + + } + + } + + // Process Anniversary: Get Day, Month & Year. + + wxDateTime AnniversaryDate; + wxDateTime::Month AnniversaryMonth; + int AnniversaryDay; + int AnniversaryYear; + DataBeforeT = ""; + DataAfterT = ""; + wxString FinalAnniversaryString; + ProcessDataAfterT = FALSE; + + AnniversaryDate = dapAnniversary->GetValue(); + + if (!txtAnniversary->IsEmpty()){ + + // Birthday value is text so use this. + + ContactEditorData.Anniversary = txtAnniversary->GetValue(); + + } else if (AnniversaryDate.IsValid()){ + + AnniversaryDay = AnniversaryDate.GetDay(); + AnniversaryMonth = AnniversaryDate.GetMonth(); + AnniversaryYear = AnniversaryDate.GetYear(); + + // Look for T and replace data before this. + + wxStringTokenizer wSTDate(ContactEditorData.Anniversary, wxT("T")); + + while (wSTDate.HasMoreTokens()){ + + if (ProcessDataAfterT == FALSE){ + + DataBeforeT = wSTDate.GetNextToken(); + ProcessDataAfterT = TRUE; + + } else { + + DataAfterT = wSTDate.GetNextToken(); + break; + + } + + } + + // If there is not T then replace altogether. - // UID Token is empty. (Shouldn't be). - // Generate a new UID Token. + wxString FinalAnniversaryDay; + wxString FinalAnniversaryMonth; + wxString FinalAnniversaryYear; + + if (AnniversaryDay < 10){ + + FinalAnniversaryDay = wxT("0") + wxString::Format(wxT("%i"), AnniversaryDay); + + } else { + + FinalAnniversaryDay = wxString::Format(wxT("%i"), AnniversaryDay); + + } - /*boost::uuids::uuid ContactUUID = boost::uuids::random_generator()(); - std::string sstContactUUID = boost::uuids::to_string(ContactUUID); - wxString strContactUUID(sstContactUUID.c_str(), wxConvUTF8); - UIDToken = strContactUUID;*/ - UIDToken = GenerateUUID(); - UIDToken = UIDToken.MakeUpper(); + if (((int)AnniversaryMonth + 1) < 10){ + + FinalAnniversaryMonth = wxT("0") + wxString::Format(wxT("%i"), ((int)AnniversaryMonth + 1)); + + } else { + + FinalAnniversaryMonth = wxString::Format(wxT("%i"), ((int)AnniversaryMonth + 1)); + + } - } - FilenameFinal = wxSContactFilename; + if (AnniversaryYear == 0){ + + FinalAnniversaryYear = wxT("--"); + + } else { + + FinalAnniversaryYear = wxString::Format(wxT("%i"), AnniversaryYear); + + } + + if (!DataAfterT.IsEmpty()){ + + FinalAnniversaryString = FinalAnniversaryYear + FinalAnniversaryMonth + FinalAnniversaryDay + wxT("T") + DataAfterT; + + } else { + + FinalAnniversaryString = FinalAnniversaryYear + FinalAnniversaryMonth + FinalAnniversaryDay; + + } + + if(!FinalAnniversaryString.IsEmpty()){ + + ContactEditorData.Birthday = FinalAnniversaryString; + + } + + } + + // Process full name. + + if (ContactEditorData.FullNamesList.size() > 0){ + + ContactEditorData.FullNamesList[0] = cmbDisplayAs->GetValue(); + + } else { + + ContactEditorData.FullNamesList.insert(std::make_pair(0, cmbDisplayAs->GetValue())); + ContactEditorData.FullNamesListAltID.insert(std::make_pair(0, wxT(""))); + ContactEditorData.FullNamesListPID.insert(std::make_pair(0, wxT(""))); + ContactEditorData.FullNamesListType.insert(std::make_pair(0, wxT(""))); + ContactEditorData.FullNamesListLanguage.insert(std::make_pair(0, wxT(""))); + ContactEditorData.FullNamesListPref.insert(std::make_pair(0, 0)); + ContactEditorData.FullNamesListTokens.insert(std::make_pair(0, wxT(""))); + + } + + /*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::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 ); - } + ResetSaveProcessData(); + + } + + // Process the CLIENTPIDMAP properties. - // Setup the data and write it into the account folder. + for (std::map::iterator iter = ContactEditorData.ClientPIDList.begin(); + iter != ContactEditorData.ClientPIDList.end(); ++iter){ + + wxString strOrigValue; - // Begin preperations to write the contact to a file. + strOrigValue = ContactEditorData.ClientPIDList.find(iter->first)->second; - bool boolValue = FALSE; - bool boolValue2 = FALSE; - bool FNFirst = TRUE; - bool NNGeneralFirst = TRUE; - bool NNHomeFirst = TRUE; - bool NNWorkFirst = TRUE; - int intFNCount = 0; - std::map::iterator intiter; - std::map::iterator striter; + ResetUnusedString(&strOrigValue); + + ProcessSaveData(wxT("CLIENTPIDMAP"), &strValue2, &boolValue2, &boolValue, + &iter, &strOrigValue, &ContactData, + wxT(""), &ContactEditorData.ClientPIDListTokens ); + + ResetSaveProcessData(); + + } - ContactData.Add(wxT("BEGIN"), wxT("VCARD"), FALSE); - ContactData.Add(wxT("VERSION"), wxT("4.0"), FALSE); + // Process the SOURCE properties. - // Setup the version string. + for (std::map::iterator iter = ContactEditorData.SourceList.begin(); + iter != ContactEditorData.SourceList.end(); ++iter){ + + wxString strOrigValue; - strValue.Append(wxT("-//Xestia//Address Book Version ")); - strValue.Append(wxT(XSDAB_VERSION)); - strValue.Append(wxT("//KW")); + strOrigValue = ContactEditorData.SourceList.find(iter->first)->second; - ContactData.Add(wxT("PRODID"), strValue, FALSE); + ResetUnusedString(&strOrigValue); + + ProcessSaveData(wxT("SOURCE"), &strValue2, &boolValue2, &boolValue, + &iter, &strOrigValue, &ContactData, + wxT("ALTID"), &ContactEditorData.SourceListAltID, + wxT("PID"), &ContactEditorData.SourceListPID, + wxT("TYPE"), &ContactEditorData.SourceListType, + wxT("PREF"), &ContactEditorData.SourceListPref, + wxT("MEDIATYPE"), &ContactEditorData.SourceListMediatype, + wxT(""), &ContactEditorData.SourceListTokens ); + + ResetSaveProcessData(); + + } - // Setup the name. + // Setup the name. - strValue.Clear(); + strValue.Clear(); - // Setup the name field. + // Setup the name field. - strValue = txtSurname->GetValue() + wxT(";") + - txtForename->GetValue() + wxT(";") + - txtOtherNames->GetValue() + wxT(";") + - txtTitle->GetValue() + wxT(";") + - txtSuffix->GetValue(); + strValue = txtSurname->GetValue() + wxT(";") + + txtForename->GetValue() + wxT(";") + + txtOtherNames->GetValue() + wxT(";") + + txtTitle->GetValue() + wxT(";") + + txtSuffix->GetValue(); - strValue2 = ContactData.Convert(cmbDisplayAs->GetValue(), FALSE); - strValue2.Trim(); + strValue2 = ContactData.Convert(cmbDisplayAs->GetValue(), FALSE); + strValue2.Trim(); - if (NameTokens.IsEmpty()){ - ContactData.Add(wxT("N;SORT-AS=\"") + strValue2 + wxT("\""), strValue, FALSE); - } else { - ContactData.Add(wxT("N;SORT-AS=\"") + strValue2 + wxT("\";") + NameTokens, strValue, FALSE); - } + if (ContactEditorData.NameTokens.IsEmpty()){ + + ContactData.Add(wxT("N;SORT-AS=\"") + strValue2 + wxT("\""), strValue, FALSE); + + } else { + + ContactData.Add(wxT("N;SORT-AS=\"") + strValue2 + wxT("\";") + ContactEditorData.NameTokens, strValue, FALSE); + + } - if (cmbType->GetCurrentSelection() == 1){ + if (cmbType->GetCurrentSelection() == 1){ - ContactData.AddRaw(wxT("KIND"), wxT("individual")); + ContactData.AddRaw(wxT("KIND"), wxT("individual")); - } else if (cmbType->GetCurrentSelection() == 2){ + } else if (cmbType->GetCurrentSelection() == 2){ - ContactData.AddRaw(wxT("KIND"), wxT("group")); + ContactData.AddRaw(wxT("KIND"), wxT("group")); - // Go through each of the members and write them out. + // Go through each of the members and write them out. - for (std::map::iterator itemiter = GroupsList.begin(); - itemiter != GroupsList.end(); ++itemiter){ + for (std::map::iterator itemiter = ContactEditorData.GroupsList.begin(); + itemiter != ContactEditorData.GroupsList.end(); ++itemiter){ - ContactData.Add(wxT("MEMBER:urn:uuid"), itemiter->second, FALSE); + ContactData.Add(wxT("MEMBER:urn:uuid"), itemiter->second, FALSE); - } + } - } else if (cmbType->GetCurrentSelection() == 3){ + } else if (cmbType->GetCurrentSelection() == 3){ - ContactData.AddRaw(wxT("KIND"), wxT("org")); + ContactData.AddRaw(wxT("KIND"), wxT("org")); - } else if (cmbType->GetCurrentSelection() == 4){ + } else if (cmbType->GetCurrentSelection() == 4){ - ContactData.AddRaw(wxT("KIND"), wxT("location")); + ContactData.AddRaw(wxT("KIND"), wxT("location")); - } - - - // Setup the nicknames (General, Home & Business). + } + + + // Setup the nicknames (General, Home & Business). - strValue.Clear(); - strValue2.Clear(); - strValue3.Clear(); + strValue.Clear(); + strValue2.Clear(); + strValue3.Clear(); - boolValue = FALSE; - boolValue2 = FALSE; - intValue2 = 0; - intValue = 0; + boolValue = FALSE; + boolValue2 = FALSE; + intValue2 = 0; + intValue = 0; - // Setup the gender. + // Setup the gender. - if (cmbGender->GetCurrentSelection() != 0){ + if (cmbGender->GetCurrentSelection() != 0){ - switch(cmbGender->GetCurrentSelection()){ + switch(cmbGender->GetCurrentSelection()){ - case 1: + case 1: - strValue = wxT("M"); - break; + strValue = wxT("M"); + break; - case 2: + case 2: - strValue = wxT("F"); - break; + strValue = wxT("F"); + break; - case 3: + case 3: - strValue = wxT("O"); - break; + strValue = wxT("O"); + break; - case 4: + case 4: - strValue = wxT("N"); - break; + strValue = wxT("N"); + break; - case 5: + case 5: - strValue = wxT("U"); - break; + strValue = wxT("U"); + break; - } + } - } + } - if (!txtGenderDescription->IsEmpty()){ + if (!txtGenderDescription->IsEmpty()){ - strValue2 = txtGenderDescription->GetValue(); + strValue2 = txtGenderDescription->GetValue(); - } + } - if (!strValue.IsEmpty() || !strValue2.IsEmpty()){ + if (!strValue.IsEmpty() || !strValue2.IsEmpty()){ - EscapeString(&strValue2, FALSE); + EscapeString(&strValue2, FALSE); - if (!GenderTokens.IsEmpty()){ + if (!ContactEditorData.GenderTokens.IsEmpty()){ - if (!strValue2.IsEmpty()){ + if (!strValue2.IsEmpty()){ - ContactData.AddRaw(wxT("GENDER;") + GenderTokens, strValue + wxT(";") + strValue2); + ContactData.AddRaw(wxT("GENDER;") + ContactEditorData.GenderTokens, strValue + wxT(";") + strValue2); - } else { + } else { - ContactData.AddRaw(wxT("GENDER;") + GenderTokens, strValue); + ContactData.AddRaw(wxT("GENDER;") + ContactEditorData.GenderTokens, strValue); - } + } - } else { + } else { - if (!strValue2.IsEmpty()){ + if (!strValue2.IsEmpty()){ - ContactData.AddRaw(wxT("GENDER"), strValue + wxT(";") + strValue2); + ContactData.AddRaw(wxT("GENDER"), strValue + wxT(";") + strValue2); - } else { + } else { - ContactData.AddRaw(wxT("GENDER"), strValue); + ContactData.AddRaw(wxT("GENDER"), strValue); - } + } - } + } - } + } - strValue.Clear(); - strValue2.Clear(); - strValue3.Clear(); + ResetSaveProcessData(); - boolValue = FALSE; - boolValue2 = FALSE; - intValue2 = 0; - intValue = 0; + // Build the values for the BDAY property. + + // ALTID + + if (!ContactEditorData.BirthdayAltID.IsEmpty()){ - // Process Label. + wxString DataValue; + DataValue = ContactEditorData.BirthdayAltID; - strValue3 = BirthdayAltID; + EscapeString(&DataValue, FALSE); - if (!strValue3.IsEmpty()){ - - strValue3.Trim(); - strValue3.Trim(); - boolValue2 = TRUE; - strValue2.Append(wxT("ALTID=\"") + strValue3 + wxT("\"")); - - boolValue = TRUE; - - } + strValue3.Append("ALTID="); + strValue3.Append(DataValue); - //strValue3 = ContactData.Convert(GeneralAddressList, FALSE); - //strValue2 = + boolValue2 = TRUE; - // Process Language. + } - strValue3 = BirthdayCalScale; + // CALSCALE. - if (!strValue3.IsEmpty()){ - - strValue3.Trim(); - strValue3.Trim(); - - if (boolValue2 == TRUE){ - - strValue2.Append(wxT(";")); - - } else { - - boolValue2 = TRUE; - - } - - strValue2.Append(wxT("CALSCALE=") + strValue3); - - boolValue = TRUE; - - } + if (!ContactEditorData.BirthdayCalScale.IsEmpty()){ - // Process Tokens. + wxString DataValue; + DataValue = ContactEditorData.BirthdayCalScale; - strValue2 = BirthdayTokens; + EscapeString(&DataValue, FALSE); - // Get the birthday and write it. + if (boolValue2 == TRUE){ + + strValue3.Append(";"); + + } + + strValue3.Append("CALSCALE="); + strValue3.Append(DataValue); + + boolValue2 = TRUE; - ResetSaveProcessData(); + } - if (!txtBirthday->IsEmpty()){ - - strValue = txtBirthday->GetValue(); - - if (!strValue.IsEmpty() || !strValue2.IsEmpty()){ - - if (!strValue2.IsEmpty()){ - - EscapeString(&strValue2, FALSE); - EscapeString(&strValue, FALSE); - - ContactData.AddRaw(wxT("BDAY;VALUE=text;") + strValue2 + wxT(";"), strValue); - - } else { - - EscapeString(&strValue, FALSE); - - ContactData.AddRaw(wxT("BDAY;VALUE=text"), strValue); - - } - - } - - } else { - - // Deal with date. + // Extra tokens. + + if (!ContactEditorData.BirthdayTokens.IsEmpty()){ + + wxString DataValue; + DataValue = ContactEditorData.BirthdayTokens; + + EscapeString(&DataValue, FALSE); + + if (boolValue2 == TRUE){ + + strValue3.Append(";"); + + } + + strValue3.Append(DataValue); + + } + + // Write the BDAY property. + + if (!txtBirthday->IsEmpty()){ + + if (!txtBirthday->GetValue().IsEmpty()){ + + strValue = txtBirthday->GetValue(); + + if (!strValue3.IsEmpty()){ + + ContactData.AddRaw("BDAY;VALUE=text;" + strValue3, strValue); + + } else { + + ContactData.AddRaw("BDAY;VALUE=text", strValue); + + } + + } + + } else { + + // Deal with date. - // Get Day, Month & Year. + // Get Day, Month & Year. - wxDateTime BirthdayDate; - wxDateTime::Month BirthdayMonth; - int BirthdayDay; - int BirthdayYear; - wxString DataBeforeT; - wxString DataAfterT; - wxString FinalBirthdayString; - bool ProcessDataAfterT = FALSE; + wxDateTime BirthdayDate; + wxDateTime::Month BirthdayMonth; + int BirthdayDay; + int BirthdayYear; + wxString DataBeforeT; + wxString DataAfterT; + wxString FinalBirthdayString; + bool ProcessDataAfterT = FALSE; - BirthdayDate = dapBirthday->GetValue(); + BirthdayDate = dapBirthday->GetValue(); - if (BirthdayDate.IsValid()){ + if (BirthdayDate.IsValid()){ - BirthdayDay = BirthdayDate.GetDay(); - BirthdayMonth = BirthdayDate.GetMonth(); - BirthdayYear = BirthdayDate.GetYear(); + BirthdayDay = BirthdayDate.GetDay(); + BirthdayMonth = BirthdayDate.GetMonth(); + BirthdayYear = BirthdayDate.GetYear(); - // Look for T and replace data before this. + // Look for T and replace data before this. - wxStringTokenizer wSTDate(Birthday, wxT("T")); + wxStringTokenizer wSTDate(ContactEditorData.Birthday, wxT("T")); - while (wSTDate.HasMoreTokens()){ + while (wSTDate.HasMoreTokens()){ - if (ProcessDataAfterT == FALSE){ + if (ProcessDataAfterT == FALSE){ - DataBeforeT = wSTDate.GetNextToken(); - ProcessDataAfterT = TRUE; + DataBeforeT = wSTDate.GetNextToken(); + ProcessDataAfterT = TRUE; - } else { + } else { - DataAfterT = wSTDate.GetNextToken(); - break; + DataAfterT = wSTDate.GetNextToken(); + break; - } + } - } + } - // If there is not T then replace altogether. + // If there is not T then replace altogether. - wxString FinalBirthdayDay; - wxString FinalBirthdayMonth; - wxString FinalBirthdayYear; + wxString FinalBirthdayDay; + wxString FinalBirthdayMonth; + wxString FinalBirthdayYear; - if (BirthdayDay < 10){ + if (BirthdayDay < 10){ - FinalBirthdayDay = wxT("0") + wxString::Format(wxT("%i"), BirthdayDay); + FinalBirthdayDay = wxT("0") + wxString::Format(wxT("%i"), BirthdayDay); - } else { + } else { - FinalBirthdayDay = wxString::Format(wxT("%i"), BirthdayDay); + FinalBirthdayDay = wxString::Format(wxT("%i"), BirthdayDay); - } + } - if (((int)BirthdayMonth + 1) < 10){ + if (((int)BirthdayMonth + 1) < 10){ - FinalBirthdayMonth = wxT("0") + wxString::Format(wxT("%i"), ((int)BirthdayMonth + 1)); + FinalBirthdayMonth = wxT("0") + wxString::Format(wxT("%i"), ((int)BirthdayMonth + 1)); - } else { + } else { - FinalBirthdayMonth = wxString::Format(wxT("%i"), ((int)BirthdayMonth + 1)); + FinalBirthdayMonth = wxString::Format(wxT("%i"), ((int)BirthdayMonth + 1)); - } + } - if (BirthdayYear == 0){ + if (BirthdayYear == 0){ - FinalBirthdayYear = wxT("--"); + FinalBirthdayYear = wxT("--"); - } else { + } else { - FinalBirthdayYear = wxString::Format(wxT("%i"), BirthdayYear); + FinalBirthdayYear = wxString::Format(wxT("%i"), BirthdayYear); - } + } - if (!DataAfterT.IsEmpty()){ + if (!DataAfterT.IsEmpty()){ - FinalBirthdayString = FinalBirthdayYear + FinalBirthdayMonth + FinalBirthdayDay + wxT("T") + DataAfterT; + FinalBirthdayString = FinalBirthdayYear + FinalBirthdayMonth + FinalBirthdayDay + wxT("T") + DataAfterT; - } else { + } else { - FinalBirthdayString = FinalBirthdayYear + FinalBirthdayMonth + FinalBirthdayDay; + FinalBirthdayString = FinalBirthdayYear + FinalBirthdayMonth + FinalBirthdayDay; - } + } - if (!FinalBirthdayString.IsEmpty() || !strValue2.IsEmpty()){ + if (!FinalBirthdayString.IsEmpty() || !strValue3.IsEmpty()){ - if (!strValue2.IsEmpty()){ + if (!strValue3.IsEmpty()){ - EscapeString(&strValue2, FALSE); - EscapeString(&strValue, FALSE); + EscapeString(&strValue2, FALSE); + EscapeString(&strValue, FALSE); - ContactData.AddRaw(wxT("BDAY") + strValue2 + wxT(";"), FinalBirthdayString); + ContactData.AddRaw(wxT("BDAY;") + strValue3, FinalBirthdayString); - } else { + } else { - EscapeString(&strValue, FALSE); + EscapeString(&strValue, FALSE); - ContactData.AddRaw(wxT("BDAY"), FinalBirthdayString); + ContactData.AddRaw(wxT("BDAY"), FinalBirthdayString); - } + } - } + } - } - - } + } - ResetSaveProcessData(); + } - // Process Label. + ResetSaveProcessData(); - strValue3 = AnniversaryAltID; + // Build the values for the ANNIVERSARY property. + + // ALTID + + if (!ContactEditorData.AnniversaryAltID.IsEmpty()){ - if (!strValue3.IsEmpty()){ - - strValue3.Trim(); - strValue3.Trim(); - boolValue2 = TRUE; - strValue2.Append(wxT("ALTID=\"") + strValue3 + wxT("\"")); - - boolValue = TRUE; - - } + wxString DataValue; + DataValue = ContactEditorData.AnniversaryAltID; - //strValue3 = ContactData.Convert(GeneralAddressList, FALSE); - //strValue2 = + EscapeString(&DataValue, FALSE); - // Process Language. + strValue3.Append("ALTID="); + strValue3.Append(DataValue); - strValue3 = AnniversaryCalScale; + boolValue2 = TRUE; - if (!strValue3.IsEmpty()){ - - strValue3.Trim(); - strValue3.Trim(); - - if (boolValue2 == TRUE){ - - strValue2.Append(wxT(";")); - - } else { - - boolValue2 = TRUE; - - } - - strValue2.Append(wxT("CALSCALE=") + strValue3); - - boolValue = TRUE; - - } + } - // Process Tokens. + // CALSCALE. - strValue2 = AnniversaryTokens; + if (!ContactEditorData.AnniversaryCalScale.IsEmpty()){ - // Deal with ANNIVERSARY. + wxString DataValue; + DataValue = ContactEditorData.AnniversaryCalScale; - if (!txtAnniversary->IsEmpty()){ - - strValue = txtAnniversary->GetValue(); - - if (!strValue.IsEmpty() || !strValue2.IsEmpty()){ - - if (!strValue2.IsEmpty()){ - - EscapeString(&strValue2, FALSE); - EscapeString(&strValue, FALSE); - - ContactData.AddRaw(wxT("ANNIVERSARY;VALUE=text;") + strValue2 + wxT(";"), strValue); - - } else { - - EscapeString(&strValue, FALSE); - - ContactData.AddRaw(wxT("ANNIVERSARY;VALUE=text"), strValue); - - } - - } - - } else { - - // Look for T and replace data before this. + EscapeString(&DataValue, FALSE); + + if (boolValue2 == TRUE){ + + strValue3.Append(";"); + + } + + strValue3.Append("CALSCALE="); + strValue3.Append(DataValue); + + boolValue2 = TRUE; + + } + + // Extra tokens. + + if (!ContactEditorData.AnniversaryTokens.IsEmpty()){ + + wxString DataValue; + DataValue = ContactEditorData.AnniversaryTokens; + + EscapeString(&DataValue, FALSE); + + if (boolValue2 == TRUE){ + + strValue3.Append(";"); + + } + + strValue3.Append(DataValue); + + } + + // Write the ANNIVERSARY property. + + if (!txtAnniversary->IsEmpty()){ + + if (!txtAnniversary->GetValue().IsEmpty()){ + + strValue = txtAnniversary->GetValue(); + + if (!strValue3.IsEmpty()){ + + ContactData.AddRaw("ANNIVERSARY;VALUE=text;" + strValue3, strValue); + + } else { + + ContactData.AddRaw("ANNIVERSARY;VALUE=text", strValue); + + } + + } + + } else { + + // Look for T and replace data before this. - // Get Day, Month & Year. + // Get Day, Month & Year. - wxDateTime AnniversaryDate; - wxDateTime::Month AnniversaryMonth; - int AnniversaryDay; - int AnniversaryYear; - wxString DataBeforeT; - wxString DataAfterT; - wxString FinalAnniversaryString; - bool ProcessDataAfterT = FALSE; + wxDateTime AnniversaryDate; + wxDateTime::Month AnniversaryMonth; + int AnniversaryDay; + int AnniversaryYear; + wxString DataBeforeT; + wxString DataAfterT; + wxString FinalAnniversaryString; + bool ProcessDataAfterT = FALSE; - AnniversaryDate = dapAnniversary->GetValue(); + AnniversaryDate = dapAnniversary->GetValue(); - if (AnniversaryDate.IsValid()){ + if (AnniversaryDate.IsValid()){ - AnniversaryDay = AnniversaryDate.GetDay(); - AnniversaryMonth = AnniversaryDate.GetMonth(); - AnniversaryYear = AnniversaryDate.GetYear(); + AnniversaryDay = AnniversaryDate.GetDay(); + AnniversaryMonth = AnniversaryDate.GetMonth(); + AnniversaryYear = AnniversaryDate.GetYear(); - // Look for T and replace data before this. + // Look for T and replace data before this. - wxStringTokenizer wSTDate(Anniversary, wxT("T")); + wxStringTokenizer wSTDate(ContactEditorData.Anniversary, wxT("T")); - while (wSTDate.HasMoreTokens()){ + while (wSTDate.HasMoreTokens()){ - if (ProcessDataAfterT == FALSE){ + if (ProcessDataAfterT == FALSE){ - DataBeforeT = wSTDate.GetNextToken(); - ProcessDataAfterT = TRUE; + DataBeforeT = wSTDate.GetNextToken(); + ProcessDataAfterT = TRUE; - } else { + } else { - DataAfterT = wSTDate.GetNextToken(); - break; + DataAfterT = wSTDate.GetNextToken(); + break; - } + } - } + } - // If there is not T then replace altogether. + // If there is not T then replace altogether. - wxString FinalAnniversaryDay; - wxString FinalAnniversaryMonth; - wxString FinalAnniversaryYear; + wxString FinalAnniversaryDay; + wxString FinalAnniversaryMonth; + wxString FinalAnniversaryYear; - if (AnniversaryDay < 10){ + if (AnniversaryDay < 10){ - FinalAnniversaryDay = wxT("0") + wxString::Format(wxT("%i"), AnniversaryDay); + FinalAnniversaryDay = wxT("0") + wxString::Format(wxT("%i"), AnniversaryDay); - } else { + } else { - FinalAnniversaryDay = wxString::Format(wxT("%i"), AnniversaryDay); + FinalAnniversaryDay = wxString::Format(wxT("%i"), AnniversaryDay); - } + } - if (((int)AnniversaryMonth + 1) < 10){ + if (((int)AnniversaryMonth + 1) < 10){ - FinalAnniversaryMonth = wxT("0") + wxString::Format(wxT("%i"), ((int)AnniversaryMonth + 1)); + FinalAnniversaryMonth = wxT("0") + wxString::Format(wxT("%i"), ((int)AnniversaryMonth + 1)); - } else { + } else { - FinalAnniversaryMonth = wxString::Format(wxT("%i"), ((int)AnniversaryMonth + 1)); + FinalAnniversaryMonth = wxString::Format(wxT("%i"), ((int)AnniversaryMonth + 1)); - } + } - if (AnniversaryYear == 0){ + if (AnniversaryYear == 0){ - FinalAnniversaryYear = wxT("--"); + FinalAnniversaryYear = wxT("--"); - } else { + } else { - FinalAnniversaryYear = wxString::Format(wxT("%i"), AnniversaryYear); + FinalAnniversaryYear = wxString::Format(wxT("%i"), AnniversaryYear); - } + } - if (!DataAfterT.IsEmpty()){ + if (!DataAfterT.IsEmpty()){ - FinalAnniversaryString = FinalAnniversaryYear + FinalAnniversaryMonth + FinalAnniversaryDay + wxT("T") + DataAfterT; + FinalAnniversaryString = FinalAnniversaryYear + FinalAnniversaryMonth + FinalAnniversaryDay + wxT("T") + DataAfterT; - } else { + } else { - FinalAnniversaryString = FinalAnniversaryYear + FinalAnniversaryMonth + FinalAnniversaryDay; + FinalAnniversaryString = FinalAnniversaryYear + FinalAnniversaryMonth + FinalAnniversaryDay; - } + } - if (!FinalAnniversaryString.IsEmpty() || !strValue2.IsEmpty()){ + if (!FinalAnniversaryString.IsEmpty() || !strValue3.IsEmpty()){ - if (!strValue2.IsEmpty()){ + if (!strValue3.IsEmpty()){ - EscapeString(&strValue2, FALSE); - EscapeString(&strValue, FALSE); + EscapeString(&strValue2, FALSE); + EscapeString(&strValue, FALSE); - ContactData.AddRaw(wxT("ANNIVERSARY") + strValue2 + wxT(";"), FinalAnniversaryString); + ContactData.AddRaw(wxT("ANNIVERSARY;") + strValue3, FinalAnniversaryString); - } else { + } else { - EscapeString(&strValue, FALSE); + EscapeString(&strValue, FALSE); - ContactData.AddRaw(wxT("ANNIVERSARY"), FinalAnniversaryString); + ContactData.AddRaw(wxT("ANNIVERSARY"), FinalAnniversaryString); - } + } - } + } - } - - } + } - // Setup the addresses (General, Home, Business). - - //intValue = GeneralAddressList.size(); - ResetSaveProcessData(); + } + + // Setup the addresses (General, Home, Business). - for (std::map::iterator iter = GeneralAddressList.begin(); - iter != GeneralAddressList.end(); ++iter){ + ResetSaveProcessData(); + + for (std::map::iterator iter = ContactEditorData.GeneralAddressList.begin(); + iter != ContactEditorData.GeneralAddressList.end(); ++iter){ - int intSeekValue = iter->first; + int intSeekValue = iter->first; - wxString strAddressString; - wxString strAddressFinalValue; - std::map::iterator iterValue; + wxString strAddressString; + wxString strAddressFinalValue; + std::map::iterator iterValue; - strAddressString.Append(wxT(";;")); + strAddressString.Append(wxT(";;")); - // Get Address + // Get Address - iterValue = GeneralAddressList.find(intSeekValue); - strAddressFinalValue = iterValue->second; - ProcessCaptureStrings(&strAddressFinalValue); - strAddressString.Append(strAddressFinalValue + wxT(";")); - strAddressFinalValue.Clear(); + iterValue = ContactEditorData.GeneralAddressList.find(intSeekValue); + strAddressFinalValue = iterValue->second; + ProcessCaptureStrings(&strAddressFinalValue); + strAddressString.Append(strAddressFinalValue + wxT(";")); + strAddressFinalValue.Clear(); - // Get Town + // Get Town - iterValue = GeneralAddressListTown.find(intSeekValue); - strAddressFinalValue = iterValue->second; - ProcessCaptureStrings(&strAddressFinalValue); - strAddressString.Append(strAddressFinalValue + wxT(";")); - strAddressFinalValue.Clear(); + iterValue = ContactEditorData.GeneralAddressListTown.find(intSeekValue); + strAddressFinalValue = iterValue->second; + ProcessCaptureStrings(&strAddressFinalValue); + strAddressString.Append(strAddressFinalValue + wxT(";")); + strAddressFinalValue.Clear(); - // Get County + // Get County - iterValue = GeneralAddressListCounty.find(intSeekValue); - strAddressFinalValue = iterValue->second; - ProcessCaptureStrings(&strAddressFinalValue); - strAddressString.Append(strAddressFinalValue + wxT(";")); - strAddressFinalValue.Clear(); + iterValue = ContactEditorData.GeneralAddressListCounty.find(intSeekValue); + strAddressFinalValue = iterValue->second; + ProcessCaptureStrings(&strAddressFinalValue); + strAddressString.Append(strAddressFinalValue + wxT(";")); + strAddressFinalValue.Clear(); - // Get Post Code + // Get Post Code - iterValue = GeneralAddressListPostCode.find(intSeekValue); - strAddressFinalValue = iterValue->second; - ProcessCaptureStrings(&strAddressFinalValue); - strAddressString.Append(strAddressFinalValue + wxT(";")); - strAddressFinalValue.Clear(); + iterValue = ContactEditorData.GeneralAddressListPostCode.find(intSeekValue); + strAddressFinalValue = iterValue->second; + ProcessCaptureStrings(&strAddressFinalValue); + strAddressString.Append(strAddressFinalValue + wxT(";")); + strAddressFinalValue.Clear(); - // Get Country + // Get Country - iterValue = GeneralAddressListCountry.find(intSeekValue); - strAddressFinalValue = iterValue->second; - ProcessCaptureStrings(&strAddressFinalValue); - strAddressString.Append(strAddressFinalValue); - strAddressFinalValue.Clear(); + iterValue = ContactEditorData.GeneralAddressListCountry.find(intSeekValue); + strAddressFinalValue = iterValue->second; + ProcessCaptureStrings(&strAddressFinalValue); + strAddressString.Append(strAddressFinalValue); + strAddressFinalValue.Clear(); - ProcessSaveData(wxT("ADR"), &strValue2, &boolValue2, &boolValue, - &iter, &strAddressString, &ContactData, - wxT("LABEL"), &GeneralAddressListLabel, - wxT("LANGUAGE"), &GeneralAddressListLang, - wxT("ALTID"), &GeneralAddressListAltID, - wxT("PID"), &GeneralAddressListPID, - wxT("GEO"), &GeneralAddressListGeo, - wxT("TZ"), &GeneralAddressListTimezone, - wxT("MEDIATYPE"), &GeneralAddressListMediatype, - wxT("PREF"), &GeneralAddressListPref, - wxT(""), &GeneralAddressListTokens ); + ProcessSaveData(wxT("ADR"), &strValue2, &boolValue2, &boolValue, + &iter, &strAddressString, &ContactData, + wxT("LABEL"), &ContactEditorData.GeneralAddressListLabel, + wxT("LANGUAGE"), &ContactEditorData.GeneralAddressListLang, + wxT("ALTID"), &ContactEditorData.GeneralAddressListAltID, + wxT("PID"), &ContactEditorData.GeneralAddressListPID, + wxT("GEO"), &ContactEditorData.GeneralAddressListGeo, + wxT("TZ"), &ContactEditorData.GeneralAddressListTimezone, + wxT("MEDIATYPE"), &ContactEditorData.GeneralAddressListMediatype, + wxT("PREF"), &ContactEditorData.GeneralAddressListPref, + wxT(""), &ContactEditorData.GeneralAddressListTokens ); - ResetSaveProcessData(); + ResetSaveProcessData(); - } - - ResetSaveProcessData(); + } - for (std::map::iterator iter = HomeAddressList.begin(); - iter != HomeAddressList.end(); ++iter){ - - int intSeekValue = iter->first; - - wxString strAddressString; - wxString strAddressFinalValue; - std::map::iterator iterValue; - - strAddressString.Append(wxT(";;")); - - // Get Address - - iterValue = HomeAddressList.find(intSeekValue); - strAddressFinalValue = iterValue->second; - ProcessCaptureStrings(&strAddressFinalValue); - - strAddressString.Append(strAddressFinalValue + wxT(";")); - - // Get Town - - iterValue = HomeAddressListTown.find(intSeekValue); - strAddressFinalValue = iterValue->second; - ProcessCaptureStrings(&strAddressFinalValue); - - strAddressString.Append(strAddressFinalValue + wxT(";")); - - // Get County - - iterValue = HomeAddressListCounty.find(intSeekValue); - strAddressFinalValue = iterValue->second; - ProcessCaptureStrings(&strAddressFinalValue); + ResetSaveProcessData(); + + for (std::map::iterator iter = ContactEditorData.HomeAddressList.begin(); + iter != ContactEditorData.HomeAddressList.end(); ++iter){ - strAddressString.Append(strAddressFinalValue + wxT(";")); + int intSeekValue = iter->first; - // Get Post Code + wxString strAddressString; + wxString strAddressFinalValue; + std::map::iterator iterValue; - iterValue = HomeAddressListPostCode.find(intSeekValue); - strAddressFinalValue = iterValue->second; - ProcessCaptureStrings(&strAddressFinalValue); + strAddressString.Append(wxT(";;")); - strAddressString.Append(strAddressFinalValue + wxT(";")); + // Get Address - // Get Country + iterValue = ContactEditorData.HomeAddressList.find(intSeekValue); + strAddressFinalValue = iterValue->second; + ProcessCaptureStrings(&strAddressFinalValue); + strAddressString.Append(strAddressFinalValue + wxT(";")); - iterValue = HomeAddressListCountry.find(intSeekValue); - strAddressFinalValue = iterValue->second; - ProcessCaptureStrings(&strAddressFinalValue); + // Get Town - strAddressString.Append(strAddressFinalValue); + iterValue = ContactEditorData.HomeAddressListTown.find(intSeekValue); + strAddressFinalValue = iterValue->second; + ProcessCaptureStrings(&strAddressFinalValue); + strAddressString.Append(strAddressFinalValue + wxT(";")); - ProcessSaveData(wxT("ADR;TYPE=home"), &strValue2, &boolValue2, &boolValue, - &iter, &strAddressString, &ContactData, - wxT("LABEL"), &HomeAddressListLabel, - wxT("LANGUAGE"), &HomeAddressListLang, - wxT("ALTID"), &HomeAddressListAltID, - wxT("PID"), &HomeAddressListPID, - wxT("GEO"), &HomeAddressListGeo, - wxT("TZ"), &HomeAddressListTimezone, - wxT("MEDIATYPE"), &HomeAddressListMediatype, - wxT("PREF"), &HomeAddressListPref, - wxT(""), &HomeAddressListTokens ); + // Get County - ResetSaveProcessData(); + iterValue = ContactEditorData.HomeAddressListCounty.find(intSeekValue); + strAddressFinalValue = iterValue->second; + ProcessCaptureStrings(&strAddressFinalValue); + strAddressString.Append(strAddressFinalValue + wxT(";")); + + // Get Post Code + + iterValue = ContactEditorData.HomeAddressListPostCode.find(intSeekValue); + strAddressFinalValue = iterValue->second; + ProcessCaptureStrings(&strAddressFinalValue); + strAddressString.Append(strAddressFinalValue + wxT(";")); + + // Get Country + + iterValue = ContactEditorData.HomeAddressListCountry.find(intSeekValue); + strAddressFinalValue = iterValue->second; + ProcessCaptureStrings(&strAddressFinalValue); + strAddressString.Append(strAddressFinalValue); + + ProcessSaveData(wxT("ADR;TYPE=home"), &strValue2, &boolValue2, &boolValue, + &iter, &strAddressString, &ContactData, + wxT("LABEL"), &ContactEditorData.HomeAddressListLabel, + wxT("LANGUAGE"), &ContactEditorData.HomeAddressListLang, + wxT("ALTID"), &ContactEditorData.HomeAddressListAltID, + wxT("PID"), &ContactEditorData.HomeAddressListPID, + wxT("GEO"), &ContactEditorData.HomeAddressListGeo, + wxT("TZ"), &ContactEditorData.HomeAddressListTimezone, + wxT("MEDIATYPE"), &ContactEditorData.HomeAddressListMediatype, + wxT("PREF"), &ContactEditorData.HomeAddressListPref, + wxT(""), &ContactEditorData.HomeAddressListTokens ); + + ResetSaveProcessData(); - } + } - ResetSaveProcessData(); + ResetSaveProcessData(); - for (std::map::iterator iter = BusinessAddressList.begin(); - iter != BusinessAddressList.end(); ++iter){ + for (std::map::iterator iter = ContactEditorData.BusinessAddressList.begin(); + iter != ContactEditorData.BusinessAddressList.end(); ++iter){ - int intSeekValue = iter->first; + int intSeekValue = iter->first; - wxString strAddressString; - wxString strAddressFinalValue; - std::map::iterator iterValue; + wxString strAddressString; + wxString strAddressFinalValue; + std::map::iterator iterValue; - strAddressString.Append(wxT(";;")); + strAddressString.Append(wxT(";;")); - // Get Address + // Get Address - iterValue = BusinessAddressList.find(intSeekValue); - strAddressFinalValue = iterValue->second; - ProcessCaptureStrings(&strAddressFinalValue); + iterValue = ContactEditorData.BusinessAddressList.find(intSeekValue); + strAddressFinalValue = iterValue->second; + ProcessCaptureStrings(&strAddressFinalValue); - strAddressString.Append(strAddressFinalValue + wxT(";")); + strAddressString.Append(strAddressFinalValue + wxT(";")); - // Get Town + // Get Town - iterValue = BusinessAddressListTown.find(intSeekValue); - strAddressFinalValue = iterValue->second; - ProcessCaptureStrings(&strAddressFinalValue); + iterValue = ContactEditorData.BusinessAddressListTown.find(intSeekValue); + strAddressFinalValue = iterValue->second; + ProcessCaptureStrings(&strAddressFinalValue); - strAddressString.Append(strAddressFinalValue + wxT(";")); + strAddressString.Append(strAddressFinalValue + wxT(";")); - // Get County + // Get County - iterValue = BusinessAddressListCounty.find(intSeekValue); - strAddressFinalValue = iterValue->second; - ProcessCaptureStrings(&strAddressFinalValue); + iterValue = ContactEditorData.BusinessAddressListCounty.find(intSeekValue); + strAddressFinalValue = iterValue->second; + ProcessCaptureStrings(&strAddressFinalValue); - strAddressString.Append(strAddressFinalValue + wxT(";")); + strAddressString.Append(strAddressFinalValue + wxT(";")); - // Get Post Code + // Get Post Code - iterValue = BusinessAddressListPostCode.find(intSeekValue); - strAddressFinalValue = iterValue->second; - ProcessCaptureStrings(&strAddressFinalValue); + iterValue = ContactEditorData.BusinessAddressListPostCode.find(intSeekValue); + strAddressFinalValue = iterValue->second; + ProcessCaptureStrings(&strAddressFinalValue); - strAddressString.Append(strAddressFinalValue + wxT(";")); + strAddressString.Append(strAddressFinalValue + wxT(";")); - // Get Country + // Get Country - iterValue = BusinessAddressListCountry.find(intSeekValue); - strAddressFinalValue = iterValue->second; - ProcessCaptureStrings(&strAddressFinalValue); + iterValue = ContactEditorData.BusinessAddressListCountry.find(intSeekValue); + strAddressFinalValue = iterValue->second; + ProcessCaptureStrings(&strAddressFinalValue); - strAddressString.Append(strAddressFinalValue); + strAddressString.Append(strAddressFinalValue); - ProcessSaveData(wxT("ADR;TYPE=work"), &strValue2, &boolValue2, &boolValue, - &iter, &strAddressString, &ContactData, - wxT("LABEL"), &BusinessAddressListLabel, - wxT("LANGUAGE"), &BusinessAddressListLang, - wxT("ALTID"), &BusinessAddressListAltID, - wxT("PID"), &BusinessAddressListPID, - wxT("GEO"), &BusinessAddressListGeo, - wxT("TZ"), &BusinessAddressListTimezone, - wxT("MEDIATYPE"), &BusinessAddressListMediatype, - wxT("PREF"), &BusinessAddressListPref, - wxT(""), &BusinessAddressListTokens ); + ProcessSaveData(wxT("ADR;TYPE=work"), &strValue2, &boolValue2, &boolValue, + &iter, &strAddressString, &ContactData, + wxT("LABEL"), &ContactEditorData.BusinessAddressListLabel, + wxT("LANGUAGE"), &ContactEditorData.BusinessAddressListLang, + wxT("ALTID"), &ContactEditorData.BusinessAddressListAltID, + wxT("PID"), &ContactEditorData.BusinessAddressListPID, + wxT("GEO"), &ContactEditorData.BusinessAddressListGeo, + wxT("TZ"), &ContactEditorData.BusinessAddressListTimezone, + wxT("MEDIATYPE"), &ContactEditorData.BusinessAddressListMediatype, + wxT("PREF"), &ContactEditorData.BusinessAddressListPref, + wxT(""), &ContactEditorData.BusinessAddressListTokens ); - ResetSaveProcessData(); + ResetSaveProcessData(); - } + } - // Sort out nicknames (if any). + // Sort out nicknames (if any). - for (std::map::iterator iter = GeneralNicknamesList.begin(); - iter != GeneralNicknamesList.end(); ++iter){ + for (std::map::iterator iter = ContactEditorData.GeneralNicknamesList.begin(); + iter != ContactEditorData.GeneralNicknamesList.end(); ++iter){ - intValue2 = iter->first; + intValue2 = iter->first; - // Process Alternative ID. + // Process Alternative ID. - ProcessSaveData(wxT("NICKNAME"), &strValue2, &boolValue2, &boolValue, - &iter, &GeneralNicknamesList, &ContactData, - wxT("LANGUAGE"), &GeneralNicknamesListLanguage, - wxT("ALTID"), &GeneralNicknamesListAltID, - wxT("PID"), &GeneralNicknamesListPID, - wxT("PREF"), &GeneralNicknamesListPref, - wxT(""), &GeneralNicknamesListTokens ); + ProcessSaveData(wxT("NICKNAME"), &strValue2, &boolValue2, &boolValue, + &iter, &ContactEditorData.GeneralNicknamesList, &ContactData, + wxT("LANGUAGE"), &ContactEditorData.GeneralNicknamesListLanguage, + wxT("ALTID"), &ContactEditorData.GeneralNicknamesListAltID, + wxT("PID"), &ContactEditorData.GeneralNicknamesListPID, + wxT("PREF"), &ContactEditorData.GeneralNicknamesListPref, + wxT(""), &ContactEditorData.GeneralNicknamesListTokens ); - ResetSaveProcessData(); + ResetSaveProcessData(); - } - - ResetSaveProcessData(); + } + + ResetSaveProcessData(); - for (std::map::iterator iter = HomeNicknamesList.begin(); - iter != HomeNicknamesList.end(); ++iter){ + for (std::map::iterator iter = ContactEditorData.HomeNicknamesList.begin(); + iter != ContactEditorData.HomeNicknamesList.end(); ++iter){ - ProcessSaveData(wxT("NICKNAME;TYPE=home"), &strValue2, &boolValue2, &boolValue, - &iter, &HomeNicknamesList, &ContactData, - wxT("LANGUAGE"), &HomeNicknamesListLanguage, - wxT("ALTID"), &HomeNicknamesListAltID, - wxT("PID"), &HomeNicknamesListPID, - wxT("PREF"), &HomeNicknamesListPref, - wxT(""), &HomeNicknamesListTokens ); + ProcessSaveData(wxT("NICKNAME;TYPE=home"), &strValue2, &boolValue2, &boolValue, + &iter, &ContactEditorData.HomeNicknamesList, &ContactData, + wxT("LANGUAGE"), &ContactEditorData.HomeNicknamesListLanguage, + wxT("ALTID"), &ContactEditorData.HomeNicknamesListAltID, + wxT("PID"), &ContactEditorData.HomeNicknamesListPID, + wxT("PREF"), &ContactEditorData.HomeNicknamesListPref, + wxT(""), &ContactEditorData.HomeNicknamesListTokens ); - ResetSaveProcessData(); + ResetSaveProcessData(); - } + } - ResetSaveProcessData(); + ResetSaveProcessData(); - for (std::map::iterator iter = BusinessNicknamesList.begin(); - iter != BusinessNicknamesList.end(); ++iter){ + for (std::map::iterator iter = ContactEditorData.BusinessNicknamesList.begin(); + iter != ContactEditorData.BusinessNicknamesList.end(); ++iter){ - ProcessSaveData(wxT("NICKNAME;TYPE=work"), &strValue2, &boolValue2, &boolValue, - &iter, &BusinessNicknamesList, &ContactData, - wxT("LANGUAGE"), &BusinessNicknamesListLanguage, - wxT("ALTID"), &BusinessNicknamesListAltID, - wxT("PID"), &BusinessNicknamesListPID, - wxT("PREF"), &BusinessNicknamesListPref, - wxT(""), &BusinessNicknamesListTokens ); + ProcessSaveData(wxT("NICKNAME;TYPE=work"), &strValue2, &boolValue2, &boolValue, + &iter, &ContactEditorData.BusinessNicknamesList, &ContactData, + wxT("LANGUAGE"), &ContactEditorData.BusinessNicknamesListLanguage, + wxT("ALTID"), &ContactEditorData.BusinessNicknamesListAltID, + wxT("PID"), &ContactEditorData.BusinessNicknamesListPID, + wxT("PREF"), &ContactEditorData.BusinessNicknamesListPref, + wxT(""), &ContactEditorData.BusinessNicknamesListTokens ); - ResetSaveProcessData(); + ResetSaveProcessData(); - } + } - ResetSaveProcessData(); + ResetSaveProcessData(); - // Sort out email (general, home and business). + // Sort out email (general, home and business). - for (std::map::iterator iter = GeneralEmailList.begin(); - iter != GeneralEmailList.end(); ++iter){ - - //strValue3 = ContactData.Convert(GeneralAddressList, FALSE); - //strValue2 = + for (std::map::iterator iter = ContactEditorData.GeneralEmailList.begin(); + iter != ContactEditorData.GeneralEmailList.end(); ++iter){ - wxString strAddressFinalValue; - std::map::iterator iterValue; + wxString strAddressFinalValue; + std::map::iterator iterValue; - ProcessSaveData(wxT("EMAIL"), &strValue2, &boolValue2, &boolValue, - &iter, &GeneralEmailList, &ContactData, - wxT("ALTID"), &GeneralEmailListAltID, - wxT("PID"), &GeneralEmailListPID, - wxT("PREF"), &GeneralEmailListPref, - wxT(""), &GeneralEmailListTokens ); - - ResetSaveProcessData(); + ProcessSaveData(wxT("EMAIL"), &strValue2, &boolValue2, &boolValue, + &iter, &ContactEditorData.GeneralEmailList, &ContactData, + wxT("ALTID"), &ContactEditorData.GeneralEmailListAltID, + wxT("PID"), &ContactEditorData.GeneralEmailListPID, + wxT("PREF"), &ContactEditorData.GeneralEmailListPref, + wxT(""), &ContactEditorData.GeneralEmailListTokens ); + + ResetSaveProcessData(); - } + } - ResetSaveProcessData(); + ResetSaveProcessData(); - for (std::map::iterator iter = HomeEmailList.begin(); - iter != HomeEmailList.end(); ++iter){ + for (std::map::iterator iter = ContactEditorData.HomeEmailList.begin(); + iter != ContactEditorData.HomeEmailList.end(); ++iter){ - //strValue3 = ContactData.Convert(GeneralAddressList, FALSE); - //strValue2 = + ProcessSaveData(wxT("EMAIL;TYPE=home"), &strValue2, &boolValue2, &boolValue, + &iter, &ContactEditorData.HomeEmailList, &ContactData, + wxT("ALTID"), &ContactEditorData.HomeEmailListAltID, + wxT("PID"), &ContactEditorData.HomeEmailListPID, + wxT("PREF"), &ContactEditorData.HomeEmailListPref, + wxT(""), &ContactEditorData.HomeEmailListTokens ); - ProcessSaveData(wxT("EMAIL;TYPE=home"), &strValue2, &boolValue2, &boolValue, - &iter, &HomeEmailList, &ContactData, - wxT("ALTID"), &HomeEmailListAltID, - wxT("PID"), &HomeEmailListPID, - wxT("PREF"), &HomeEmailListPref, - wxT(""), &HomeEmailListTokens ); + ResetSaveProcessData(); - ResetSaveProcessData(); - - } + } - ResetSaveProcessData(); + ResetSaveProcessData(); - for (std::map::iterator iter = BusinessEmailList.begin(); - iter != BusinessEmailList.end(); ++iter){ - - //strValue3 = ContactData.Convert(GeneralAddressList, FALSE); - //strValue2 = - - ProcessSaveData(wxT("EMAIL;TYPE=work"), &strValue2, &boolValue2, &boolValue, - &iter, &BusinessEmailList, &ContactData, - wxT("ALTID"), &BusinessEmailListAltID, - wxT("PID"), &BusinessEmailListPID, - wxT("PREF"), &BusinessEmailListPref, - wxT(""), &BusinessEmailListTokens ); + for (std::map::iterator iter = ContactEditorData.BusinessEmailList.begin(); + iter != ContactEditorData.BusinessEmailList.end(); ++iter){ - ResetSaveProcessData(); + ProcessSaveData(wxT("EMAIL;TYPE=work"), &strValue2, &boolValue2, &boolValue, + &iter, &ContactEditorData.BusinessEmailList, &ContactData, + wxT("ALTID"), &ContactEditorData.BusinessEmailListAltID, + wxT("PID"), &ContactEditorData.BusinessEmailListPID, + wxT("PREF"), &ContactEditorData.BusinessEmailListPref, + wxT(""), &ContactEditorData.BusinessEmailListTokens ); + + ResetSaveProcessData(); - } + } - ResetSaveProcessData(); + ResetSaveProcessData(); - for (std::map::iterator iter = GeneralIMList.begin(); - iter != GeneralIMList.end(); ++iter){ + for (std::map::iterator iter = ContactEditorData.GeneralIMList.begin(); + iter != ContactEditorData.GeneralIMList.end(); ++iter){ - intValue2 = iter->first; + intValue2 = iter->first; - // Process Alternative ID. + wxString strIMFinalValue = iter->second; - ProcessSaveData(wxT("IMPP"), &strValue2, &boolValue2, &boolValue, - &iter, &GeneralIMList, &ContactData, - wxT("ALTID"), &GeneralIMListAltID, - wxT("PID"), &GeneralIMListPID, - wxT("MEDIATYPE"), &GeneralIMListMediatype, - wxT("PREF"), &GeneralIMListPref, - wxT(""), &GeneralIMListTokens ); + ProcessCaptureStrings(&strIMFinalValue); - ResetSaveProcessData(); + if (ContactEditorData.GeneralIMListTypeInfo.find(iter->first) != + ContactEditorData.GeneralIMListTypeInfo.end()){ + + std::map::iterator DataTypeIter = ContactEditorData.GeneralIMListTypeInfo.find(iter->first); + + strIMFinalValue.insert(0, ":"); + strIMFinalValue.insert(0, DataTypeIter->second); + + } else { + + strIMFinalValue.insert(0, "none:"); + + } + + // Process Alternative ID. + + ProcessSaveData(wxT("IMPP"), &strValue2, &boolValue2, &boolValue, + &iter, &strIMFinalValue, &ContactData, + wxT("ALTID"), &ContactEditorData.GeneralIMListAltID, + wxT("PID"), &ContactEditorData.GeneralIMListPID, + wxT("MEDIATYPE"), &ContactEditorData.GeneralIMListMediatype, + wxT("PREF"), &ContactEditorData.GeneralIMListPref, + wxT(""), &ContactEditorData.GeneralIMListTokens ); + + ResetSaveProcessData(); - } + } - ResetSaveProcessData(); + ResetSaveProcessData(); - for (std::map::iterator iter = HomeIMList.begin(); - iter != HomeIMList.end(); ++iter){ + for (std::map::iterator iter = ContactEditorData.HomeIMList.begin(); + iter != ContactEditorData.HomeIMList.end(); ++iter){ - ProcessSaveData(wxT("IMPP;TYPE=home"), &strValue2, &boolValue2, &boolValue, - &iter, &HomeIMList, &ContactData, - wxT("ALTID"), &HomeIMListAltID, - wxT("PID"), &HomeIMListPID, - wxT("MEDIATYPE"), &HomeIMListMediatype, - wxT("PREF"), &HomeIMListPref, - wxT(""), &HomeIMListTokens ); + wxString strIMFinalValue = iter->second; - ResetSaveProcessData(); + ProcessCaptureStrings(&strIMFinalValue); - } - - ResetSaveProcessData(); - - for (std::map::iterator iter = BusinessIMList.begin(); - iter != BusinessIMList.end(); ++iter){ - - ProcessSaveData(wxT("IMPP;TYPE=work"), &strValue2, &boolValue2, &boolValue, - &iter, &BusinessIMList, &ContactData, - wxT("ALTID"), &BusinessIMListAltID, - wxT("PID"), &BusinessIMListPID, - wxT("MEDIATYPE"), &BusinessIMListMediatype, - wxT("PREF"), &BusinessIMListPref, - wxT(""), &BusinessIMListTokens ); - - ResetSaveProcessData(); + if (ContactEditorData.HomeIMListTypeInfo.find(iter->first) != + ContactEditorData.HomeIMListTypeInfo.end()){ + + std::map::iterator DataTypeIter = ContactEditorData.HomeIMListTypeInfo.find(iter->first); + + strIMFinalValue.insert(0, ":"); + strIMFinalValue.insert(0, DataTypeIter->second); + + } else { + + strIMFinalValue.insert(0, "none:"); + + } + + ProcessSaveData(wxT("IMPP;TYPE=home"), &strValue2, &boolValue2, &boolValue, + &iter, &ContactEditorData.HomeIMList, &ContactData, + wxT("ALTID"), &ContactEditorData.HomeIMListAltID, + wxT("PID"), &ContactEditorData.HomeIMListPID, + wxT("MEDIATYPE"), &ContactEditorData.HomeIMListMediatype, + wxT("PREF"), &ContactEditorData.HomeIMListPref, + wxT(""), &ContactEditorData.HomeIMListTokens ); + + ResetSaveProcessData(); - } + } - ResetSaveProcessData(); + ResetSaveProcessData(); - for (std::map::iterator iter = GeneralTelephoneList.begin(); - iter != GeneralTelephoneList.end(); ++iter){ - - wxString strAddressFinalValue = iter->second; + for (std::map::iterator iter = ContactEditorData.BusinessIMList.begin(); + iter != ContactEditorData.BusinessIMList.end(); ++iter){ - ProcessCaptureStrings(&strAddressFinalValue); + wxString strIMFinalValue = iter->second; - strAddressFinalValue.insert(0, wxT("tel:")); + ProcessCaptureStrings(&strIMFinalValue); - ProcessSaveData(wxT("TEL"), &strValue2, &boolValue2, &boolValue, - &iter, &strAddressFinalValue, &ContactData, - wxT("ALTID"), &GeneralTelephoneListAltID, - wxT("PID"), &GeneralTelephoneListPID, - wxT("TYPE"), &GeneralTelephoneListType, - wxT("PREF"), &GeneralTelephoneListPref, - wxT(""), &GeneralTelephoneListTokens ); - - ResetSaveProcessData(); + if (ContactEditorData.BusinessIMListTypeInfo.find(iter->first) != + ContactEditorData.BusinessIMListTypeInfo.end()){ + + std::map::iterator DataTypeIter = ContactEditorData.BusinessIMListTypeInfo.find(iter->first); + + strIMFinalValue.insert(0, ":"); + strIMFinalValue.insert(0, DataTypeIter->second); + + } else { + + strIMFinalValue.insert(0, "none:"); + + } + + ProcessSaveData(wxT("IMPP;TYPE=work"), &strValue2, &boolValue2, &boolValue, + &iter, &ContactEditorData.BusinessIMList, &ContactData, + wxT("ALTID"), &ContactEditorData.BusinessIMListAltID, + wxT("PID"), &ContactEditorData.BusinessIMListPID, + wxT("MEDIATYPE"), &ContactEditorData.BusinessIMListMediatype, + wxT("PREF"), &ContactEditorData.BusinessIMListPref, + wxT(""), &ContactEditorData.BusinessIMListTokens ); + + ResetSaveProcessData(); - } + } - ResetSaveProcessData(); + ResetSaveProcessData(); - for (std::map::iterator iter = HomeTelephoneList.begin(); - iter != HomeTelephoneList.end(); ++iter){ - - wxString strAddressFinalValue = iter->second; - - ProcessCaptureStrings(&strAddressFinalValue); + for (std::map::iterator iter = ContactEditorData.GeneralTelephoneList.begin(); + iter != ContactEditorData.GeneralTelephoneList.end(); ++iter){ - strAddressFinalValue.insert(0, wxT("tel:")); + wxString strAddressFinalValue = iter->second; + int DataID = iter->first; - ProcessSaveData(wxT("TEL"), &strValue2, &boolValue2, &boolValue, - &iter, &strAddressFinalValue, &ContactData, - wxT("ALTID"), &HomeTelephoneListAltID, - wxT("PID"), &HomeTelephoneListPID, - wxT("TYPE"), &HomeTelephoneListType, - wxT("PREF"), &HomeTelephoneListPref, - wxT(""), &HomeTelephoneListTokens ); + ProcessCaptureStrings(&strAddressFinalValue); - ResetSaveProcessData(); + if (MapDataExists(&DataID, &ContactEditorData.GeneralTelephoneListDataType)){ + + std::map::iterator DataTypeIter = ContactEditorData.GeneralTelephoneListDataType.find(iter->first); + + strAddressFinalValue.insert(0, ":"); + strAddressFinalValue.insert(0, DataTypeIter->second); + + } else { + + strAddressFinalValue.insert(0, "tel:"); + + } + + wxString strAddressTypeInfo; + + if (MapDataExists(&DataID, &ContactEditorData.GeneralTelephoneListTypeInfo)){ + + strAddressTypeInfo = ContactEditorData.GeneralTelephoneListTypeInfo.find(iter->first)->second; + + } + + ProcessSaveData(wxT("TEL"), &strValue2, &boolValue2, &boolValue, + &iter, &strAddressFinalValue, &ContactData, + wxT("ALTID"), &ContactEditorData.GeneralTelephoneListAltID, + wxT("PID"), &ContactEditorData.GeneralTelephoneListPID, + wxT("TYPE"), &ContactEditorData.GeneralTelephoneListTypeInfo, + wxT("PREF"), &ContactEditorData.GeneralTelephoneListPref, + wxT(""), &ContactEditorData.GeneralTelephoneListTokens ); + + ResetSaveProcessData(); - } + } - ResetSaveProcessData(); + ResetSaveProcessData(); - for (std::map::iterator iter = BusinessTelephoneList.begin(); - iter != BusinessTelephoneList.end(); ++iter){ + for (std::map::iterator iter = ContactEditorData.HomeTelephoneList.begin(); + iter != ContactEditorData.HomeTelephoneList.end(); ++iter){ - wxString strAddressFinalValue = iter->second; + wxString strAddressFinalValue = iter->second; - ProcessCaptureStrings(&strAddressFinalValue); + ProcessCaptureStrings(&strAddressFinalValue); - strAddressFinalValue.insert(0, wxT("tel:")); - - ProcessSaveData(wxT("TEL"), &strValue2, &boolValue2, &boolValue, - &iter, &strAddressFinalValue, &ContactData, - wxT("ALTID"), &BusinessTelephoneListAltID, - wxT("PID"), &BusinessTelephoneListPID, - wxT("TYPE"), &BusinessTelephoneListType, - wxT("PREF"), &BusinessTelephoneListPref, - wxT(""), &BusinessTelephoneListTokens ); - - ResetSaveProcessData(); + if (ContactEditorData.HomeTelephoneListDataType.find(iter->first) != + ContactEditorData.HomeTelephoneListDataType.end()){ + + std::map::iterator DataTypeIter = ContactEditorData.HomeTelephoneListDataType.find(iter->first); + + strAddressFinalValue.insert(0, ":"); + strAddressFinalValue.insert(0, DataTypeIter->second); + + } else { + + strAddressFinalValue.insert(0, "tel:"); + + } + + ProcessSaveData(wxT("TEL"), &strValue2, &boolValue2, &boolValue, + &iter, &strAddressFinalValue, &ContactData, + wxT("ALTID"), &ContactEditorData.HomeTelephoneListAltID, + wxT("PID"), &ContactEditorData.HomeTelephoneListPID, + wxT("TYPE"), &ContactEditorData.HomeTelephoneListTypeInfo, + wxT("PREF"), &ContactEditorData.HomeTelephoneListPref, + wxT(""), &ContactEditorData.HomeTelephoneListTokens ); + + ResetSaveProcessData(); - } + } - ResetSaveProcessData(); + ResetSaveProcessData(); - for (std::map::iterator iter = GeneralLanguageList.begin(); - iter != GeneralLanguageList.end(); ++iter){ + for (std::map::iterator iter = ContactEditorData.BusinessTelephoneList.begin(); + iter != ContactEditorData.BusinessTelephoneList.end(); ++iter){ - intValue2 = iter->first; + wxString strAddressFinalValue = iter->second; - ProcessSaveData(wxT("LANG"), &strValue2, &boolValue2, &boolValue, - &iter, &GeneralLanguageList, &ContactData, - wxT("ALTID"), &GeneralLanguageListAltID, - wxT("PID"), &GeneralLanguageListPID, - wxT("PREF"), &GeneralLanguageListPref, - wxT(""), &GeneralLanguageListTokens ); + ProcessCaptureStrings(&strAddressFinalValue); - ResetSaveProcessData(); + if (ContactEditorData.BusinessTelephoneListDataType.find(iter->first) != + ContactEditorData.BusinessTelephoneListDataType.end()){ + + std::map::iterator DataTypeIter = ContactEditorData.BusinessTelephoneListDataType.find(iter->first); + + strAddressFinalValue.insert(0, ":"); + strAddressFinalValue.insert(0, DataTypeIter->second); + + } else { + + strAddressFinalValue.insert(0, "tel:"); + + } + + ProcessSaveData(wxT("TEL"), &strValue2, &boolValue2, &boolValue, + &iter, &strAddressFinalValue, &ContactData, + wxT("ALTID"), &ContactEditorData.BusinessTelephoneListAltID, + wxT("PID"), &ContactEditorData.BusinessTelephoneListPID, + wxT("TYPE"), &ContactEditorData.BusinessTelephoneListTypeInfo, + wxT("PREF"), &ContactEditorData.BusinessTelephoneListPref, + wxT(""), &ContactEditorData.BusinessTelephoneListTokens ); + + ResetSaveProcessData(); - } + } - ResetSaveProcessData(); + ResetSaveProcessData(); - for (std::map::iterator iter = HomeLanguageList.begin(); - iter != HomeLanguageList.end(); ++iter){ + for (std::map::iterator iter = ContactEditorData.GeneralLanguageList.begin(); + iter != ContactEditorData.GeneralLanguageList.end(); ++iter){ - ProcessSaveData(wxT("LANG;TYPE=home"), &strValue2, &boolValue2, &boolValue, - &iter, &HomeLanguageList, &ContactData, - wxT("ALTID"), &HomeLanguageListAltID, - wxT("PID"), &HomeLanguageListPID, - wxT("PREF"), &HomeLanguageListPref, - wxT(""), &HomeLanguageListTokens ); + intValue2 = iter->first; - ResetSaveProcessData(); + ProcessSaveData(wxT("LANG"), &strValue2, &boolValue2, &boolValue, + &iter, &ContactEditorData.GeneralLanguageList, &ContactData, + wxT("ALTID"), &ContactEditorData.GeneralLanguageListAltID, + wxT("PID"), &ContactEditorData.GeneralLanguageListPID, + wxT("PREF"), &ContactEditorData.GeneralLanguageListPref, + wxT(""), &ContactEditorData.GeneralLanguageListTokens ); + + ResetSaveProcessData(); - } + } - ResetSaveProcessData(); + ResetSaveProcessData(); - for (std::map::iterator iter = BusinessLanguageList.begin(); - iter != BusinessLanguageList.end(); ++iter){ + for (std::map::iterator iter = ContactEditorData.HomeLanguageList.begin(); + iter != ContactEditorData.HomeLanguageList.end(); ++iter){ - ProcessSaveData(wxT("LANG;TYPE=work"), &strValue2, &boolValue2, &boolValue, - &iter, &BusinessLanguageList, &ContactData, - wxT("ALTID"), &BusinessLanguageListAltID, - wxT("PID"), &BusinessLanguageListPID, - wxT("PREF"), &BusinessLanguageListPref, - wxT(""), &BusinessLanguageListTokens ); + ProcessSaveData(wxT("LANG;TYPE=home"), &strValue2, &boolValue2, &boolValue, + &iter, &ContactEditorData.HomeLanguageList, &ContactData, + wxT("ALTID"), &ContactEditorData.HomeLanguageListAltID, + wxT("PID"), &ContactEditorData.HomeLanguageListPID, + wxT("PREF"), &ContactEditorData.HomeLanguageListPref, + wxT(""), &ContactEditorData.HomeLanguageListTokens ); - ResetSaveProcessData(); + ResetSaveProcessData(); - } + } - ResetSaveProcessData(); + ResetSaveProcessData(); - for (std::map::iterator iter = GeneralTZList.begin(); - iter != GeneralTZList.end(); ++iter){ + for (std::map::iterator iter = ContactEditorData.BusinessLanguageList.begin(); + iter != ContactEditorData.BusinessLanguageList.end(); ++iter){ - ProcessSaveData(wxT("TZ"), &strValue2, &boolValue2, &boolValue, - &iter, &GeneralTZList, &ContactData, - wxT("ALTID"), &GeneralTZListAltID, - wxT("PID"), &GeneralTZListPID, - wxT("MEDIATYPE"), &GeneralTZListMediatype, - wxT("PREF"), &GeneralTZListPref, - wxT(""), &GeneralTZListTokens ); + ProcessSaveData(wxT("LANG;TYPE=work"), &strValue2, &boolValue2, &boolValue, + &iter, &ContactEditorData.BusinessLanguageList, &ContactData, + wxT("ALTID"), &ContactEditorData.BusinessLanguageListAltID, + wxT("PID"), &ContactEditorData.BusinessLanguageListPID, + wxT("PREF"), &ContactEditorData.BusinessLanguageListPref, + wxT(""), &ContactEditorData.BusinessLanguageListTokens ); - ResetSaveProcessData(); + ResetSaveProcessData(); - } + } - ResetSaveProcessData(); + ResetSaveProcessData(); - for (std::map::iterator iter = HomeTZList.begin(); - iter != HomeTZList.end(); ++iter){ + for (std::map::iterator iter = ContactEditorData.GeneralTZList.begin(); + iter != ContactEditorData.GeneralTZList.end(); ++iter){ - ProcessSaveData(wxT("TZ;TYPE=home"), &strValue2, &boolValue2, &boolValue, - &iter, &HomeTZList, &ContactData, - wxT("ALTID"), &HomeTZListAltID, - wxT("PID"), &HomeTZListPID, - wxT("MEDIATYPE"), &HomeTZListMediatype, - wxT("PREF"), &HomeTZListPref, - wxT(""), &HomeTZListTokens ); + ProcessSaveData(wxT("TZ"), &strValue2, &boolValue2, &boolValue, + &iter, &ContactEditorData.GeneralTZList, &ContactData, + wxT("ALTID"), &ContactEditorData.GeneralTZListAltID, + wxT("PID"), &ContactEditorData.GeneralTZListPID, + wxT("MEDIATYPE"), &ContactEditorData.GeneralTZListMediatype, + wxT("PREF"), &ContactEditorData.GeneralTZListPref, + wxT(""), &ContactEditorData.GeneralTZListTokens ); - ResetSaveProcessData(); + ResetSaveProcessData(); - } + } - ResetSaveProcessData(); + ResetSaveProcessData(); - for (std::map::iterator iter = BusinessTZList.begin(); - iter != BusinessTZList.end(); ++iter){ + for (std::map::iterator iter = ContactEditorData.HomeTZList.begin(); + iter != ContactEditorData.HomeTZList.end(); ++iter){ - ProcessSaveData(wxT("TZ;TYPE=work"), &strValue2, &boolValue2, &boolValue, - &iter, &BusinessTZList, &ContactData, - wxT("ALTID"), &BusinessTZListAltID, - wxT("PID"), &BusinessTZListPID, - wxT("MEDIATYPE"), &BusinessTZListMediatype, - wxT("PREF"), &BusinessTZListPref, - wxT(""), &BusinessTZListTokens ); + ProcessSaveData(wxT("TZ;TYPE=home"), &strValue2, &boolValue2, &boolValue, + &iter, &ContactEditorData.HomeTZList, &ContactData, + wxT("ALTID"), &ContactEditorData.HomeTZListAltID, + wxT("PID"), &ContactEditorData.HomeTZListPID, + wxT("MEDIATYPE"), &ContactEditorData.HomeTZListMediatype, + wxT("PREF"), &ContactEditorData.HomeTZListPref, + wxT(""), &ContactEditorData.HomeTZListTokens ); - ResetSaveProcessData(); + ResetSaveProcessData(); - } + } - ResetSaveProcessData(); + ResetSaveProcessData(); - for (std::map::iterator iter = GeneralGeographyList.begin(); - iter != GeneralGeographyList.end(); ++iter){ + for (std::map::iterator iter = ContactEditorData.BusinessTZList.begin(); + iter != ContactEditorData.BusinessTZList.end(); ++iter){ - wxString strAddressFinalValue = iter->second; + ProcessSaveData(wxT("TZ;TYPE=work"), &strValue2, &boolValue2, &boolValue, + &iter, &ContactEditorData.BusinessTZList, &ContactData, + wxT("ALTID"), &ContactEditorData.BusinessTZListAltID, + wxT("PID"), &ContactEditorData.BusinessTZListPID, + wxT("MEDIATYPE"), &ContactEditorData.BusinessTZListMediatype, + wxT("PREF"), &ContactEditorData.BusinessTZListPref, + wxT(""), &ContactEditorData.BusinessTZListTokens ); - ProcessCaptureStrings(&strAddressFinalValue); + ResetSaveProcessData(); - strAddressFinalValue.insert(0, wxT("geo:")); - - ProcessSaveData(wxT("GEO"), &strValue2, &boolValue2, &boolValue, - &iter, &strAddressFinalValue, &ContactData, - wxT("ALTID"), &GeneralGeographyListAltID, - wxT("PID"), &GeneralGeographyListPID, - wxT("MEDIATYPE"), &GeneralGeographyListMediatype, - wxT("PREF"), &GeneralGeographyListPref, - wxT(""), &GeneralGeographyListTokens ); - - ResetSaveProcessData(); - - } + } - ResetSaveProcessData(); + ResetSaveProcessData(); - for (std::map::iterator iter = HomeGeographyList.begin(); - iter != HomeGeographyList.end(); ++iter){ + for (std::map::iterator iter = ContactEditorData.GeneralGeographyList.begin(); + iter != ContactEditorData.GeneralGeographyList.end(); ++iter){ - wxString strAddressFinalValue = iter->second; + wxString strGeoFinalValue = iter->second; - ProcessCaptureStrings(&strAddressFinalValue); + ProcessCaptureStrings(&strGeoFinalValue); - strAddressFinalValue.insert(0, wxT("geo:")); + if (ContactEditorData.GeneralGeographyListDataType.find(iter->first) != + ContactEditorData.GeneralGeographyListDataType.end()){ + + std::map::iterator DataTypeIter = ContactEditorData.GeneralGeographyListDataType.find(iter->first); + + strGeoFinalValue.insert(0, ":"); + strGeoFinalValue.insert(0, DataTypeIter->second); + + } else { + + strGeoFinalValue.insert(0, "geo:"); + + } - ProcessSaveData(wxT("GEO;TYPE=home"), &strValue2, &boolValue2, &boolValue, - &iter, &HomeGeographyList, &ContactData, - wxT("ALTID"), &HomeGeographyListAltID, - wxT("PID"), &HomeGeographyListPID, - wxT("MEDIATYPE"), &HomeGeographyListMediatype, - wxT("PREF"), &HomeGeographyListPref, - wxT(""), &HomeGeographyListTokens ); + ProcessSaveData(wxT("GEO"), &strValue2, &boolValue2, &boolValue, + &iter, &strGeoFinalValue, &ContactData, + wxT("ALTID"), &ContactEditorData.GeneralGeographyListAltID, + wxT("PID"), &ContactEditorData.GeneralGeographyListPID, + wxT("MEDIATYPE"), &ContactEditorData.GeneralGeographyListMediatype, + wxT("PREF"), &ContactEditorData.GeneralGeographyListPref, + wxT(""), &ContactEditorData.GeneralGeographyListTokens ); - ResetSaveProcessData(); + ResetSaveProcessData(); - } + } - ResetSaveProcessData(); + ResetSaveProcessData(); - for (std::map::iterator iter = BusinessGeographyList.begin(); - iter != BusinessGeographyList.end(); ++iter){ - - wxString strAddressFinalValue = iter->second; + for (std::map::iterator iter = ContactEditorData.HomeGeographyList.begin(); + iter != ContactEditorData.HomeGeographyList.end(); ++iter){ - ProcessCaptureStrings(&strAddressFinalValue); + wxString strGeoFinalValue = iter->second; + + ProcessCaptureStrings(&strGeoFinalValue); - strAddressFinalValue.insert(0, wxT("geo:")); + if (ContactEditorData.HomeGeographyListDataType.find(iter->first) != + ContactEditorData.HomeGeographyListDataType.end()){ + + std::map::iterator DataTypeIter = ContactEditorData.HomeGeographyListDataType.find(iter->first); + + strGeoFinalValue.insert(0, ":"); + strGeoFinalValue.insert(0, DataTypeIter->second); + + } else { + + strGeoFinalValue.insert(0, "geo:"); + + } - ProcessSaveData(wxT("GEO;TYPE=work"), &strValue2, &boolValue2, &boolValue, - &iter, &BusinessGeographyList, &ContactData, - wxT("ALTID"), &BusinessGeographyListAltID, - wxT("PID"), &BusinessGeographyListPID, - wxT("MEDIATYPE"), &BusinessGeographyListMediatype, - wxT("PREF"), &BusinessGeographyListPref, - wxT(""), &BusinessGeographyListTokens ); + ProcessSaveData(wxT("GEO;TYPE=home"), &strValue2, &boolValue2, &boolValue, + &iter, &strGeoFinalValue, &ContactData, + wxT("ALTID"), &ContactEditorData.HomeGeographyListAltID, + wxT("PID"), &ContactEditorData.HomeGeographyListPID, + wxT("MEDIATYPE"), &ContactEditorData.HomeGeographyListMediatype, + wxT("PREF"), &ContactEditorData.HomeGeographyListPref, + wxT(""), &ContactEditorData.HomeGeographyListTokens ); - ResetSaveProcessData(); + ResetSaveProcessData(); - } + } - ResetSaveProcessData(); + ResetSaveProcessData(); - for (std::map::iterator iter = GeneralRelatedList.begin(); - iter != GeneralRelatedList.end(); ++iter){ + for (std::map::iterator iter = ContactEditorData.BusinessGeographyList.begin(); + iter != ContactEditorData.BusinessGeographyList.end(); ++iter){ - ProcessSaveData(wxT("RELATED"), &strValue2, &boolValue2, &boolValue, - &iter, &GeneralRelatedList, &ContactData, - wxT("ALTID"), &GeneralRelatedListAltID, - wxT("PID"), &GeneralRelatedListPID, - wxT("LANGUAGE"), &GeneralRelatedListLanguage, - wxT("TYPE"), &GeneralRelatedListRelType, - wxT("PREF"), &GeneralRelatedListPref, - wxT(""), &GeneralRelatedListTokens ); + wxString strGeoFinalValue = iter->second; - ResetSaveProcessData(); + ProcessCaptureStrings(&strGeoFinalValue); - } + if (ContactEditorData.BusinessGeographyListDataType.find(iter->first) != + ContactEditorData.BusinessGeographyListDataType.end()){ + + std::map::iterator DataTypeIter = ContactEditorData.BusinessGeographyListDataType.find(iter->first); + + strGeoFinalValue.insert(0, ":"); + strGeoFinalValue.insert(0, DataTypeIter->second); + + } else { + + strGeoFinalValue.insert(0, "geo:"); + + } + + ProcessSaveData(wxT("GEO;TYPE=work"), &strValue2, &boolValue2, &boolValue, + &iter, &strGeoFinalValue, &ContactData, + wxT("ALTID"), &ContactEditorData.BusinessGeographyListAltID, + wxT("PID"), &ContactEditorData.BusinessGeographyListPID, + wxT("MEDIATYPE"), &ContactEditorData.BusinessGeographyListMediatype, + wxT("PREF"), &ContactEditorData.BusinessGeographyListPref, + wxT(""), &ContactEditorData.BusinessGeographyListTokens ); + + ResetSaveProcessData(); + + } - ResetSaveProcessData(); + ResetSaveProcessData(); - for (std::map::iterator iter = GeneralWebsiteList.begin(); - iter != GeneralWebsiteList.end(); ++iter){ + for (std::map::iterator iter = ContactEditorData.GeneralRelatedList.begin(); + iter != ContactEditorData.GeneralRelatedList.end(); ++iter){ - ProcessSaveData(wxT("URL"), &strValue2, &boolValue2, &boolValue, - &iter, &GeneralWebsiteList, &ContactData, - wxT("ALTID"), &GeneralWebsiteListAltID, - wxT("PID"), &GeneralWebsiteListPID, - wxT("MEDIATYPE"), &GeneralWebsiteListMediatype, - wxT("PREF"), &GeneralWebsiteListPref, - wxT(""), &GeneralWebsiteListTokens ); + ProcessSaveData(wxT("RELATED"), &strValue2, &boolValue2, &boolValue, + &iter, &ContactEditorData.GeneralRelatedList, &ContactData, + wxT("ALTID"), &ContactEditorData.GeneralRelatedListAltID, + wxT("PID"), &ContactEditorData.GeneralRelatedListPID, + wxT("LANGUAGE"), &ContactEditorData.GeneralRelatedListLanguage, + wxT("TYPE"), &ContactEditorData.GeneralRelatedListRelType, + wxT("PREF"), &ContactEditorData.GeneralRelatedListPref, + wxT(""), &ContactEditorData.GeneralRelatedListTokens ); - ResetSaveProcessData(); + ResetSaveProcessData(); - } + } - ResetSaveProcessData(); + ResetSaveProcessData(); - for (std::map::iterator iter = HomeWebsiteList.begin(); - iter != HomeWebsiteList.end(); ++iter){ + for (std::map::iterator iter = ContactEditorData.GeneralWebsiteList.begin(); + iter != ContactEditorData.GeneralWebsiteList.end(); ++iter){ - ProcessSaveData(wxT("URL;TYPE=home"), &strValue2, &boolValue2, &boolValue, - &iter, &HomeWebsiteList, &ContactData, - wxT("ALTID"), &HomeWebsiteListAltID, - wxT("PID"), &HomeWebsiteListPID, - wxT("MEDIATYPE"), &HomeWebsiteListMediatype, - wxT("PREF"), &HomeWebsiteListPref, - wxT(""), &HomeWebsiteListTokens ); + ProcessSaveData(wxT("URL"), &strValue2, &boolValue2, &boolValue, + &iter, &ContactEditorData.GeneralWebsiteList, &ContactData, + wxT("ALTID"), &ContactEditorData.GeneralWebsiteListAltID, + wxT("PID"), &ContactEditorData.GeneralWebsiteListPID, + wxT("MEDIATYPE"), &ContactEditorData.GeneralWebsiteListMediatype, + wxT("PREF"), &ContactEditorData.GeneralWebsiteListPref, + wxT(""), &ContactEditorData.GeneralWebsiteListTokens ); - ResetSaveProcessData(); + ResetSaveProcessData(); - } + } - ResetSaveProcessData(); + ResetSaveProcessData(); - for (std::map::iterator iter = BusinessWebsiteList.begin(); - iter != BusinessWebsiteList.end(); ++iter){ + for (std::map::iterator iter = ContactEditorData.HomeWebsiteList.begin(); + iter != ContactEditorData.HomeWebsiteList.end(); ++iter){ - ProcessSaveData(wxT("URL;TYPE=work"), &strValue2, &boolValue2, &boolValue, - &iter, &BusinessWebsiteList, &ContactData, - wxT("ALTID"), &BusinessWebsiteListAltID, - wxT("PID"), &BusinessWebsiteListPID, - wxT("MEDIATYPE"), &BusinessWebsiteListMediatype, - wxT("PREF"), &BusinessWebsiteListPref, - wxT(""), &BusinessWebsiteListTokens ); + ProcessSaveData(wxT("URL;TYPE=home"), &strValue2, &boolValue2, &boolValue, + &iter, &ContactEditorData.HomeWebsiteList, &ContactData, + wxT("ALTID"), &ContactEditorData.HomeWebsiteListAltID, + wxT("PID"), &ContactEditorData.HomeWebsiteListPID, + wxT("MEDIATYPE"), &ContactEditorData.HomeWebsiteListMediatype, + wxT("PREF"), &ContactEditorData.HomeWebsiteListPref, + wxT(""), &ContactEditorData.HomeWebsiteListTokens ); - ResetSaveProcessData(); + ResetSaveProcessData(); - } + } - ResetSaveProcessData(); + ResetSaveProcessData(); - for (std::map::iterator iter = GeneralTitleList.begin(); - iter != GeneralTitleList.end(); ++iter){ + for (std::map::iterator iter = ContactEditorData.BusinessWebsiteList.begin(); + iter != ContactEditorData.BusinessWebsiteList.end(); ++iter){ - ProcessSaveData(wxT("TITLE"), &strValue2, &boolValue2, &boolValue, - &iter, &GeneralTitleList, &ContactData, - wxT("ALTID"), &GeneralTitleListAltID, - wxT("PID"), &GeneralTitleListPID, - wxT("LANGUAGE"), &GeneralTitleListLanguage, - wxT("PREF"), &GeneralTitleListPref, - wxT(""), &GeneralTitleListTokens ); + ProcessSaveData(wxT("URL;TYPE=work"), &strValue2, &boolValue2, &boolValue, + &iter, &ContactEditorData.BusinessWebsiteList, &ContactData, + wxT("ALTID"), &ContactEditorData.BusinessWebsiteListAltID, + wxT("PID"), &ContactEditorData.BusinessWebsiteListPID, + wxT("MEDIATYPE"), &ContactEditorData.BusinessWebsiteListMediatype, + wxT("PREF"), &ContactEditorData.BusinessWebsiteListPref, + wxT(""), &ContactEditorData.BusinessWebsiteListTokens ); - ResetSaveProcessData(); + ResetSaveProcessData(); - } + } - ResetSaveProcessData(); + ResetSaveProcessData(); - for (std::map::iterator iter = HomeTitleList.begin(); - iter != HomeTitleList.end(); ++iter){ + for (std::map::iterator iter = ContactEditorData.GeneralTitleList.begin(); + iter != ContactEditorData.GeneralTitleList.end(); ++iter){ - ProcessSaveData(wxT("TITLE;TYPE=home"), &strValue2, &boolValue2, &boolValue, - &iter, &HomeTitleList, &ContactData, - wxT("ALTID"), &HomeTitleListAltID, - wxT("PID"), &HomeTitleListPID, - wxT("LANGUAGE"), &HomeTitleListLanguage, - wxT("PREF"), &HomeTitleListPref, - wxT(""), &HomeTitleListTokens ); + ProcessSaveData(wxT("TITLE"), &strValue2, &boolValue2, &boolValue, + &iter, &ContactEditorData.GeneralTitleList, &ContactData, + wxT("ALTID"), &ContactEditorData.GeneralTitleListAltID, + wxT("PID"), &ContactEditorData.GeneralTitleListPID, + wxT("LANGUAGE"), &ContactEditorData.GeneralTitleListLanguage, + wxT("PREF"), &ContactEditorData.GeneralTitleListPref, + wxT(""), &ContactEditorData.GeneralTitleListTokens ); - ResetSaveProcessData(); + ResetSaveProcessData(); - } + } - ResetSaveProcessData(); + ResetSaveProcessData(); - for (std::map::iterator iter = BusinessTitleList.begin(); - iter != BusinessTitleList.end(); ++iter){ + for (std::map::iterator iter = ContactEditorData.HomeTitleList.begin(); + iter != ContactEditorData.HomeTitleList.end(); ++iter){ - ProcessSaveData(wxT("TITLE;TYPE=work"), &strValue2, &boolValue2, &boolValue, - &iter, &BusinessTitleList, &ContactData, - wxT("ALTID"), &BusinessTitleListAltID, - wxT("PID"), &BusinessTitleListPID, - wxT("LANGUAGE"), &BusinessTitleListLanguage, - wxT("PREF"), &BusinessTitleListPref, - wxT(""), &BusinessTitleListTokens ); + ProcessSaveData(wxT("TITLE;TYPE=home"), &strValue2, &boolValue2, &boolValue, + &iter, &ContactEditorData.HomeTitleList, &ContactData, + wxT("ALTID"), &ContactEditorData.HomeTitleListAltID, + wxT("PID"), &ContactEditorData.HomeTitleListPID, + wxT("LANGUAGE"), &ContactEditorData.HomeTitleListLanguage, + wxT("PREF"), &ContactEditorData.HomeTitleListPref, + wxT(""), &ContactEditorData.HomeTitleListTokens ); - ResetSaveProcessData(); + ResetSaveProcessData(); - } + } - ResetSaveProcessData(); + ResetSaveProcessData(); - for (std::map::iterator iter = GeneralRoleList.begin(); - iter != GeneralRoleList.end(); ++iter){ - - ProcessSaveData(wxT("ROLE"), &strValue2, &boolValue2, &boolValue, - &iter, &GeneralRoleList, &ContactData, - wxT("ALTID"), &GeneralRoleListAltID, - wxT("PID"), &GeneralRoleListPID, - wxT("LANGUAGE"), &GeneralRoleListLanguage, - wxT("PREF"), &GeneralRoleListPref, - wxT(""), &GeneralRoleListTokens ); + for (std::map::iterator iter = ContactEditorData.BusinessTitleList.begin(); + iter != ContactEditorData.BusinessTitleList.end(); ++iter){ - ResetSaveProcessData(); + ProcessSaveData(wxT("TITLE;TYPE=work"), &strValue2, &boolValue2, &boolValue, + &iter, &ContactEditorData.BusinessTitleList, &ContactData, + wxT("ALTID"), &ContactEditorData.BusinessTitleListAltID, + wxT("PID"), &ContactEditorData.BusinessTitleListPID, + wxT("LANGUAGE"), &ContactEditorData.BusinessTitleListLanguage, + wxT("PREF"), &ContactEditorData.BusinessTitleListPref, + wxT(""), &ContactEditorData.BusinessTitleListTokens ); + + ResetSaveProcessData(); - } + } - ResetSaveProcessData(); + ResetSaveProcessData(); - for (std::map::iterator iter = HomeRoleList.begin(); - iter != HomeRoleList.end(); ++iter){ + for (std::map::iterator iter = ContactEditorData.GeneralRoleList.begin(); + iter != ContactEditorData.GeneralRoleList.end(); ++iter){ - ProcessSaveData(wxT("ROLE;TYPE=home"), &strValue2, &boolValue2, &boolValue, - &iter, &HomeRoleList, &ContactData, - wxT("ALTID"), &HomeRoleListAltID, - wxT("PID"), &HomeRoleListPID, - wxT("LANGUAGE"), &HomeRoleListLanguage, - wxT("PREF"), &HomeRoleListPref, - wxT(""), &HomeRoleListTokens ); + ProcessSaveData(wxT("ROLE"), &strValue2, &boolValue2, &boolValue, + &iter, &ContactEditorData.GeneralRoleList, &ContactData, + wxT("ALTID"), &ContactEditorData.GeneralRoleListAltID, + wxT("PID"), &ContactEditorData.GeneralRoleListPID, + wxT("LANGUAGE"), &ContactEditorData.GeneralRoleListLanguage, + wxT("PREF"), &ContactEditorData.GeneralRoleListPref, + wxT(""), &ContactEditorData.GeneralRoleListTokens ); - ResetSaveProcessData(); + ResetSaveProcessData(); - } + } - ResetSaveProcessData(); + ResetSaveProcessData(); - for (std::map::iterator iter = BusinessRoleList.begin(); - iter != BusinessRoleList.end(); ++iter){ + for (std::map::iterator iter = ContactEditorData.HomeRoleList.begin(); + iter != ContactEditorData.HomeRoleList.end(); ++iter){ - ProcessSaveData(wxT("ROLE;TYPE=work"), &strValue2, &boolValue2, &boolValue, - &iter, &BusinessRoleList, &ContactData, - wxT("ALTID"), &BusinessRoleListAltID, - wxT("PID"), &BusinessRoleListPID, - wxT("LANGUAGE"), &BusinessRoleListLanguage, - wxT("PREF"), &BusinessRoleListPref, - wxT(""), &BusinessRoleListTokens ); + ProcessSaveData(wxT("ROLE;TYPE=home"), &strValue2, &boolValue2, &boolValue, + &iter, &ContactEditorData.HomeRoleList, &ContactData, + wxT("ALTID"), &ContactEditorData.HomeRoleListAltID, + wxT("PID"), &ContactEditorData.HomeRoleListPID, + wxT("LANGUAGE"), &ContactEditorData.HomeRoleListLanguage, + wxT("PREF"), &ContactEditorData.HomeRoleListPref, + wxT(""), &ContactEditorData.HomeRoleListTokens ); - ResetSaveProcessData(); + ResetSaveProcessData(); - } + } - ResetSaveProcessData(); + ResetSaveProcessData(); - for (std::map::iterator iter = GeneralOrganisationsList.begin(); - iter != GeneralOrganisationsList.end(); ++iter){ + for (std::map::iterator iter = ContactEditorData.BusinessRoleList.begin(); + iter != ContactEditorData.BusinessRoleList.end(); ++iter){ - ProcessSaveData(wxT("ORG"), &strValue2, &boolValue2, &boolValue, - &iter, &GeneralOrganisationsList, &ContactData, - wxT("ALTID"), &GeneralOrganisationsListAltID, - wxT("PID"), &GeneralOrganisationsListPID, - wxT("LANGUAGE"), &GeneralOrganisationsListLanguage, - wxT("SORT-AS"), &GeneralOrganisationsListSortAs, - wxT("PREF"), &GeneralOrganisationsListPref, - wxT(""), &GeneralOrganisationsListTokens ); + ProcessSaveData(wxT("ROLE;TYPE=work"), &strValue2, &boolValue2, &boolValue, + &iter, &ContactEditorData.BusinessRoleList, &ContactData, + wxT("ALTID"), &ContactEditorData.BusinessRoleListAltID, + wxT("PID"), &ContactEditorData.BusinessRoleListPID, + wxT("LANGUAGE"), &ContactEditorData.BusinessRoleListLanguage, + wxT("PREF"), &ContactEditorData.BusinessRoleListPref, + wxT(""), &ContactEditorData.BusinessRoleListTokens ); - ResetSaveProcessData(); + ResetSaveProcessData(); - } + } - ResetSaveProcessData(); + ResetSaveProcessData(); - for (std::map::iterator iter = HomeOrganisationsList.begin(); - iter != HomeOrganisationsList.end(); ++iter){ + for (std::map::iterator iter = ContactEditorData.GeneralOrganisationsList.begin(); + iter != ContactEditorData.GeneralOrganisationsList.end(); ++iter){ - ProcessSaveData(wxT("ORG;TYPE=home"), &strValue2, &boolValue2, &boolValue, - &iter, &HomeOrganisationsList, &ContactData, - wxT("ALTID"), &HomeOrganisationsListAltID, - wxT("PID"), &HomeOrganisationsListPID, - wxT("LANGUAGE"), &HomeOrganisationsListLanguage, - wxT("SORT-AS"), &HomeOrganisationsListSortAs, - wxT("PREF"), &HomeOrganisationsListPref, - wxT(""), &HomeOrganisationsListTokens ); + ProcessSaveData(wxT("ORG"), &strValue2, &boolValue2, &boolValue, + &iter, &ContactEditorData.GeneralOrganisationsList, &ContactData, + wxT("ALTID"), &ContactEditorData.GeneralOrganisationsListAltID, + wxT("PID"), &ContactEditorData.GeneralOrganisationsListPID, + wxT("LANGUAGE"), &ContactEditorData.GeneralOrganisationsListLanguage, + wxT("SORT-AS"), &ContactEditorData.GeneralOrganisationsListSortAs, + wxT("PREF"), &ContactEditorData.GeneralOrganisationsListPref, + wxT(""), &ContactEditorData.GeneralOrganisationsListTokens ); - ResetSaveProcessData(); + ResetSaveProcessData(); - } + } - ResetSaveProcessData(); + ResetSaveProcessData(); - for (std::map::iterator iter = BusinessOrganisationsList.begin(); - iter != BusinessOrganisationsList.end(); ++iter){ + for (std::map::iterator iter = ContactEditorData.HomeOrganisationsList.begin(); + iter != ContactEditorData.HomeOrganisationsList.end(); ++iter){ - ProcessSaveData(wxT("ORG;TYPE=work"), &strValue2, &boolValue2, &boolValue, - &iter, &BusinessOrganisationsList, &ContactData, - wxT("ALTID"), &BusinessOrganisationsListAltID, - wxT("PID"), &BusinessOrganisationsListPID, - wxT("LANGUAGE"), &BusinessOrganisationsListLanguage, - wxT("SORT-AS"), &BusinessOrganisationsListSortAs, - wxT("PREF"), &BusinessOrganisationsListPref, - wxT(""), &BusinessOrganisationsListTokens ); + ProcessSaveData(wxT("ORG;TYPE=home"), &strValue2, &boolValue2, &boolValue, + &iter, &ContactEditorData.HomeOrganisationsList, &ContactData, + wxT("ALTID"), &ContactEditorData.HomeOrganisationsListAltID, + wxT("PID"), &ContactEditorData.HomeOrganisationsListPID, + wxT("LANGUAGE"), &ContactEditorData.HomeOrganisationsListLanguage, + wxT("SORT-AS"), &ContactEditorData.HomeOrganisationsListSortAs, + wxT("PREF"), &ContactEditorData.HomeOrganisationsListPref, + wxT(""), &ContactEditorData.HomeOrganisationsListTokens ); - ResetSaveProcessData(); + ResetSaveProcessData(); - } + } - ResetSaveProcessData(); + ResetSaveProcessData(); - for (std::map::iterator iter = GeneralNoteList.begin(); - iter != GeneralNoteList.end(); ++iter){ + for (std::map::iterator iter = ContactEditorData.BusinessOrganisationsList.begin(); + iter != ContactEditorData.BusinessOrganisationsList.end(); ++iter){ - ProcessSaveData(wxT("NOTE"), &strValue2, &boolValue2, &boolValue, - &iter, &GeneralNoteList, &ContactData, - wxT("ALTID"), &GeneralNoteListAltID, - wxT("PID"), &GeneralNoteListPID, - wxT("LANGUAGE"), &GeneralNoteListLanguage, - wxT("PREF"), &GeneralNoteListPref, - wxT(""), &GeneralNoteListTokens ); + ProcessSaveData(wxT("ORG;TYPE=work"), &strValue2, &boolValue2, &boolValue, + &iter, &ContactEditorData.BusinessOrganisationsList, &ContactData, + wxT("ALTID"), &ContactEditorData.BusinessOrganisationsListAltID, + wxT("PID"), &ContactEditorData.BusinessOrganisationsListPID, + wxT("LANGUAGE"), &ContactEditorData.BusinessOrganisationsListLanguage, + wxT("SORT-AS"), &ContactEditorData.BusinessOrganisationsListSortAs, + wxT("PREF"), &ContactEditorData.BusinessOrganisationsListPref, + wxT(""), &ContactEditorData.BusinessOrganisationsListTokens ); - ResetSaveProcessData(); + ResetSaveProcessData(); - } + } - ResetSaveProcessData(); + ResetSaveProcessData(); - for (std::map::iterator iter = HomeNoteList.begin(); - iter != HomeNoteList.end(); ++iter){ + for (std::map::iterator iter = ContactEditorData.GeneralNoteList.begin(); + iter != ContactEditorData.GeneralNoteList.end(); ++iter){ - ProcessSaveData(wxT("NOTE;TYPE=home"), &strValue2, &boolValue2, &boolValue, - &iter, &HomeNoteList, &ContactData, - wxT("ALTID"), &HomeNoteListAltID, - wxT("PID"), &HomeNoteListPID, - wxT("LANGUAGE"), &HomeNoteListLanguage, - wxT("PREF"), &HomeNoteListPref, - wxT(""), &HomeNoteListTokens ); + ProcessSaveData(wxT("NOTE"), &strValue2, &boolValue2, &boolValue, + &iter, &ContactEditorData.GeneralNoteList, &ContactData, + wxT("ALTID"), &ContactEditorData.GeneralNoteListAltID, + wxT("PID"), &ContactEditorData.GeneralNoteListPID, + wxT("LANGUAGE"), &ContactEditorData.GeneralNoteListLanguage, + wxT("PREF"), &ContactEditorData.GeneralNoteListPref, + wxT(""), &ContactEditorData.GeneralNoteListTokens ); - ResetSaveProcessData(); + ResetSaveProcessData(); - } + } - ResetSaveProcessData(); + ResetSaveProcessData(); - for (std::map::iterator iter = BusinessNoteList.begin(); - iter != BusinessNoteList.end(); ++iter){ + for (std::map::iterator iter = ContactEditorData.HomeNoteList.begin(); + iter != ContactEditorData.HomeNoteList.end(); ++iter){ - ProcessSaveData(wxT("NOTE;TYPE=work"), &strValue2, &boolValue2, &boolValue, - &iter, &BusinessNoteList, &ContactData, - wxT("ALTID"), &BusinessNoteListAltID, - wxT("PID"), &BusinessNoteListPID, - wxT("LANGUAGE"), &BusinessNoteListLanguage, - wxT("PREF"), &BusinessNoteListPref, - wxT(""), &BusinessNoteListTokens ); + ProcessSaveData(wxT("NOTE;TYPE=home"), &strValue2, &boolValue2, &boolValue, + &iter, &ContactEditorData.HomeNoteList, &ContactData, + wxT("ALTID"), &ContactEditorData.HomeNoteListAltID, + wxT("PID"), &ContactEditorData.HomeNoteListPID, + wxT("LANGUAGE"), &ContactEditorData.HomeNoteListLanguage, + wxT("PREF"), &ContactEditorData.HomeNoteListPref, + wxT(""), &ContactEditorData.HomeNoteListTokens ); - ResetSaveProcessData(); + ResetSaveProcessData(); - } + } - ResetSaveProcessData(); + ResetSaveProcessData(); - for (std::map::iterator iter = CategoriesList.begin(); - iter != CategoriesList.end(); ++iter){ - - ProcessSaveData(wxT("CATEGORIES"), &strValue2, &boolValue2, &boolValue, - &iter, &CategoriesList, &ContactData, - wxT("ALTID"), &CategoriesListAltID, - wxT("PID"), &CategoriesListPID, - wxT("TYPE"), &CategoriesListType, - wxT("PREF"), &CategoriesListPref, - wxT(""), &CategoriesListTokens ); + for (std::map::iterator iter = ContactEditorData.BusinessNoteList.begin(); + iter != ContactEditorData.BusinessNoteList.end(); ++iter){ - ResetSaveProcessData(); - - } + ProcessSaveData(wxT("NOTE;TYPE=work"), &strValue2, &boolValue2, &boolValue, + &iter, &ContactEditorData.BusinessNoteList, &ContactData, + wxT("ALTID"), &ContactEditorData.BusinessNoteListAltID, + wxT("PID"), &ContactEditorData.BusinessNoteListPID, + wxT("LANGUAGE"), &ContactEditorData.BusinessNoteListLanguage, + wxT("PREF"), &ContactEditorData.BusinessNoteListPref, + wxT(""), &ContactEditorData.BusinessNoteListTokens ); + + ResetSaveProcessData(); + + } - // Pictures. + ResetSaveProcessData(); - for (std::map::iterator iter = PicturesList.begin(); - iter != PicturesList.end(); ++iter){ - - int intValueIndex = iter->first; + for (std::map::iterator iter = ContactEditorData.CategoriesList.begin(); + iter != ContactEditorData.CategoriesList.end(); ++iter){ - std::map::iterator stdstriter; - std::map::iterator enciter; + ProcessSaveData(wxT("CATEGORIES"), &strValue2, &boolValue2, &boolValue, + &iter, &ContactEditorData.CategoriesList, &ContactData, + wxT("ALTID"), &ContactEditorData.CategoriesListAltID, + wxT("PID"), &ContactEditorData.CategoriesListPID, + wxT("TYPE"), &ContactEditorData.CategoriesListType, + wxT("PREF"), &ContactEditorData.CategoriesListPref, + wxT(""), &ContactEditorData.CategoriesListTokens ); - striter = PicturesListPictureType.find(intValueIndex); - enciter = PicturesListPicEncType.find(intValueIndex); + ResetSaveProcessData(); - ProcessSaveData(wxT("PHOTO"), &strValue2, &boolValue2, &boolValue, - &iter, &PicturesList, &striter, - &enciter, &ContactData, - wxT("ALTID"), &PicturesListAltID, - wxT("PID"), &PicturesListPID, - wxT("TYPE"), &PicturesListType, - wxT("PREF"), &PicturesListPref, - wxT(""), &PicturesListTokens); - - ResetSaveProcessData(); - - } - - ResetSaveProcessData(); + } - // Logos. + // Pictures. - for (std::map::iterator iter = LogosList.begin(); - iter != LogosList.end(); ++iter){ + for (std::map::iterator iter = ContactEditorData.PicturesList.begin(); + iter != ContactEditorData.PicturesList.end(); ++iter){ - int intValueIndex = iter->first; + int intValueIndex = iter->first; - std::map::iterator stdstriter; - std::map::iterator enciter; + std::map::iterator stdstriter; + std::map::iterator enciter; - striter = LogosListPictureType.find(intValueIndex); - enciter = LogosListPicEncType.find(intValueIndex); + striter = ContactEditorData.PicturesListPictureType.find(intValueIndex); + enciter = ContactEditorData.PicturesListPicEncType.find(intValueIndex); - ProcessSaveData(wxT("LOGO"), &strValue2, &boolValue2, &boolValue, - &iter, &LogosList, &striter, - &enciter, &ContactData, - wxT("ALTID"), &LogosListAltID, - wxT("PID"), &LogosListPID, - wxT("TYPE"), &LogosListType, - wxT("PREF"), &LogosListPref, - wxT(""), &LogosListTokens ); + ProcessSaveData(wxT("PHOTO"), &strValue2, &boolValue2, &boolValue, + &iter, &ContactEditorData.PicturesList, &striter, + &enciter, &ContactData, + wxT("ALTID"), &ContactEditorData.PicturesListAltID, + wxT("PID"), &ContactEditorData.PicturesListPID, + wxT("TYPE"), &ContactEditorData.PicturesListType, + wxT("PREF"), &ContactEditorData.PicturesListPref, + wxT(""), &ContactEditorData.PicturesListTokens); - ResetSaveProcessData(); + ResetSaveProcessData(); - } + } - ResetSaveProcessData(); + ResetSaveProcessData(); - // Sounds. + // Logos. - for (std::map::iterator iter = SoundsList.begin(); - iter != SoundsList.end(); ++iter){ + for (std::map::iterator iter = ContactEditorData.LogosList.begin(); + iter != ContactEditorData.LogosList.end(); ++iter){ - int intValueIndex = iter->first; + int intValueIndex = iter->first; - std::map::iterator stdstriter; - std::map::iterator enciter; + std::map::iterator stdstriter; + std::map::iterator enciter; - striter = SoundsListAudioType.find(intValueIndex); - enciter = SoundsListAudioEncType.find(intValueIndex); + striter = ContactEditorData.LogosListPictureType.find(intValueIndex); + enciter = ContactEditorData.LogosListPicEncType.find(intValueIndex); - ProcessSaveData(wxT("SOUND"), &strValue2, &boolValue2, &boolValue, - &iter, &SoundsList, &striter, - &enciter, &ContactData, - wxT("ALTID"), &SoundsListAltID, - wxT("PID"), &SoundsListPID, - wxT("TYPE"), &SoundsListType, - wxT("PREF"), &SoundsListPref, - wxT(""), &SoundsListTokens ); + ProcessSaveData(wxT("LOGO"), &strValue2, &boolValue2, &boolValue, + &iter, &ContactEditorData.LogosList, &striter, + &enciter, &ContactData, + wxT("ALTID"), &ContactEditorData.LogosListAltID, + wxT("PID"), &ContactEditorData.LogosListPID, + wxT("TYPE"), &ContactEditorData.LogosListType, + wxT("PREF"), &ContactEditorData.LogosListPref, + wxT(""), &ContactEditorData.LogosListTokens ); - ResetSaveProcessData(); + ResetSaveProcessData(); - } + } - ResetSaveProcessData(); + ResetSaveProcessData(); - for (std::map::iterator iter = CalendarList.begin(); - iter != CalendarList.end(); ++iter){ - - ProcessSaveData(wxT("CALURI"), &strValue2, &boolValue2, &boolValue, - &iter, &CalendarList, &ContactData, - wxT("ALTID"), &CalendarListAltID, - wxT("PID"), &CalendarListPID, - wxT("MEDIATYPE"), &CalendarListMediatype, - wxT("TYPE"), &CalendarListType, - wxT("PREF"), &CalendarListPref, - wxT(""), &CalendarListTokens ); + // Sounds. + + for (std::map::iterator iter = ContactEditorData.SoundsList.begin(); + iter != ContactEditorData.SoundsList.end(); ++iter){ - ResetSaveProcessData(); + int intValueIndex = iter->first; - } - - ResetSaveProcessData(); - - for (std::map::iterator iter = CalendarRequestList.begin(); - iter != CalendarRequestList.end(); ++iter){ + std::map::iterator stdstriter; + std::map::iterator enciter; - ProcessSaveData(wxT("CALADRURI"), &strValue2, &boolValue2, &boolValue, - &iter, &CalendarRequestList, &ContactData, - wxT("ALTID"), &CalendarRequestListAltID, - wxT("PID"), &CalendarRequestListPID, - wxT("MEDIATYPE"), &CalendarRequestListMediatype, - wxT("TYPE"), &CalendarRequestListType, - wxT("PREF"), &CalendarRequestListPref, - wxT(""), &CalendarRequestListTokens ); + striter = ContactEditorData.SoundsListAudioType.find(intValueIndex); + enciter = ContactEditorData.SoundsListAudioEncType.find(intValueIndex); - ResetSaveProcessData(); + ProcessSaveData(wxT("SOUND"), &strValue2, &boolValue2, &boolValue, + &iter, &ContactEditorData.SoundsList, &striter, + &enciter, &ContactData, + wxT("ALTID"), &ContactEditorData.SoundsListAltID, + wxT("PID"), &ContactEditorData.SoundsListPID, + wxT("TYPE"), &ContactEditorData.SoundsListType, + wxT("PREF"), &ContactEditorData.SoundsListPref, + wxT(""), &ContactEditorData.SoundsListTokens ); + + ResetSaveProcessData(); + + } + + ResetSaveProcessData(); + + for (std::map::iterator iter = ContactEditorData.CalendarList.begin(); + iter != ContactEditorData.CalendarList.end(); ++iter){ + + ProcessSaveData(wxT("CALURI"), &strValue2, &boolValue2, &boolValue, + &iter, &ContactEditorData.CalendarList, &ContactData, + wxT("ALTID"), &ContactEditorData.CalendarListAltID, + wxT("PID"), &ContactEditorData.CalendarListPID, + wxT("MEDIATYPE"), &ContactEditorData.CalendarListMediatype, + wxT("TYPE"), &ContactEditorData.CalendarListType, + wxT("PREF"), &ContactEditorData.CalendarListPref, + wxT(""), &ContactEditorData.CalendarListTokens ); + + ResetSaveProcessData(); - } + } - ResetSaveProcessData(); + ResetSaveProcessData(); - for (std::map::iterator iter = FreeBusyList.begin(); - iter != FreeBusyList.end(); ++iter){ - - ProcessSaveData(wxT("FBURL"), &strValue2, &boolValue2, &boolValue, - &iter, &FreeBusyList, &ContactData, - wxT("ALTID"), &FreeBusyListAltID, - wxT("PID"), &FreeBusyListPID, - wxT("MEDIATYPE"), &FreeBusyListMediatype, - wxT("TYPE"), &FreeBusyListType, - wxT("PREF"), &FreeBusyListPref, - wxT(""), &FreeBusyListTokens ); + for (std::map::iterator iter = ContactEditorData.CalendarRequestList.begin(); + iter != ContactEditorData.CalendarRequestList.end(); ++iter){ - ResetSaveProcessData(); + ProcessSaveData(wxT("CALADRURI"), &strValue2, &boolValue2, &boolValue, + &iter, &ContactEditorData.CalendarRequestList, &ContactData, + wxT("ALTID"), &ContactEditorData.CalendarRequestListAltID, + wxT("PID"), &ContactEditorData.CalendarRequestListPID, + wxT("MEDIATYPE"), &ContactEditorData.CalendarRequestListMediatype, + wxT("TYPE"), &ContactEditorData.CalendarRequestListType, + wxT("PREF"), &ContactEditorData.CalendarRequestListPref, + wxT(""), &ContactEditorData.CalendarRequestListTokens ); + + ResetSaveProcessData(); - } + } + + ResetSaveProcessData(); + + for (std::map::iterator iter = ContactEditorData.FreeBusyList.begin(); + iter != ContactEditorData.FreeBusyList.end(); ++iter){ + + ProcessSaveData(wxT("FBURL"), &strValue2, &boolValue2, &boolValue, + &iter, &ContactEditorData.FreeBusyList, &ContactData, + wxT("ALTID"), &ContactEditorData.FreeBusyListAltID, + wxT("PID"), &ContactEditorData.FreeBusyListPID, + wxT("MEDIATYPE"), &ContactEditorData.FreeBusyListMediatype, + wxT("TYPE"), &ContactEditorData.FreeBusyListType, + wxT("PREF"), &ContactEditorData.FreeBusyListPref, + wxT(""), &ContactEditorData.FreeBusyListTokens ); + + ResetSaveProcessData(); + + } - for (std::map::iterator iter = KeyList.begin(); - iter != KeyList.end(); ++iter){ - - intValue2 = iter->first; - - // Process Alternative ID. + for (std::map::iterator iter = ContactEditorData.KeyList.begin(); + iter != ContactEditorData.KeyList.end(); ++iter){ - striter = KeyListAltID.find(intValue2); + intValue2 = iter->first; + + // Get the key information. - if (striter->first == intValue2){ - - strValue3 = striter->second; - - if (!strValue3.IsEmpty()){ - - strValue3.Trim(); - strValue3.Trim(); - - if (boolValue2 == TRUE){ - - strValue2.Append(wxT(";")); - - } else { - - boolValue2 = TRUE; - - } - - strValue2.Append(wxT("ALTID=") + strValue3); - - boolValue = TRUE; - - } - - } - - // Process PID. - - striter = KeyListPID.find(intValue2); - - if (striter->first == intValue2){ - - strValue3 = striter->second; - - if (!strValue3.IsEmpty()){ - - strValue3.Trim(); - strValue3.Trim(); - - if (boolValue2 == TRUE){ - - strValue2.Append(wxT(";")); - - } else { - - boolValue2 = TRUE; - - } - - strValue2.Append(wxT("PID=") + strValue3); - - boolValue = TRUE; - - } - - } + std::map::iterator enciter; - // Process Type. + striter = ContactEditorData.KeyListDataType.find(intValue2); - striter = KeyListType.find(intValue2); + wxString strValueData; - if (striter->first == intValue2){ - - strValue3 = striter->second; - - if (!strValue3.IsEmpty()){ - - strValue3.Trim(); - strValue3.Trim(); - - if (boolValue2 == TRUE){ - - strValue2.Append(wxT(";")); - - } else { - - boolValue2 = TRUE; - - } - - strValue2.Append(wxT("TYPE=") + strValue3); - - boolValue = TRUE; - - } - - } + strValueData = iter->second; + strValueData.insert(0, wxT("data:") + striter->second + wxT(";base64,")); + + ProcessSaveData(wxT("KEY"), &strValue2, &boolValue2, &boolValue, + &iter, &strValueData, &ContactData, + wxT("ALTID"), &ContactEditorData.KeyListAltID, + wxT("PID"), &ContactEditorData.KeyListPID, + wxT("TYPE"), &ContactEditorData.KeyListType, + wxT("PREF"), &ContactEditorData.KeyListPref, + wxT(""), &ContactEditorData.KeyListTokens ); - intiter = KeyListPref.find(intValue2); + ResetSaveProcessData(); - if (intiter->first == intValue2){ - - intValue3 = intiter->second; - - if (intValue3){ - - if (boolValue2 == TRUE){ - - strValue2.Append(wxT(";")); - - } else { - - boolValue2 = TRUE; - - } - - strValue2.Append(wxT("PREF=") + wxString::Format(wxT("%i"), intValue3)); - - boolValue = TRUE; - - } - - } - - // Process Tokens. - - striter = KeyListTokens.find(intValue2); - - if (striter->first == intValue2){ - - strValue3 = striter->second; - - if (!strValue3.IsEmpty()){ - - strValue3.Trim(); - strValue3.Trim(); - - if (boolValue2 == TRUE){ - - strValue2.Append(wxT(";")); - - } else { - - boolValue2 = TRUE; - - } - - strValue2.Append(strValue3); - - boolValue = TRUE; - - } - - } - - // Get the key information. - - std::map::iterator enciter; - - striter = KeyListDataType.find(intValue2); - //enciter = KeyListAudioEncType.find(intValue2); - - wxString strValueData; - - strValueData = iter->second; - //strValueData.insert(0, wxT("data:") + striter->second + wxT(";") + enciter->second + wxT(",")); - strValueData.insert(0, wxT("data:") + striter->second + wxT(";base64,")); - - - // Add to the vCard. - - if (boolValue == TRUE){ - - ContactData.AddRaw(wxT("KEY;") + strValue2, strValueData); - - } else { - - ContactData.Add(wxT("KEY"), strValueData, TRUE); - - } - - ResetSaveProcessData(); - - } + } - // Vendor specific items. + // Vendor specific items. - ResetSaveProcessData(); + ResetSaveProcessData(); - for (std::map::iterator iter = VendorList.begin(); - iter != VendorList.end(); ++iter){ + for (std::map::iterator iter = ContactEditorData.VendorList.begin(); + iter != ContactEditorData.VendorList.end(); ++iter){ - intValue2 = iter->first; + intValue2 = iter->first; - // Get the IANA PEN number. + // Get the IANA PEN number. - striter = VendorListPEN.find(intValue2); + striter = ContactEditorData.VendorListPEN.find(intValue2); - if (striter->first == intValue2){ - - strValue2 = striter->second; + if (striter->first == intValue2){ - } + strValue2 = striter->second; + + } - // Get the element name. + // Get the element name. - striter = VendorListElement.find(intValue2); + striter = ContactEditorData.VendorListElement.find(intValue2); - if (striter->first == intValue2){ + if (striter->first == intValue2){ - strValue3 = striter->second; + strValue3 = striter->second; - } + } - // Get the address. + // Get the address. - striter = VendorList.find(intValue2); + striter = ContactEditorData.VendorList.find(intValue2); - if (striter->first == intValue2){ + if (striter->first == intValue2){ - strValue = striter->second; + strValue = striter->second; - } + } - // Add to the vCard. + // Add to the vCard. - if (boolValue == TRUE){ + if (boolValue == TRUE){ - ContactData.AddRaw(wxT("VND-") + strValue2 + wxT("-") + strValue3, strValue); + ContactData.AddRaw(wxT("VND-") + strValue2 + wxT("-") + strValue3, strValue); - } else { + } else { - ContactData.Add(wxT("VND-") + strValue2 + wxT("-") + strValue3, strValue, FALSE); + ContactData.Add(wxT("VND-") + strValue2 + wxT("-") + strValue3, strValue, FALSE); - } + } - ResetSaveProcessData(); + ResetSaveProcessData(); - } + } - ResetSaveProcessData(); + ResetSaveProcessData(); - // X-Tokens. + // X-Tokens. - for (std::map::iterator iter = XTokenList.begin(); - iter != XTokenList.end(); ++iter){ + for (std::map::iterator iter = ContactEditorData.XTokenList.begin(); + iter != ContactEditorData.XTokenList.end(); ++iter){ - intValue2 = iter->first; + intValue2 = iter->first; - // Get the element name. + // Get the element name. - striter = XTokenListTokens.find(intValue2); + striter = ContactEditorData.XTokenListTokens.find(intValue2); - if (striter->first == intValue2){ + if (striter->first == intValue2){ - strValue2 = striter->second; + strValue2 = striter->second; - } + } - // Get the address. + // Get the address. - striter = XTokenList.find(intValue2); + striter = ContactEditorData.XTokenList.find(intValue2); - if (striter->first == intValue2){ + if (striter->first == intValue2){ - strValue = striter->second; + strValue = striter->second; - } + } - // Add to the vCard. + // Add to the vCard. - if (boolValue == TRUE){ + if (boolValue == TRUE){ - ContactData.AddRaw(wxT("X-") + strValue2, strValue); + ContactData.AddRaw(wxT("X-") + strValue2, strValue); - } else { + } else { - ContactData.Add(wxT("X-") + strValue2, strValue, FALSE); + ContactData.Add(wxT("X-") + strValue2, strValue, FALSE); - } + } - ResetSaveProcessData(); + ResetSaveProcessData(); - } + } - ResetSaveProcessData(); + ResetSaveProcessData(); - if (FullNamesList.size() == 0){ + if (ContactEditorData.FullNamesList.size() == 0){ - wxString FullName = cmbDisplayAs->GetValue(); - FullNamesList.insert(std::make_pair(0, FullName)); - FullNamesListAltID.insert(std::make_pair(0, wxT(""))); - FullNamesListPID.insert(std::make_pair(0, wxT(""))); - FullNamesListType.insert(std::make_pair(0, wxT(""))); - FullNamesListLanguage.insert(std::make_pair(0, wxT(""))); - FullNamesListPref.insert(std::make_pair(0, 0)); - FullNamesListTokens.insert(std::make_pair(0, wxT(""))); - FNFirst = FALSE; + wxString FullName = cmbDisplayAs->GetValue(); + ContactEditorData.FullNamesList.insert(std::make_pair(0, FullName)); + ContactEditorData.FullNamesListAltID.insert(std::make_pair(0, wxT(""))); + ContactEditorData.FullNamesListPID.insert(std::make_pair(0, wxT(""))); + ContactEditorData.FullNamesListType.insert(std::make_pair(0, wxT(""))); + ContactEditorData.FullNamesListLanguage.insert(std::make_pair(0, wxT(""))); + ContactEditorData.FullNamesListPref.insert(std::make_pair(0, 0)); + ContactEditorData.FullNamesListTokens.insert(std::make_pair(0, wxT(""))); + FNFirst = FALSE; - } + } - for (std::map::iterator iter = FullNamesList.begin(); - iter != FullNamesList.end(); ++iter){ + for (std::map::iterator iter = ContactEditorData.FullNamesList.begin(); + iter != ContactEditorData.FullNamesList.end(); ++iter){ - if (FNFirst == TRUE){ + if (FNFirst == TRUE){ - iter->second = cmbDisplayAs->GetValue(); - FNFirst = FALSE; + iter->second = cmbDisplayAs->GetValue(); + FNFirst = FALSE; - } + } - std::map::iterator mapS; + std::map::iterator mapS; - mapS = FullNamesListTokens.find(iter->first); + mapS = ContactEditorData.FullNamesListTokens.find(iter->first); - ProcessSaveData(wxT("FN"), &strValue2, &boolValue2, &boolValue, - &iter, &FullNamesList, &ContactData, - wxT("ALTID"), &FullNamesListAltID, - wxT("PID"), &FullNamesListPID, - wxT("TYPE"), &FullNamesListType, - wxT("LANGUAGE"), &FullNamesListLanguage, - wxT("PREF"), &FullNamesListPref, - wxT(""), &FullNamesListTokens ); + ProcessSaveData(wxT("FN"), &strValue2, &boolValue2, &boolValue, + &iter, &ContactEditorData.FullNamesList, &ContactData, + wxT("ALTID"), &ContactEditorData.FullNamesListAltID, + wxT("PID"), &ContactEditorData.FullNamesListPID, + wxT("TYPE"), &ContactEditorData.FullNamesListType, + wxT("LANGUAGE"), &ContactEditorData.FullNamesListLanguage, + wxT("PREF"), &ContactEditorData.FullNamesListPref, + wxT(""), &ContactEditorData.FullNamesListTokens ); - // Get the address. + // Get the address. - ResetSaveProcessData(); + ResetSaveProcessData(); - } - - //ContactData.Add(wxT("FN"), cmbDisplayAs->GetValue(), FALSE); + } - // Insert revision (REV) date. + // Insert revision (REV) date. - // Get today's date and time. + // Get today's date and time. - wxDateTime DateTimeNow = wxDateTime::Now(); + wxDateTime DateTimeNow = wxDateTime::Now(); - wxString DateRev; + wxString DateRev; - // Set year, month and date. + // Set year, month and date. - int intYear = DateTimeNow.GetYear(); - int intMonth = DateTimeNow.GetMonth(); - int intDay = DateTimeNow.GetDay(); + int intYear = DateTimeNow.GetYear(); + int intMonth = DateTimeNow.GetMonth(); + int intDay = DateTimeNow.GetDay(); - DateRev.Append(wxT("0") + wxString::Format(wxT("%i"), intYear)); + DateRev.Append(wxT("0") + wxString::Format(wxT("%i"), intYear)); - if (intMonth < 10){ + if (intMonth < 10){ - DateRev.Append(wxT("0") + wxString::Format(wxT("%i"), intMonth)); + DateRev.Append(wxT("0") + wxString::Format(wxT("%i"), intMonth)); - } else { + } else { - DateRev.Append(wxString::Format(wxT("%i"), intMonth)); + DateRev.Append(wxString::Format(wxT("%i"), intMonth)); - } + } - if (intDay < 10){ + if (intDay < 10){ - DateRev.Append(wxT("0") + wxString::Format(wxT("%i"), intDay)); + DateRev.Append(wxT("0") + wxString::Format(wxT("%i"), intDay)); - } else { + } else { - DateRev.Append(wxString::Format(wxT("%i"), intDay)); + DateRev.Append(wxString::Format(wxT("%i"), intDay)); - } - - //DateRev.Append(wx); - //DateRev.Append(wx); - //DateRev.Append(wx); - DateRev.Append(wxT("T")); + } - // Set hour, minute and second. + DateRev.Append(wxT("T")); + + // Set hour, minute and second. - int intHour = DateTimeNow.GetHour(); - int intMinute = DateTimeNow.GetMinute(); - int intSecond = DateTimeNow.GetSecond(); + int intHour = DateTimeNow.GetHour(); + int intMinute = DateTimeNow.GetMinute(); + int intSecond = DateTimeNow.GetSecond(); - if (intHour < 10){ + if (intHour < 10){ - DateRev.Append(wxT("0") + wxString::Format(wxT("%i"), intHour)); + DateRev.Append(wxT("0") + wxString::Format(wxT("%i"), intHour)); - } else { + } else { - DateRev.Append(wxString::Format(wxT("%i"), intHour)); + DateRev.Append(wxString::Format(wxT("%i"), intHour)); - } + } - if (intMinute < 10){ + if (intMinute < 10){ - DateRev.Append(wxT("0") + wxString::Format(wxT("%i"), intMinute)); + DateRev.Append(wxT("0") + wxString::Format(wxT("%i"), intMinute)); - } else { + } else { - DateRev.Append(wxString::Format(wxT("%i"), intMinute)); + DateRev.Append(wxString::Format(wxT("%i"), intMinute)); - } + } - if (intSecond < 10){ + if (intSecond < 10){ - DateRev.Append(wxT("0") + wxString::Format(wxT("%i"), intSecond)); + DateRev.Append(wxT("0") + wxString::Format(wxT("%i"), intSecond)); - } else { + } else { - DateRev.Append(wxString::Format(wxT("%i"), intSecond)); + DateRev.Append(wxString::Format(wxT("%i"), intSecond)); - } + } - // DateRev.Append(wx); - // DateRev.Append(wx); - // DateRev.Append(wxString DateTimeNow->); - DateRev.Append(wxT("Z")); + DateRev.Append(wxT("Z")); - ContactData.Add(wxT("UID"), UIDToken, FALSE); + ContactData.Add(wxT("UID"), ContactEditorData.UIDToken, FALSE); - // End the vCard File. + // End the vCard File. - ContactData.Add(wxT("END"), wxT("VCARD"), FALSE); + ContactData.Add(wxT("END"), wxT("VCARD"), FALSE);*/ - FMTimer.Stop(); - ContactData.WriteFile(FilenameFinal); + FMTimer.Stop(); + ContactEditorData.SaveFile(FilenameFinal); + //ContactData.WriteFile(FilenameFinal); - vCard34Conv ConvFileFun; + vCard34Conv ConvFileFun; - wxString wxSData; + wxString wxSData; - ConvFileFun.ConvertToV3(FilenameFinal, &wxSData); + ConvFileFun.ConvertToV3(FilenameFinal, &wxSData); - wxString AccountDirPrefix; - wxString AccountDir; - wxString PrefDir; + wxString AccountDirPrefix; + wxString AccountDir; + wxString PrefDir; #if defined(__HAIKU__) - - //preffilename = wxT("noo"); #elif defined(__APPLE__) - PrefDir = GetUserPrefDir(); + PrefDir = GetUserPrefDir(); - wxStringTokenizer wSTFilename(wxSContactFilename, wxT("/")); + wxStringTokenizer wSTFilename(wxSContactFilename, wxT("/")); #elif defined(__WIN32__) - PrefDir = GetUserPrefDir(); + PrefDir = GetUserPrefDir(); - wxStringTokenizer wSTFilename(wxSContactFilename, wxT("\\")); + wxStringTokenizer wSTFilename(wxSContactFilename, wxT("\\")); #else - PrefDir = GetUserPrefDir(); + PrefDir = GetUserPrefDir(); - wxStringTokenizer wSTFilename(wxSContactFilename, wxT("/")); + wxStringTokenizer wSTFilename(wxSContactFilename, wxT("/")); #endif + + XABPreferences PrefData(PrefDir); - XABPreferences PrefData(PrefDir); - - wxString AccountType; + wxString AccountType; - for (int i = 0; i < PrefData.accounts.GetCount(); i++){ + for (int i = 0; i < PrefData.accounts.GetCount(); i++){ - AccountDir = PrefData.accounts.GetAccountDirectory(i) + wxT(".carddav"); + AccountDir = PrefData.accounts.GetAccountDirectory(i) + wxT(".carddav"); - if (AccountDir == wxSContactAccount){ + if (AccountDir == wxSContactAccount){ - AccountDirPrefix = PrefData.accounts.GetAccountDirPrefix(i); - AccountDirPrefix.Trim(); - AccountType = PrefData.accounts.GetAccountType(i); - break; + AccountDirPrefix = PrefData.accounts.GetAccountDirPrefix(i); + AccountDirPrefix.Trim(); + AccountType = PrefData.accounts.GetAccountType(i); + break; - } + } - } + } - wxString wxSplitFilename; - wxString wxSDataURL; + wxString wxSplitFilename; + wxString wxSDataURL; - while(wSTFilename.HasMoreTokens()){ + while(wSTFilename.HasMoreTokens()){ - wxSplitFilename = wSTFilename.GetNextToken(); + wxSplitFilename = wSTFilename.GetNextToken(); - } + } - wxSDataURL = wxSplitFilename; - //wxSDataURL.Append(wxSplitFilename); + wxSDataURL = wxSplitFilename; - // Find out if the filename exists in the table. + // Find out if the filename exists in the table. - if (AccountType == wxT("CardDAV") || AccountType == wxT("carddav")){ + if (AccountType == wxT("CardDAV") || AccountType == wxT("carddav")){ - wxString ETagResult; - wxString ETagOriginal; + wxString ETagResult; + wxString ETagOriginal; - ETagDB *ETagDBPtr = NULL; + ETagDB *ETagDBPtr = NULL; - ETagDBPtr = ETagTmrPtr->GetPointer(wxSContactAccount); + ETagDBPtr = ETagTmrPtr->GetPointer(wxSContactAccount); - wxString wxSETag = ETagDBPtr->GetETag(wxSplitFilename); - wxString wxSETagOrig = ETagDBPtr->GetETagOriginal(wxSplitFilename); + wxString wxSETag = ETagDBPtr->GetETag(wxSplitFilename); + wxString wxSETagOrig = ETagDBPtr->GetETagOriginal(wxSplitFilename); - if (wxSETagOrig.IsEmpty()){ + if (wxSETagOrig.IsEmpty()){ - // Generate the ETag. + // Generate the ETag. - wxSETagOrig = wxString::Format(wxT("%X%X%X%X"), rand() % 1024, rand() % 1024, rand() % 1024, rand() % 1024); + wxSETagOrig = wxString::Format(wxT("%X%X%X%X"), rand() % 1024, rand() % 1024, rand() % 1024, rand() % 1024); - } + } - if (wxSETag.IsEmpty()){ + if (wxSETag.IsEmpty()){ - // Update empty ETag. + // Update empty ETag. - wxSETag = wxSETagOrig; - ETagDBPtr->UpdateETag(wxSplitFilename, wxSETag, wxSETagOrig); + wxSETag = wxSETagOrig; + ETagDBPtr->UpdateETag(wxSplitFilename, wxSETag, wxSETagOrig); - } - else { + } else { - // Don't change original ETag. + // Don't change original ETag. - wxSETag = wxString::Format(wxT("%X%X%X%X"), rand() % 1024, rand() % 1024, rand() % 1024, rand() % 1024); - ETagDBPtr->UpdateETag(wxSplitFilename, wxSETag); + wxSETag = wxString::Format(wxT("%X%X%X%X"), rand() % 1024, rand() % 1024, rand() % 1024, rand() % 1024); + ETagDBPtr->UpdateETag(wxSplitFilename, wxSETag); - } + } - if (EditMode == FALSE){ + if (EditMode == FALSE){ - ActMgrPtr->AddTask(0, cmbDisplayAs->GetValue(), wxSContactAccount, wxSDataURL, wxSplitFilename, FilenameFinal, wxSData); - EditMode = TRUE; - FMTimer.SetFilename(FilenameFinal); - FMTimer.UpdateTimestamp(); - FMTimer.Start(10000, FALSE); + ActMgrPtr->AddTask(0, cmbDisplayAs->GetValue(), wxSContactAccount, wxSDataURL, wxSplitFilename, FilenameFinal, wxSData); + EditMode = TRUE; + FMTimer.SetFilename(FilenameFinal); + FMTimer.UpdateTimestamp(); + FMTimer.Start(10000, FALSE); - wxCommandEvent reloadevent(RELOADCONTACTLIST); - reloadevent.SetString(wxSContactAccount); - wxPostEvent(this->GetParent(), reloadevent); + wxCommandEvent reloadevent(RELOADCONTACTLIST); + reloadevent.SetString(wxSContactAccount); + wxPostEvent(this->GetParent(), reloadevent); - } - else { + } else { - ActMgrPtr->AddTask(1, cmbDisplayAs->GetValue(), wxSContactAccount, wxSDataURL, wxSplitFilename, FilenameFinal, wxSData); - FMTimer.UpdateTimestamp(); - FMTimer.Start(10000, FALSE); + ActMgrPtr->AddTask(1, cmbDisplayAs->GetValue(), wxSContactAccount, wxSDataURL, wxSplitFilename, FilenameFinal, wxSData); + FMTimer.UpdateTimestamp(); + FMTimer.Start(10000, FALSE); - } + } - } + } - // Send a notification to update the main window - // with the new details. + // Send a notification to update the main window + // with the new details. - UCNotif *ucd; - ucd = new UCNotif; + UCNotif *ucd; + ucd = new UCNotif; - // TODO: Workout nickname settings by priority and - // type. + // TODO: Workout nickname settings by priority and + // type. - ucd->ContactAccount = wxSContactAccount; - ucd->ContactFilename = FilenameFinal; - ucd->ContactName = cmbDisplayAs->GetValue(); - ucd->ContactNameArray = ContactData.GetName(); + vCardName NameData; + + NameData.Forename = txtForename->GetValue(); + NameData.Surname = txtSurname->GetValue(); + NameData.OtherNames = txtOtherNames->GetValue(); + NameData.Title = txtTitle->GetValue(); + NameData.Suffix = txtSuffix->GetValue(); + + ucd->ContactAccount = wxSContactAccount; + ucd->ContactFilename = FilenameFinal; + ucd->ContactName = cmbDisplayAs->GetValue(); + ucd->ContactNameArray = NameData; - for (std::map::iterator gniter = GeneralNicknamesList.begin(); - gniter != GeneralNicknamesList.end(); gniter++){ + for (std::map::iterator gniter = ContactEditorData.GeneralNicknamesList.begin(); + gniter != ContactEditorData.GeneralNicknamesList.end(); gniter++){ - ucd->ContactNickname = gniter->second; - break; + ucd->ContactNickname = gniter->second; + break; - } + } - wxCommandEvent event2(CE_UPDATECONTACTLIST); - event2.SetClientData(ucd); - wxPostEvent(MainPtr, event2); + wxCommandEvent event2(CE_UPDATECONTACTLIST); + event2.SetClientData(ucd); + wxPostEvent(MainPtr, event2); } void frmContactEditor::SaveCloseContact( wxCommandEvent& event ) { - // Save the updated contact data and close the form. + // Save the updated contact data and close the form. - wxCommandEvent NullEvent; - this->SaveContact(NullEvent); - this->Close(); + wxCommandEvent NullEvent; + this->SaveContact(NullEvent); + this->Close(); } \ No newline at end of file