X-Git-Url: http://Server1/repobrowser/?a=blobdiff_plain;f=source%2Fcontacteditor%2FfrmContactEditor-Save.cpp;h=766241800ba09a8cdf5ec0f1b08335be932d8aaa;hb=4f4ef609869729894a13a7e37b6aa5ea0ddaa32b;hp=0ca9cb0d199a84fc71bd25ce1cd90a4b3fdc3e2e;hpb=616fa8b7c718ffaf13815ba5bad3d7b54f55c6b1;p=xestiaab%2F.git diff --git a/source/contacteditor/frmContactEditor-Save.cpp b/source/contacteditor/frmContactEditor-Save.cpp index 0ca9cb0..7662418 100644 --- a/source/contacteditor/frmContactEditor-Save.cpp +++ b/source/contacteditor/frmContactEditor-Save.cpp @@ -1,3 +1,21 @@ +// frmContactEditor-Save.cpp - frmContactEditor save contact subroutines. +// +// (c) 2012-2016 Xestia Software Development. +// +// This file is part of Xestia Address Book. +// +// Xestia Address Book is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by the +// Free Software Foundation, version 3 of the license. +// +// Xestia Address Book is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with Xestia Address Book. If not, see + #include "frmContactEditor.h" #include "../enums.h" #include "../version.h" @@ -89,8 +107,8 @@ void frmContactEditor::SaveContact( wxCommandEvent& event ) // Generate a random UUID. - UIDToken = GenerateUUID(); - UIDToken = UIDToken.MakeUpper(); + ContactEditorData.UIDToken = GenerateUUID(); + ContactEditorData.UIDToken = ContactEditorData.UIDToken.MakeUpper(); // Setup the filename. @@ -103,14 +121,14 @@ void frmContactEditor::SaveContact( wxCommandEvent& event ) #elif defined(__WIN32__) FilenameFinal = GetAccountDir(wxSContactAccount, FALSE); - FilenameFinal.Append(UIDToken); + FilenameFinal.Append(ContactEditorData.UIDToken); FilenameFinal.Append(wxT(".vcf")); wxSContactFilename = FilenameFinal; #else FilenameFinal = GetAccountDir(wxSContactAccount, FALSE); - FilenameFinal.Append(UIDToken); + FilenameFinal.Append(ContactEditorData.UIDToken); FilenameFinal.Append(wxT(".vcf")); wxSContactFilename = FilenameFinal; @@ -118,19 +136,16 @@ void frmContactEditor::SaveContact( wxCommandEvent& event ) } else { - if (UIDToken.IsEmpty()){ + if (ContactEditorData.UIDToken.IsEmpty()){ // UID Token is empty. (Shouldn't be). // Generate a new UID Token. - /*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(); + ContactEditorData.UIDToken = GenerateUUID(); + ContactEditorData.UIDToken = ContactEditorData.UIDToken.MakeUpper(); } + FilenameFinal = wxSContactFilename; } @@ -139,8 +154,6 @@ void frmContactEditor::SaveContact( wxCommandEvent& event ) // Begin preperations to write the contact to a file. - bool boolValue = FALSE; - bool boolValue2 = FALSE; bool FNFirst = TRUE; bool NNGeneralFirst = TRUE; bool NNHomeFirst = TRUE; @@ -160,6 +173,87 @@ void frmContactEditor::SaveContact( wxCommandEvent& event ) 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. + + for (std::map::iterator iter = ContactEditorData.ClientPIDList.begin(); + iter != ContactEditorData.ClientPIDList.end(); ++iter){ + + wxString strOrigValue; + + strOrigValue = ContactEditorData.ClientPIDList.find(iter->first)->second; + + ResetUnusedString(&strOrigValue); + + ProcessSaveData(wxT("CLIENTPIDMAP"), &strValue2, &boolValue2, &boolValue, + &iter, &strOrigValue, &ContactData, + wxT(""), &ContactEditorData.ClientPIDListTokens ); + + ResetSaveProcessData(); + + } + + // Process the SOURCE properties. + + for (std::map::iterator iter = ContactEditorData.SourceList.begin(); + iter != ContactEditorData.SourceList.end(); ++iter){ + + wxString strOrigValue; + + strOrigValue = ContactEditorData.SourceList.find(iter->first)->second; + + 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. strValue.Clear(); @@ -175,10 +269,10 @@ void frmContactEditor::SaveContact( wxCommandEvent& event ) strValue2 = ContactData.Convert(cmbDisplayAs->GetValue(), FALSE); strValue2.Trim(); - if (NameTokens.IsEmpty()){ + if (ContactEditorData.NameTokens.IsEmpty()){ ContactData.Add(wxT("N;SORT-AS=\"") + strValue2 + wxT("\""), strValue, FALSE); } else { - ContactData.Add(wxT("N;SORT-AS=\"") + strValue2 + wxT("\";") + NameTokens, strValue, FALSE); + ContactData.Add(wxT("N;SORT-AS=\"") + strValue2 + wxT("\";") + ContactEditorData.NameTokens, strValue, FALSE); } if (cmbType->GetCurrentSelection() == 1){ @@ -191,8 +285,8 @@ void frmContactEditor::SaveContact( wxCommandEvent& event ) // 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); @@ -265,15 +359,15 @@ void frmContactEditor::SaveContact( wxCommandEvent& event ) EscapeString(&strValue2, FALSE); - if (!GenderTokens.IsEmpty()){ + if (!ContactEditorData.GenderTokens.IsEmpty()){ if (!strValue2.IsEmpty()){ - ContactData.AddRaw(wxT("GENDER;") + GenderTokens, strValue + wxT(";") + strValue2); + ContactData.AddRaw(wxT("GENDER;") + ContactEditorData.GenderTokens, strValue + wxT(";") + strValue2); } else { - ContactData.AddRaw(wxT("GENDER;") + GenderTokens, strValue); + ContactData.AddRaw(wxT("GENDER;") + ContactEditorData.GenderTokens, strValue); } @@ -293,91 +387,89 @@ void frmContactEditor::SaveContact( wxCommandEvent& event ) } - 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); + + strValue3.Append("ALTID="); + strValue3.Append(DataValue); + + boolValue2 = TRUE; - if (!strValue3.IsEmpty()){ - - strValue3.Trim(); - strValue3.Trim(); - boolValue2 = TRUE; - strValue2.Append(wxT("ALTID=\"") + strValue3 + wxT("\"")); - - boolValue = TRUE; - } - //strValue3 = ContactData.Convert(GeneralAddressList, FALSE); - //strValue2 = + // CALSCALE. - // Process Language. + if (!ContactEditorData.BirthdayCalScale.IsEmpty()){ - strValue3 = BirthdayCalScale; + wxString DataValue; + DataValue = ContactEditorData.BirthdayCalScale; - if (!strValue3.IsEmpty()){ - - strValue3.Trim(); - strValue3.Trim(); - - if (boolValue2 == TRUE){ - - strValue2.Append(wxT(";")); - - } else { - - boolValue2 = TRUE; - - } - - strValue2.Append(wxT("CALSCALE=") + strValue3); - - boolValue = TRUE; - - } + EscapeString(&DataValue, FALSE); - // Process Tokens. + if (boolValue2 == TRUE){ + + strValue3.Append(";"); + + } + + strValue3.Append("CALSCALE="); + strValue3.Append(DataValue); + + boolValue2 = TRUE; - strValue2 = BirthdayTokens; + } - // Get the birthday and write it. + // Extra tokens. - ResetSaveProcessData(); + 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()){ - - 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); - - } - - } - + + 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. @@ -401,7 +493,7 @@ void frmContactEditor::SaveContact( wxCommandEvent& event ) // Look for T and replace data before this. - wxStringTokenizer wSTDate(Birthday, wxT("T")); + wxStringTokenizer wSTDate(ContactEditorData.Birthday, wxT("T")); while (wSTDate.HasMoreTokens()){ @@ -465,14 +557,14 @@ void frmContactEditor::SaveContact( wxCommandEvent& event ) } - if (!FinalBirthdayString.IsEmpty() || !strValue2.IsEmpty()){ + if (!FinalBirthdayString.IsEmpty() || !strValue3.IsEmpty()){ - if (!strValue2.IsEmpty()){ + if (!strValue3.IsEmpty()){ EscapeString(&strValue2, FALSE); EscapeString(&strValue, FALSE); - ContactData.AddRaw(wxT("BDAY") + strValue2 + wxT(";"), FinalBirthdayString); + ContactData.AddRaw(wxT("BDAY;") + strValue3, FinalBirthdayString); } else { @@ -485,85 +577,92 @@ void frmContactEditor::SaveContact( wxCommandEvent& event ) } } - + } ResetSaveProcessData(); - // Process Label. + // Build the values for the ANNIVERSARY property. + + // ALTID + + if (!ContactEditorData.AnniversaryAltID.IsEmpty()){ - strValue3 = AnniversaryAltID; + wxString DataValue; + DataValue = ContactEditorData.AnniversaryAltID; + + EscapeString(&DataValue, FALSE); + + strValue3.Append("ALTID="); + strValue3.Append(DataValue); + + boolValue2 = TRUE; - if (!strValue3.IsEmpty()){ - - strValue3.Trim(); - strValue3.Trim(); - boolValue2 = TRUE; - strValue2.Append(wxT("ALTID=\"") + strValue3 + wxT("\"")); - - boolValue = TRUE; - } - //strValue3 = ContactData.Convert(GeneralAddressList, FALSE); - //strValue2 = + // CALSCALE. - // Process Language. + if (!ContactEditorData.AnniversaryCalScale.IsEmpty()){ - strValue3 = AnniversaryCalScale; + wxString DataValue; + DataValue = ContactEditorData.AnniversaryCalScale; + + EscapeString(&DataValue, FALSE); + + if (boolValue2 == TRUE){ + + strValue3.Append(";"); + + } + + strValue3.Append("CALSCALE="); + strValue3.Append(DataValue); + + 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. + // Extra tokens. - strValue2 = AnniversaryTokens; + if (!ContactEditorData.AnniversaryTokens.IsEmpty()){ - // Deal with ANNIVERSARY. + wxString DataValue; + DataValue = ContactEditorData.AnniversaryTokens; + + EscapeString(&DataValue, FALSE); + + if (boolValue2 == TRUE){ + + strValue3.Append(";"); + + } + + strValue3.Append(DataValue); + + } + + // Write the ANNIVERSARY property. 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); - - } - - } - + + 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. @@ -587,7 +686,7 @@ void frmContactEditor::SaveContact( wxCommandEvent& event ) // Look for T and replace data before this. - wxStringTokenizer wSTDate(Anniversary, wxT("T")); + wxStringTokenizer wSTDate(ContactEditorData.Anniversary, wxT("T")); while (wSTDate.HasMoreTokens()){ @@ -651,14 +750,14 @@ void frmContactEditor::SaveContact( wxCommandEvent& event ) } - if (!FinalAnniversaryString.IsEmpty() || !strValue2.IsEmpty()){ + if (!FinalAnniversaryString.IsEmpty() || !strValue3.IsEmpty()){ - if (!strValue2.IsEmpty()){ + if (!strValue3.IsEmpty()){ EscapeString(&strValue2, FALSE); EscapeString(&strValue, FALSE); - ContactData.AddRaw(wxT("ANNIVERSARY") + strValue2 + wxT(";"), FinalAnniversaryString); + ContactData.AddRaw(wxT("ANNIVERSARY;") + strValue3, FinalAnniversaryString); } else { @@ -671,16 +770,15 @@ void frmContactEditor::SaveContact( wxCommandEvent& event ) } } - - } + } + // Setup the addresses (General, Home, Business). - //intValue = GeneralAddressList.size(); ResetSaveProcessData(); - - for (std::map::iterator iter = GeneralAddressList.begin(); - iter != GeneralAddressList.end(); ++iter){ + + for (std::map::iterator iter = ContactEditorData.GeneralAddressList.begin(); + iter != ContactEditorData.GeneralAddressList.end(); ++iter){ int intSeekValue = iter->first; @@ -692,7 +790,7 @@ void frmContactEditor::SaveContact( wxCommandEvent& event ) // Get Address - iterValue = GeneralAddressList.find(intSeekValue); + iterValue = ContactEditorData.GeneralAddressList.find(intSeekValue); strAddressFinalValue = iterValue->second; ProcessCaptureStrings(&strAddressFinalValue); strAddressString.Append(strAddressFinalValue + wxT(";")); @@ -700,7 +798,7 @@ void frmContactEditor::SaveContact( wxCommandEvent& event ) // Get Town - iterValue = GeneralAddressListTown.find(intSeekValue); + iterValue = ContactEditorData.GeneralAddressListTown.find(intSeekValue); strAddressFinalValue = iterValue->second; ProcessCaptureStrings(&strAddressFinalValue); strAddressString.Append(strAddressFinalValue + wxT(";")); @@ -708,7 +806,7 @@ void frmContactEditor::SaveContact( wxCommandEvent& event ) // Get County - iterValue = GeneralAddressListCounty.find(intSeekValue); + iterValue = ContactEditorData.GeneralAddressListCounty.find(intSeekValue); strAddressFinalValue = iterValue->second; ProcessCaptureStrings(&strAddressFinalValue); strAddressString.Append(strAddressFinalValue + wxT(";")); @@ -716,7 +814,7 @@ void frmContactEditor::SaveContact( wxCommandEvent& event ) // Get Post Code - iterValue = GeneralAddressListPostCode.find(intSeekValue); + iterValue = ContactEditorData.GeneralAddressListPostCode.find(intSeekValue); strAddressFinalValue = iterValue->second; ProcessCaptureStrings(&strAddressFinalValue); strAddressString.Append(strAddressFinalValue + wxT(";")); @@ -724,7 +822,7 @@ void frmContactEditor::SaveContact( wxCommandEvent& event ) // Get Country - iterValue = GeneralAddressListCountry.find(intSeekValue); + iterValue = ContactEditorData.GeneralAddressListCountry.find(intSeekValue); strAddressFinalValue = iterValue->second; ProcessCaptureStrings(&strAddressFinalValue); strAddressString.Append(strAddressFinalValue); @@ -732,15 +830,15 @@ void frmContactEditor::SaveContact( wxCommandEvent& event ) 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 ); + 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(); @@ -748,8 +846,8 @@ void frmContactEditor::SaveContact( wxCommandEvent& event ) ResetSaveProcessData(); - for (std::map::iterator iter = HomeAddressList.begin(); - iter != HomeAddressList.end(); ++iter){ + for (std::map::iterator iter = ContactEditorData.HomeAddressList.begin(); + iter != ContactEditorData.HomeAddressList.end(); ++iter){ int intSeekValue = iter->first; @@ -761,55 +859,50 @@ void frmContactEditor::SaveContact( wxCommandEvent& event ) // Get Address - iterValue = HomeAddressList.find(intSeekValue); + iterValue = ContactEditorData.HomeAddressList.find(intSeekValue); strAddressFinalValue = iterValue->second; ProcessCaptureStrings(&strAddressFinalValue); - strAddressString.Append(strAddressFinalValue + wxT(";")); // Get Town - iterValue = HomeAddressListTown.find(intSeekValue); + iterValue = ContactEditorData.HomeAddressListTown.find(intSeekValue); strAddressFinalValue = iterValue->second; ProcessCaptureStrings(&strAddressFinalValue); - strAddressString.Append(strAddressFinalValue + wxT(";")); // Get County - iterValue = HomeAddressListCounty.find(intSeekValue); + iterValue = ContactEditorData.HomeAddressListCounty.find(intSeekValue); strAddressFinalValue = iterValue->second; ProcessCaptureStrings(&strAddressFinalValue); - strAddressString.Append(strAddressFinalValue + wxT(";")); // Get Post Code - iterValue = HomeAddressListPostCode.find(intSeekValue); + iterValue = ContactEditorData.HomeAddressListPostCode.find(intSeekValue); strAddressFinalValue = iterValue->second; ProcessCaptureStrings(&strAddressFinalValue); - strAddressString.Append(strAddressFinalValue + wxT(";")); // Get Country - iterValue = HomeAddressListCountry.find(intSeekValue); + 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"), &HomeAddressListLabel, - wxT("LANGUAGE"), &HomeAddressListLang, - wxT("ALTID"), &HomeAddressListAltID, - wxT("PID"), &HomeAddressListPID, - wxT("GEO"), &HomeAddressListGeo, - wxT("TZ"), &HomeAddressListTimezone, - wxT("MEDIATYPE"), &HomeAddressListMediatype, - wxT("PREF"), &HomeAddressListPref, - wxT(""), &HomeAddressListTokens ); + 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(); @@ -817,8 +910,8 @@ void frmContactEditor::SaveContact( wxCommandEvent& event ) 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; @@ -830,7 +923,7 @@ void frmContactEditor::SaveContact( wxCommandEvent& event ) // Get Address - iterValue = BusinessAddressList.find(intSeekValue); + iterValue = ContactEditorData.BusinessAddressList.find(intSeekValue); strAddressFinalValue = iterValue->second; ProcessCaptureStrings(&strAddressFinalValue); @@ -838,7 +931,7 @@ void frmContactEditor::SaveContact( wxCommandEvent& event ) // Get Town - iterValue = BusinessAddressListTown.find(intSeekValue); + iterValue = ContactEditorData.BusinessAddressListTown.find(intSeekValue); strAddressFinalValue = iterValue->second; ProcessCaptureStrings(&strAddressFinalValue); @@ -846,7 +939,7 @@ void frmContactEditor::SaveContact( wxCommandEvent& event ) // Get County - iterValue = BusinessAddressListCounty.find(intSeekValue); + iterValue = ContactEditorData.BusinessAddressListCounty.find(intSeekValue); strAddressFinalValue = iterValue->second; ProcessCaptureStrings(&strAddressFinalValue); @@ -854,7 +947,7 @@ void frmContactEditor::SaveContact( wxCommandEvent& event ) // Get Post Code - iterValue = BusinessAddressListPostCode.find(intSeekValue); + iterValue = ContactEditorData.BusinessAddressListPostCode.find(intSeekValue); strAddressFinalValue = iterValue->second; ProcessCaptureStrings(&strAddressFinalValue); @@ -862,7 +955,7 @@ void frmContactEditor::SaveContact( wxCommandEvent& event ) // Get Country - iterValue = BusinessAddressListCountry.find(intSeekValue); + iterValue = ContactEditorData.BusinessAddressListCountry.find(intSeekValue); strAddressFinalValue = iterValue->second; ProcessCaptureStrings(&strAddressFinalValue); @@ -870,15 +963,15 @@ void frmContactEditor::SaveContact( wxCommandEvent& event ) 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 ); + 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(); @@ -886,20 +979,20 @@ void frmContactEditor::SaveContact( wxCommandEvent& event ) // 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; // 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 ); + &iter, &ContactEditorData.GeneralNicknamesList, &ContactData, + wxT("LANGUAGE"), &ContactEditorData.GeneralNicknamesListLanguage, + wxT("ALTID"), &ContactEditorData.GeneralNicknamesListAltID, + wxT("PID"), &ContactEditorData.GeneralNicknamesListPID, + wxT("PREF"), &ContactEditorData.GeneralNicknamesListPref, + wxT(""), &ContactEditorData.GeneralNicknamesListTokens ); ResetSaveProcessData(); @@ -907,16 +1000,16 @@ void frmContactEditor::SaveContact( wxCommandEvent& event ) 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 ); + &iter, &ContactEditorData.HomeNicknamesList, &ContactData, + wxT("LANGUAGE"), &ContactEditorData.HomeNicknamesListLanguage, + wxT("ALTID"), &ContactEditorData.HomeNicknamesListAltID, + wxT("PID"), &ContactEditorData.HomeNicknamesListPID, + wxT("PREF"), &ContactEditorData.HomeNicknamesListPref, + wxT(""), &ContactEditorData.HomeNicknamesListTokens ); ResetSaveProcessData(); @@ -924,16 +1017,16 @@ void frmContactEditor::SaveContact( wxCommandEvent& event ) 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 ); + &iter, &ContactEditorData.BusinessNicknamesList, &ContactData, + wxT("LANGUAGE"), &ContactEditorData.BusinessNicknamesListLanguage, + wxT("ALTID"), &ContactEditorData.BusinessNicknamesListAltID, + wxT("PID"), &ContactEditorData.BusinessNicknamesListPID, + wxT("PREF"), &ContactEditorData.BusinessNicknamesListPref, + wxT(""), &ContactEditorData.BusinessNicknamesListTokens ); ResetSaveProcessData(); @@ -943,8 +1036,8 @@ void frmContactEditor::SaveContact( wxCommandEvent& event ) // Sort out email (general, home and business). - for (std::map::iterator iter = GeneralEmailList.begin(); - iter != GeneralEmailList.end(); ++iter){ + for (std::map::iterator iter = ContactEditorData.GeneralEmailList.begin(); + iter != ContactEditorData.GeneralEmailList.end(); ++iter){ //strValue3 = ContactData.Convert(GeneralAddressList, FALSE); //strValue2 = @@ -953,11 +1046,11 @@ void frmContactEditor::SaveContact( wxCommandEvent& event ) std::map::iterator iterValue; ProcessSaveData(wxT("EMAIL"), &strValue2, &boolValue2, &boolValue, - &iter, &GeneralEmailList, &ContactData, - wxT("ALTID"), &GeneralEmailListAltID, - wxT("PID"), &GeneralEmailListPID, - wxT("PREF"), &GeneralEmailListPref, - wxT(""), &GeneralEmailListTokens ); + &iter, &ContactEditorData.GeneralEmailList, &ContactData, + wxT("ALTID"), &ContactEditorData.GeneralEmailListAltID, + wxT("PID"), &ContactEditorData.GeneralEmailListPID, + wxT("PREF"), &ContactEditorData.GeneralEmailListPref, + wxT(""), &ContactEditorData.GeneralEmailListTokens ); ResetSaveProcessData(); @@ -965,18 +1058,18 @@ void frmContactEditor::SaveContact( wxCommandEvent& event ) 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, &HomeEmailList, &ContactData, - wxT("ALTID"), &HomeEmailListAltID, - wxT("PID"), &HomeEmailListPID, - wxT("PREF"), &HomeEmailListPref, - wxT(""), &HomeEmailListTokens ); + &iter, &ContactEditorData.HomeEmailList, &ContactData, + wxT("ALTID"), &ContactEditorData.HomeEmailListAltID, + wxT("PID"), &ContactEditorData.HomeEmailListPID, + wxT("PREF"), &ContactEditorData.HomeEmailListPref, + wxT(""), &ContactEditorData.HomeEmailListTokens ); ResetSaveProcessData(); @@ -984,18 +1077,18 @@ void frmContactEditor::SaveContact( wxCommandEvent& event ) ResetSaveProcessData(); - for (std::map::iterator iter = BusinessEmailList.begin(); - iter != BusinessEmailList.end(); ++iter){ + for (std::map::iterator iter = ContactEditorData.BusinessEmailList.begin(); + iter != ContactEditorData.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 ); + &iter, &ContactEditorData.BusinessEmailList, &ContactData, + wxT("ALTID"), &ContactEditorData.BusinessEmailListAltID, + wxT("PID"), &ContactEditorData.BusinessEmailListPID, + wxT("PREF"), &ContactEditorData.BusinessEmailListPref, + wxT(""), &ContactEditorData.BusinessEmailListTokens ); ResetSaveProcessData(); @@ -1003,20 +1096,38 @@ void frmContactEditor::SaveContact( wxCommandEvent& event ) 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; + wxString strIMFinalValue = iter->second; + + ProcessCaptureStrings(&strIMFinalValue); + + 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, &GeneralIMList, &ContactData, - wxT("ALTID"), &GeneralIMListAltID, - wxT("PID"), &GeneralIMListPID, - wxT("MEDIATYPE"), &GeneralIMListMediatype, - wxT("PREF"), &GeneralIMListPref, - wxT(""), &GeneralIMListTokens ); + &iter, &strIMFinalValue, &ContactData, + wxT("ALTID"), &ContactEditorData.GeneralIMListAltID, + wxT("PID"), &ContactEditorData.GeneralIMListPID, + wxT("MEDIATYPE"), &ContactEditorData.GeneralIMListMediatype, + wxT("PREF"), &ContactEditorData.GeneralIMListPref, + wxT(""), &ContactEditorData.GeneralIMListTokens ); ResetSaveProcessData(); @@ -1024,16 +1135,34 @@ void frmContactEditor::SaveContact( wxCommandEvent& event ) 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){ + + wxString strIMFinalValue = iter->second; + ProcessCaptureStrings(&strIMFinalValue); + + 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, &HomeIMList, &ContactData, - wxT("ALTID"), &HomeIMListAltID, - wxT("PID"), &HomeIMListPID, - wxT("MEDIATYPE"), &HomeIMListMediatype, - wxT("PREF"), &HomeIMListPref, - wxT(""), &HomeIMListTokens ); + &iter, &ContactEditorData.HomeIMList, &ContactData, + wxT("ALTID"), &ContactEditorData.HomeIMListAltID, + wxT("PID"), &ContactEditorData.HomeIMListPID, + wxT("MEDIATYPE"), &ContactEditorData.HomeIMListMediatype, + wxT("PREF"), &ContactEditorData.HomeIMListPref, + wxT(""), &ContactEditorData.HomeIMListTokens ); ResetSaveProcessData(); @@ -1041,16 +1170,34 @@ void frmContactEditor::SaveContact( wxCommandEvent& event ) ResetSaveProcessData(); - for (std::map::iterator iter = BusinessIMList.begin(); - iter != BusinessIMList.end(); ++iter){ + for (std::map::iterator iter = ContactEditorData.BusinessIMList.begin(); + iter != ContactEditorData.BusinessIMList.end(); ++iter){ + + wxString strIMFinalValue = iter->second; + ProcessCaptureStrings(&strIMFinalValue); + + 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, &BusinessIMList, &ContactData, - wxT("ALTID"), &BusinessIMListAltID, - wxT("PID"), &BusinessIMListPID, - wxT("MEDIATYPE"), &BusinessIMListMediatype, - wxT("PREF"), &BusinessIMListPref, - wxT(""), &BusinessIMListTokens ); + &iter, &ContactEditorData.BusinessIMList, &ContactData, + wxT("ALTID"), &ContactEditorData.BusinessIMListAltID, + wxT("PID"), &ContactEditorData.BusinessIMListPID, + wxT("MEDIATYPE"), &ContactEditorData.BusinessIMListMediatype, + wxT("PREF"), &ContactEditorData.BusinessIMListPref, + wxT(""), &ContactEditorData.BusinessIMListTokens ); ResetSaveProcessData(); @@ -1058,22 +1205,42 @@ void frmContactEditor::SaveContact( wxCommandEvent& event ) ResetSaveProcessData(); - for (std::map::iterator iter = GeneralTelephoneList.begin(); - iter != GeneralTelephoneList.end(); ++iter){ + for (std::map::iterator iter = ContactEditorData.GeneralTelephoneList.begin(); + iter != ContactEditorData.GeneralTelephoneList.end(); ++iter){ wxString strAddressFinalValue = iter->second; + int DataID = iter->first; ProcessCaptureStrings(&strAddressFinalValue); - strAddressFinalValue.insert(0, wxT("tel:")); - + 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"), &GeneralTelephoneListAltID, - wxT("PID"), &GeneralTelephoneListPID, - wxT("TYPE"), &GeneralTelephoneListType, - wxT("PREF"), &GeneralTelephoneListPref, - wxT(""), &GeneralTelephoneListTokens ); + wxT("ALTID"), &ContactEditorData.GeneralTelephoneListAltID, + wxT("PID"), &ContactEditorData.GeneralTelephoneListPID, + wxT("TYPE"), &ContactEditorData.GeneralTelephoneListTypeInfo, + wxT("PREF"), &ContactEditorData.GeneralTelephoneListPref, + wxT(""), &ContactEditorData.GeneralTelephoneListTokens ); ResetSaveProcessData(); @@ -1081,22 +1248,34 @@ void frmContactEditor::SaveContact( wxCommandEvent& event ) ResetSaveProcessData(); - for (std::map::iterator iter = HomeTelephoneList.begin(); - iter != HomeTelephoneList.end(); ++iter){ + for (std::map::iterator iter = ContactEditorData.HomeTelephoneList.begin(); + iter != ContactEditorData.HomeTelephoneList.end(); ++iter){ wxString strAddressFinalValue = iter->second; ProcessCaptureStrings(&strAddressFinalValue); - strAddressFinalValue.insert(0, wxT("tel:")); - + 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"), &HomeTelephoneListAltID, - wxT("PID"), &HomeTelephoneListPID, - wxT("TYPE"), &HomeTelephoneListType, - wxT("PREF"), &HomeTelephoneListPref, - wxT(""), &HomeTelephoneListTokens ); + wxT("ALTID"), &ContactEditorData.HomeTelephoneListAltID, + wxT("PID"), &ContactEditorData.HomeTelephoneListPID, + wxT("TYPE"), &ContactEditorData.HomeTelephoneListTypeInfo, + wxT("PREF"), &ContactEditorData.HomeTelephoneListPref, + wxT(""), &ContactEditorData.HomeTelephoneListTokens ); ResetSaveProcessData(); @@ -1104,22 +1283,34 @@ void frmContactEditor::SaveContact( wxCommandEvent& event ) ResetSaveProcessData(); - for (std::map::iterator iter = BusinessTelephoneList.begin(); - iter != BusinessTelephoneList.end(); ++iter){ + for (std::map::iterator iter = ContactEditorData.BusinessTelephoneList.begin(); + iter != ContactEditorData.BusinessTelephoneList.end(); ++iter){ wxString strAddressFinalValue = iter->second; ProcessCaptureStrings(&strAddressFinalValue); - strAddressFinalValue.insert(0, wxT("tel:")); - + 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"), &BusinessTelephoneListAltID, - wxT("PID"), &BusinessTelephoneListPID, - wxT("TYPE"), &BusinessTelephoneListType, - wxT("PREF"), &BusinessTelephoneListPref, - wxT(""), &BusinessTelephoneListTokens ); + wxT("ALTID"), &ContactEditorData.BusinessTelephoneListAltID, + wxT("PID"), &ContactEditorData.BusinessTelephoneListPID, + wxT("TYPE"), &ContactEditorData.BusinessTelephoneListTypeInfo, + wxT("PREF"), &ContactEditorData.BusinessTelephoneListPref, + wxT(""), &ContactEditorData.BusinessTelephoneListTokens ); ResetSaveProcessData(); @@ -1127,17 +1318,17 @@ void frmContactEditor::SaveContact( wxCommandEvent& event ) ResetSaveProcessData(); - for (std::map::iterator iter = GeneralLanguageList.begin(); - iter != GeneralLanguageList.end(); ++iter){ + for (std::map::iterator iter = ContactEditorData.GeneralLanguageList.begin(); + iter != ContactEditorData.GeneralLanguageList.end(); ++iter){ intValue2 = iter->first; ProcessSaveData(wxT("LANG"), &strValue2, &boolValue2, &boolValue, - &iter, &GeneralLanguageList, &ContactData, - wxT("ALTID"), &GeneralLanguageListAltID, - wxT("PID"), &GeneralLanguageListPID, - wxT("PREF"), &GeneralLanguageListPref, - wxT(""), &GeneralLanguageListTokens ); + &iter, &ContactEditorData.GeneralLanguageList, &ContactData, + wxT("ALTID"), &ContactEditorData.GeneralLanguageListAltID, + wxT("PID"), &ContactEditorData.GeneralLanguageListPID, + wxT("PREF"), &ContactEditorData.GeneralLanguageListPref, + wxT(""), &ContactEditorData.GeneralLanguageListTokens ); ResetSaveProcessData(); @@ -1145,15 +1336,15 @@ void frmContactEditor::SaveContact( wxCommandEvent& event ) ResetSaveProcessData(); - for (std::map::iterator iter = HomeLanguageList.begin(); - iter != HomeLanguageList.end(); ++iter){ + for (std::map::iterator iter = ContactEditorData.HomeLanguageList.begin(); + iter != ContactEditorData.HomeLanguageList.end(); ++iter){ ProcessSaveData(wxT("LANG;TYPE=home"), &strValue2, &boolValue2, &boolValue, - &iter, &HomeLanguageList, &ContactData, - wxT("ALTID"), &HomeLanguageListAltID, - wxT("PID"), &HomeLanguageListPID, - wxT("PREF"), &HomeLanguageListPref, - wxT(""), &HomeLanguageListTokens ); + &iter, &ContactEditorData.HomeLanguageList, &ContactData, + wxT("ALTID"), &ContactEditorData.HomeLanguageListAltID, + wxT("PID"), &ContactEditorData.HomeLanguageListPID, + wxT("PREF"), &ContactEditorData.HomeLanguageListPref, + wxT(""), &ContactEditorData.HomeLanguageListTokens ); ResetSaveProcessData(); @@ -1161,15 +1352,15 @@ void frmContactEditor::SaveContact( wxCommandEvent& event ) ResetSaveProcessData(); - for (std::map::iterator iter = BusinessLanguageList.begin(); - iter != BusinessLanguageList.end(); ++iter){ + for (std::map::iterator iter = ContactEditorData.BusinessLanguageList.begin(); + iter != ContactEditorData.BusinessLanguageList.end(); ++iter){ ProcessSaveData(wxT("LANG;TYPE=work"), &strValue2, &boolValue2, &boolValue, - &iter, &BusinessLanguageList, &ContactData, - wxT("ALTID"), &BusinessLanguageListAltID, - wxT("PID"), &BusinessLanguageListPID, - wxT("PREF"), &BusinessLanguageListPref, - wxT(""), &BusinessLanguageListTokens ); + &iter, &ContactEditorData.BusinessLanguageList, &ContactData, + wxT("ALTID"), &ContactEditorData.BusinessLanguageListAltID, + wxT("PID"), &ContactEditorData.BusinessLanguageListPID, + wxT("PREF"), &ContactEditorData.BusinessLanguageListPref, + wxT(""), &ContactEditorData.BusinessLanguageListTokens ); ResetSaveProcessData(); @@ -1177,16 +1368,16 @@ void frmContactEditor::SaveContact( wxCommandEvent& event ) ResetSaveProcessData(); - for (std::map::iterator iter = GeneralTZList.begin(); - iter != GeneralTZList.end(); ++iter){ + for (std::map::iterator iter = ContactEditorData.GeneralTZList.begin(); + iter != ContactEditorData.GeneralTZList.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 ); + &iter, &ContactEditorData.GeneralTZList, &ContactData, + wxT("ALTID"), &ContactEditorData.GeneralTZListAltID, + wxT("PID"), &ContactEditorData.GeneralTZListPID, + wxT("MEDIATYPE"), &ContactEditorData.GeneralTZListMediatype, + wxT("PREF"), &ContactEditorData.GeneralTZListPref, + wxT(""), &ContactEditorData.GeneralTZListTokens ); ResetSaveProcessData(); @@ -1194,16 +1385,16 @@ void frmContactEditor::SaveContact( wxCommandEvent& event ) ResetSaveProcessData(); - for (std::map::iterator iter = HomeTZList.begin(); - iter != HomeTZList.end(); ++iter){ + for (std::map::iterator iter = ContactEditorData.HomeTZList.begin(); + iter != ContactEditorData.HomeTZList.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 ); + &iter, &ContactEditorData.HomeTZList, &ContactData, + wxT("ALTID"), &ContactEditorData.HomeTZListAltID, + wxT("PID"), &ContactEditorData.HomeTZListPID, + wxT("MEDIATYPE"), &ContactEditorData.HomeTZListMediatype, + wxT("PREF"), &ContactEditorData.HomeTZListPref, + wxT(""), &ContactEditorData.HomeTZListTokens ); ResetSaveProcessData(); @@ -1211,16 +1402,16 @@ void frmContactEditor::SaveContact( wxCommandEvent& event ) ResetSaveProcessData(); - for (std::map::iterator iter = BusinessTZList.begin(); - iter != BusinessTZList.end(); ++iter){ + for (std::map::iterator iter = ContactEditorData.BusinessTZList.begin(); + iter != ContactEditorData.BusinessTZList.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 ); + &iter, &ContactEditorData.BusinessTZList, &ContactData, + wxT("ALTID"), &ContactEditorData.BusinessTZListAltID, + wxT("PID"), &ContactEditorData.BusinessTZListPID, + wxT("MEDIATYPE"), &ContactEditorData.BusinessTZListMediatype, + wxT("PREF"), &ContactEditorData.BusinessTZListPref, + wxT(""), &ContactEditorData.BusinessTZListTokens ); ResetSaveProcessData(); @@ -1228,22 +1419,34 @@ void frmContactEditor::SaveContact( wxCommandEvent& event ) ResetSaveProcessData(); - for (std::map::iterator iter = GeneralGeographyList.begin(); - iter != GeneralGeographyList.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"), &strValue2, &boolValue2, &boolValue, - &iter, &strAddressFinalValue, &ContactData, - wxT("ALTID"), &GeneralGeographyListAltID, - wxT("PID"), &GeneralGeographyListPID, - wxT("MEDIATYPE"), &GeneralGeographyListMediatype, - wxT("PREF"), &GeneralGeographyListPref, - wxT(""), &GeneralGeographyListTokens ); + &iter, &strGeoFinalValue, &ContactData, + wxT("ALTID"), &ContactEditorData.GeneralGeographyListAltID, + wxT("PID"), &ContactEditorData.GeneralGeographyListPID, + wxT("MEDIATYPE"), &ContactEditorData.GeneralGeographyListMediatype, + wxT("PREF"), &ContactEditorData.GeneralGeographyListPref, + wxT(""), &ContactEditorData.GeneralGeographyListTokens ); ResetSaveProcessData(); @@ -1251,22 +1454,34 @@ void frmContactEditor::SaveContact( wxCommandEvent& event ) ResetSaveProcessData(); - for (std::map::iterator iter = HomeGeographyList.begin(); - iter != HomeGeographyList.end(); ++iter){ + for (std::map::iterator iter = ContactEditorData.HomeGeographyList.begin(); + iter != ContactEditorData.HomeGeographyList.end(); ++iter){ - wxString strAddressFinalValue = iter->second; + wxString strGeoFinalValue = iter->second; - ProcessCaptureStrings(&strAddressFinalValue); + 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=home"), &strValue2, &boolValue2, &boolValue, - &iter, &HomeGeographyList, &ContactData, - wxT("ALTID"), &HomeGeographyListAltID, - wxT("PID"), &HomeGeographyListPID, - wxT("MEDIATYPE"), &HomeGeographyListMediatype, - wxT("PREF"), &HomeGeographyListPref, - wxT(""), &HomeGeographyListTokens ); + &iter, &strGeoFinalValue, &ContactData, + wxT("ALTID"), &ContactEditorData.HomeGeographyListAltID, + wxT("PID"), &ContactEditorData.HomeGeographyListPID, + wxT("MEDIATYPE"), &ContactEditorData.HomeGeographyListMediatype, + wxT("PREF"), &ContactEditorData.HomeGeographyListPref, + wxT(""), &ContactEditorData.HomeGeographyListTokens ); ResetSaveProcessData(); @@ -1274,22 +1489,34 @@ void frmContactEditor::SaveContact( wxCommandEvent& event ) ResetSaveProcessData(); - for (std::map::iterator iter = BusinessGeographyList.begin(); - iter != BusinessGeographyList.end(); ++iter){ + for (std::map::iterator iter = ContactEditorData.BusinessGeographyList.begin(); + iter != ContactEditorData.BusinessGeographyList.end(); ++iter){ - wxString strAddressFinalValue = iter->second; + wxString strGeoFinalValue = iter->second; - ProcessCaptureStrings(&strAddressFinalValue); + ProcessCaptureStrings(&strGeoFinalValue); - strAddressFinalValue.insert(0, wxT("geo:")); + 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, &BusinessGeographyList, &ContactData, - wxT("ALTID"), &BusinessGeographyListAltID, - wxT("PID"), &BusinessGeographyListPID, - wxT("MEDIATYPE"), &BusinessGeographyListMediatype, - wxT("PREF"), &BusinessGeographyListPref, - wxT(""), &BusinessGeographyListTokens ); + &iter, &strGeoFinalValue, &ContactData, + wxT("ALTID"), &ContactEditorData.BusinessGeographyListAltID, + wxT("PID"), &ContactEditorData.BusinessGeographyListPID, + wxT("MEDIATYPE"), &ContactEditorData.BusinessGeographyListMediatype, + wxT("PREF"), &ContactEditorData.BusinessGeographyListPref, + wxT(""), &ContactEditorData.BusinessGeographyListTokens ); ResetSaveProcessData(); @@ -1297,17 +1524,17 @@ void frmContactEditor::SaveContact( wxCommandEvent& event ) ResetSaveProcessData(); - for (std::map::iterator iter = GeneralRelatedList.begin(); - iter != GeneralRelatedList.end(); ++iter){ + for (std::map::iterator iter = ContactEditorData.GeneralRelatedList.begin(); + iter != ContactEditorData.GeneralRelatedList.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 ); + &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(); @@ -1315,16 +1542,16 @@ void frmContactEditor::SaveContact( wxCommandEvent& event ) ResetSaveProcessData(); - for (std::map::iterator iter = GeneralWebsiteList.begin(); - iter != GeneralWebsiteList.end(); ++iter){ + for (std::map::iterator iter = ContactEditorData.GeneralWebsiteList.begin(); + iter != ContactEditorData.GeneralWebsiteList.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 ); + &iter, &ContactEditorData.GeneralWebsiteList, &ContactData, + wxT("ALTID"), &ContactEditorData.GeneralWebsiteListAltID, + wxT("PID"), &ContactEditorData.GeneralWebsiteListPID, + wxT("MEDIATYPE"), &ContactEditorData.GeneralWebsiteListMediatype, + wxT("PREF"), &ContactEditorData.GeneralWebsiteListPref, + wxT(""), &ContactEditorData.GeneralWebsiteListTokens ); ResetSaveProcessData(); @@ -1332,16 +1559,16 @@ void frmContactEditor::SaveContact( wxCommandEvent& event ) ResetSaveProcessData(); - for (std::map::iterator iter = HomeWebsiteList.begin(); - iter != HomeWebsiteList.end(); ++iter){ + for (std::map::iterator iter = ContactEditorData.HomeWebsiteList.begin(); + iter != ContactEditorData.HomeWebsiteList.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 ); + &iter, &ContactEditorData.HomeWebsiteList, &ContactData, + wxT("ALTID"), &ContactEditorData.HomeWebsiteListAltID, + wxT("PID"), &ContactEditorData.HomeWebsiteListPID, + wxT("MEDIATYPE"), &ContactEditorData.HomeWebsiteListMediatype, + wxT("PREF"), &ContactEditorData.HomeWebsiteListPref, + wxT(""), &ContactEditorData.HomeWebsiteListTokens ); ResetSaveProcessData(); @@ -1349,16 +1576,16 @@ void frmContactEditor::SaveContact( wxCommandEvent& event ) ResetSaveProcessData(); - for (std::map::iterator iter = BusinessWebsiteList.begin(); - iter != BusinessWebsiteList.end(); ++iter){ + for (std::map::iterator iter = ContactEditorData.BusinessWebsiteList.begin(); + iter != ContactEditorData.BusinessWebsiteList.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 ); + &iter, &ContactEditorData.BusinessWebsiteList, &ContactData, + wxT("ALTID"), &ContactEditorData.BusinessWebsiteListAltID, + wxT("PID"), &ContactEditorData.BusinessWebsiteListPID, + wxT("MEDIATYPE"), &ContactEditorData.BusinessWebsiteListMediatype, + wxT("PREF"), &ContactEditorData.BusinessWebsiteListPref, + wxT(""), &ContactEditorData.BusinessWebsiteListTokens ); ResetSaveProcessData(); @@ -1366,16 +1593,16 @@ void frmContactEditor::SaveContact( wxCommandEvent& event ) ResetSaveProcessData(); - for (std::map::iterator iter = GeneralTitleList.begin(); - iter != GeneralTitleList.end(); ++iter){ + for (std::map::iterator iter = ContactEditorData.GeneralTitleList.begin(); + iter != ContactEditorData.GeneralTitleList.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 ); + &iter, &ContactEditorData.GeneralTitleList, &ContactData, + wxT("ALTID"), &ContactEditorData.GeneralTitleListAltID, + wxT("PID"), &ContactEditorData.GeneralTitleListPID, + wxT("LANGUAGE"), &ContactEditorData.GeneralTitleListLanguage, + wxT("PREF"), &ContactEditorData.GeneralTitleListPref, + wxT(""), &ContactEditorData.GeneralTitleListTokens ); ResetSaveProcessData(); @@ -1383,16 +1610,16 @@ void frmContactEditor::SaveContact( wxCommandEvent& event ) ResetSaveProcessData(); - for (std::map::iterator iter = HomeTitleList.begin(); - iter != HomeTitleList.end(); ++iter){ + for (std::map::iterator iter = ContactEditorData.HomeTitleList.begin(); + iter != ContactEditorData.HomeTitleList.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 ); + &iter, &ContactEditorData.HomeTitleList, &ContactData, + wxT("ALTID"), &ContactEditorData.HomeTitleListAltID, + wxT("PID"), &ContactEditorData.HomeTitleListPID, + wxT("LANGUAGE"), &ContactEditorData.HomeTitleListLanguage, + wxT("PREF"), &ContactEditorData.HomeTitleListPref, + wxT(""), &ContactEditorData.HomeTitleListTokens ); ResetSaveProcessData(); @@ -1400,16 +1627,16 @@ void frmContactEditor::SaveContact( wxCommandEvent& event ) ResetSaveProcessData(); - for (std::map::iterator iter = BusinessTitleList.begin(); - iter != BusinessTitleList.end(); ++iter){ + for (std::map::iterator iter = ContactEditorData.BusinessTitleList.begin(); + iter != ContactEditorData.BusinessTitleList.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 ); + &iter, &ContactEditorData.BusinessTitleList, &ContactData, + wxT("ALTID"), &ContactEditorData.BusinessTitleListAltID, + wxT("PID"), &ContactEditorData.BusinessTitleListPID, + wxT("LANGUAGE"), &ContactEditorData.BusinessTitleListLanguage, + wxT("PREF"), &ContactEditorData.BusinessTitleListPref, + wxT(""), &ContactEditorData.BusinessTitleListTokens ); ResetSaveProcessData(); @@ -1417,16 +1644,16 @@ void frmContactEditor::SaveContact( wxCommandEvent& event ) ResetSaveProcessData(); - for (std::map::iterator iter = GeneralRoleList.begin(); - iter != GeneralRoleList.end(); ++iter){ + for (std::map::iterator iter = ContactEditorData.GeneralRoleList.begin(); + iter != ContactEditorData.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 ); + &iter, &ContactEditorData.GeneralRoleList, &ContactData, + wxT("ALTID"), &ContactEditorData.GeneralRoleListAltID, + wxT("PID"), &ContactEditorData.GeneralRoleListPID, + wxT("LANGUAGE"), &ContactEditorData.GeneralRoleListLanguage, + wxT("PREF"), &ContactEditorData.GeneralRoleListPref, + wxT(""), &ContactEditorData.GeneralRoleListTokens ); ResetSaveProcessData(); @@ -1434,16 +1661,16 @@ void frmContactEditor::SaveContact( wxCommandEvent& event ) ResetSaveProcessData(); - for (std::map::iterator iter = HomeRoleList.begin(); - iter != HomeRoleList.end(); ++iter){ + for (std::map::iterator iter = ContactEditorData.HomeRoleList.begin(); + iter != ContactEditorData.HomeRoleList.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 ); + &iter, &ContactEditorData.HomeRoleList, &ContactData, + wxT("ALTID"), &ContactEditorData.HomeRoleListAltID, + wxT("PID"), &ContactEditorData.HomeRoleListPID, + wxT("LANGUAGE"), &ContactEditorData.HomeRoleListLanguage, + wxT("PREF"), &ContactEditorData.HomeRoleListPref, + wxT(""), &ContactEditorData.HomeRoleListTokens ); ResetSaveProcessData(); @@ -1451,16 +1678,16 @@ void frmContactEditor::SaveContact( wxCommandEvent& event ) ResetSaveProcessData(); - for (std::map::iterator iter = BusinessRoleList.begin(); - iter != BusinessRoleList.end(); ++iter){ + for (std::map::iterator iter = ContactEditorData.BusinessRoleList.begin(); + iter != ContactEditorData.BusinessRoleList.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 ); + &iter, &ContactEditorData.BusinessRoleList, &ContactData, + wxT("ALTID"), &ContactEditorData.BusinessRoleListAltID, + wxT("PID"), &ContactEditorData.BusinessRoleListPID, + wxT("LANGUAGE"), &ContactEditorData.BusinessRoleListLanguage, + wxT("PREF"), &ContactEditorData.BusinessRoleListPref, + wxT(""), &ContactEditorData.BusinessRoleListTokens ); ResetSaveProcessData(); @@ -1468,17 +1695,17 @@ void frmContactEditor::SaveContact( wxCommandEvent& event ) ResetSaveProcessData(); - for (std::map::iterator iter = GeneralOrganisationsList.begin(); - iter != GeneralOrganisationsList.end(); ++iter){ + for (std::map::iterator iter = ContactEditorData.GeneralOrganisationsList.begin(); + iter != ContactEditorData.GeneralOrganisationsList.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 ); + &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(); @@ -1486,17 +1713,17 @@ void frmContactEditor::SaveContact( wxCommandEvent& event ) ResetSaveProcessData(); - for (std::map::iterator iter = HomeOrganisationsList.begin(); - iter != HomeOrganisationsList.end(); ++iter){ + for (std::map::iterator iter = ContactEditorData.HomeOrganisationsList.begin(); + iter != ContactEditorData.HomeOrganisationsList.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 ); + &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(); @@ -1504,17 +1731,17 @@ void frmContactEditor::SaveContact( wxCommandEvent& event ) ResetSaveProcessData(); - for (std::map::iterator iter = BusinessOrganisationsList.begin(); - iter != BusinessOrganisationsList.end(); ++iter){ + for (std::map::iterator iter = ContactEditorData.BusinessOrganisationsList.begin(); + iter != ContactEditorData.BusinessOrganisationsList.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 ); + &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(); @@ -1522,16 +1749,16 @@ void frmContactEditor::SaveContact( wxCommandEvent& event ) ResetSaveProcessData(); - for (std::map::iterator iter = GeneralNoteList.begin(); - iter != GeneralNoteList.end(); ++iter){ + for (std::map::iterator iter = ContactEditorData.GeneralNoteList.begin(); + iter != ContactEditorData.GeneralNoteList.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 ); + &iter, &ContactEditorData.GeneralNoteList, &ContactData, + wxT("ALTID"), &ContactEditorData.GeneralNoteListAltID, + wxT("PID"), &ContactEditorData.GeneralNoteListPID, + wxT("LANGUAGE"), &ContactEditorData.GeneralNoteListLanguage, + wxT("PREF"), &ContactEditorData.GeneralNoteListPref, + wxT(""), &ContactEditorData.GeneralNoteListTokens ); ResetSaveProcessData(); @@ -1539,16 +1766,16 @@ void frmContactEditor::SaveContact( wxCommandEvent& event ) ResetSaveProcessData(); - for (std::map::iterator iter = HomeNoteList.begin(); - iter != HomeNoteList.end(); ++iter){ + for (std::map::iterator iter = ContactEditorData.HomeNoteList.begin(); + iter != ContactEditorData.HomeNoteList.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 ); + &iter, &ContactEditorData.HomeNoteList, &ContactData, + wxT("ALTID"), &ContactEditorData.HomeNoteListAltID, + wxT("PID"), &ContactEditorData.HomeNoteListPID, + wxT("LANGUAGE"), &ContactEditorData.HomeNoteListLanguage, + wxT("PREF"), &ContactEditorData.HomeNoteListPref, + wxT(""), &ContactEditorData.HomeNoteListTokens ); ResetSaveProcessData(); @@ -1556,16 +1783,16 @@ void frmContactEditor::SaveContact( wxCommandEvent& event ) ResetSaveProcessData(); - for (std::map::iterator iter = BusinessNoteList.begin(); - iter != BusinessNoteList.end(); ++iter){ + for (std::map::iterator iter = ContactEditorData.BusinessNoteList.begin(); + iter != ContactEditorData.BusinessNoteList.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 ); + &iter, &ContactEditorData.BusinessNoteList, &ContactData, + wxT("ALTID"), &ContactEditorData.BusinessNoteListAltID, + wxT("PID"), &ContactEditorData.BusinessNoteListPID, + wxT("LANGUAGE"), &ContactEditorData.BusinessNoteListLanguage, + wxT("PREF"), &ContactEditorData.BusinessNoteListPref, + wxT(""), &ContactEditorData.BusinessNoteListTokens ); ResetSaveProcessData(); @@ -1573,16 +1800,16 @@ void frmContactEditor::SaveContact( wxCommandEvent& event ) ResetSaveProcessData(); - for (std::map::iterator iter = CategoriesList.begin(); - iter != CategoriesList.end(); ++iter){ + for (std::map::iterator iter = ContactEditorData.CategoriesList.begin(); + iter != ContactEditorData.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 ); + &iter, &ContactEditorData.CategoriesList, &ContactData, + wxT("ALTID"), &ContactEditorData.CategoriesListAltID, + wxT("PID"), &ContactEditorData.CategoriesListPID, + wxT("TYPE"), &ContactEditorData.CategoriesListType, + wxT("PREF"), &ContactEditorData.CategoriesListPref, + wxT(""), &ContactEditorData.CategoriesListTokens ); ResetSaveProcessData(); @@ -1590,25 +1817,25 @@ void frmContactEditor::SaveContact( wxCommandEvent& event ) // Pictures. - for (std::map::iterator iter = PicturesList.begin(); - iter != PicturesList.end(); ++iter){ + for (std::map::iterator iter = ContactEditorData.PicturesList.begin(); + iter != ContactEditorData.PicturesList.end(); ++iter){ int intValueIndex = iter->first; std::map::iterator stdstriter; std::map::iterator enciter; - striter = PicturesListPictureType.find(intValueIndex); - enciter = PicturesListPicEncType.find(intValueIndex); + striter = ContactEditorData.PicturesListPictureType.find(intValueIndex); + enciter = ContactEditorData.PicturesListPicEncType.find(intValueIndex); ProcessSaveData(wxT("PHOTO"), &strValue2, &boolValue2, &boolValue, - &iter, &PicturesList, &striter, + &iter, &ContactEditorData.PicturesList, &striter, &enciter, &ContactData, - wxT("ALTID"), &PicturesListAltID, - wxT("PID"), &PicturesListPID, - wxT("TYPE"), &PicturesListType, - wxT("PREF"), &PicturesListPref, - wxT(""), &PicturesListTokens); + wxT("ALTID"), &ContactEditorData.PicturesListAltID, + wxT("PID"), &ContactEditorData.PicturesListPID, + wxT("TYPE"), &ContactEditorData.PicturesListType, + wxT("PREF"), &ContactEditorData.PicturesListPref, + wxT(""), &ContactEditorData.PicturesListTokens); ResetSaveProcessData(); @@ -1618,25 +1845,25 @@ void frmContactEditor::SaveContact( wxCommandEvent& event ) // Logos. - for (std::map::iterator iter = LogosList.begin(); - iter != LogosList.end(); ++iter){ + for (std::map::iterator iter = ContactEditorData.LogosList.begin(); + iter != ContactEditorData.LogosList.end(); ++iter){ int intValueIndex = iter->first; std::map::iterator stdstriter; std::map::iterator enciter; - striter = LogosListPictureType.find(intValueIndex); - enciter = LogosListPicEncType.find(intValueIndex); + striter = ContactEditorData.LogosListPictureType.find(intValueIndex); + enciter = ContactEditorData.LogosListPicEncType.find(intValueIndex); ProcessSaveData(wxT("LOGO"), &strValue2, &boolValue2, &boolValue, - &iter, &LogosList, &striter, + &iter, &ContactEditorData.LogosList, &striter, &enciter, &ContactData, - wxT("ALTID"), &LogosListAltID, - wxT("PID"), &LogosListPID, - wxT("TYPE"), &LogosListType, - wxT("PREF"), &LogosListPref, - wxT(""), &LogosListTokens ); + wxT("ALTID"), &ContactEditorData.LogosListAltID, + wxT("PID"), &ContactEditorData.LogosListPID, + wxT("TYPE"), &ContactEditorData.LogosListType, + wxT("PREF"), &ContactEditorData.LogosListPref, + wxT(""), &ContactEditorData.LogosListTokens ); ResetSaveProcessData(); @@ -1646,25 +1873,25 @@ void frmContactEditor::SaveContact( wxCommandEvent& event ) // Sounds. - for (std::map::iterator iter = SoundsList.begin(); - iter != SoundsList.end(); ++iter){ + for (std::map::iterator iter = ContactEditorData.SoundsList.begin(); + iter != ContactEditorData.SoundsList.end(); ++iter){ int intValueIndex = iter->first; std::map::iterator stdstriter; std::map::iterator enciter; - striter = SoundsListAudioType.find(intValueIndex); - enciter = SoundsListAudioEncType.find(intValueIndex); + striter = ContactEditorData.SoundsListAudioType.find(intValueIndex); + enciter = ContactEditorData.SoundsListAudioEncType.find(intValueIndex); ProcessSaveData(wxT("SOUND"), &strValue2, &boolValue2, &boolValue, - &iter, &SoundsList, &striter, + &iter, &ContactEditorData.SoundsList, &striter, &enciter, &ContactData, - wxT("ALTID"), &SoundsListAltID, - wxT("PID"), &SoundsListPID, - wxT("TYPE"), &SoundsListType, - wxT("PREF"), &SoundsListPref, - wxT(""), &SoundsListTokens ); + wxT("ALTID"), &ContactEditorData.SoundsListAltID, + wxT("PID"), &ContactEditorData.SoundsListPID, + wxT("TYPE"), &ContactEditorData.SoundsListType, + wxT("PREF"), &ContactEditorData.SoundsListPref, + wxT(""), &ContactEditorData.SoundsListTokens ); ResetSaveProcessData(); @@ -1672,17 +1899,17 @@ void frmContactEditor::SaveContact( wxCommandEvent& event ) ResetSaveProcessData(); - for (std::map::iterator iter = CalendarList.begin(); - iter != CalendarList.end(); ++iter){ + for (std::map::iterator iter = ContactEditorData.CalendarList.begin(); + iter != ContactEditorData.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 ); + &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(); @@ -1690,17 +1917,17 @@ void frmContactEditor::SaveContact( wxCommandEvent& event ) ResetSaveProcessData(); - for (std::map::iterator iter = CalendarRequestList.begin(); - iter != CalendarRequestList.end(); ++iter){ + for (std::map::iterator iter = ContactEditorData.CalendarRequestList.begin(); + iter != ContactEditorData.CalendarRequestList.end(); ++iter){ 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 ); + &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(); @@ -1708,204 +1935,48 @@ void frmContactEditor::SaveContact( wxCommandEvent& event ) ResetSaveProcessData(); - for (std::map::iterator iter = FreeBusyList.begin(); - iter != FreeBusyList.end(); ++iter){ + for (std::map::iterator iter = ContactEditorData.FreeBusyList.begin(); + iter != ContactEditorData.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 ); + &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){ + for (std::map::iterator iter = ContactEditorData.KeyList.begin(); + iter != ContactEditorData.KeyList.end(); ++iter){ intValue2 = iter->first; - - // Process Alternative ID. - - striter = KeyListAltID.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("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; - - } - - } - - // Process Type. - - striter = KeyListType.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("TYPE=") + strValue3); - - boolValue = TRUE; - - } - - } - - intiter = KeyListPref.find(intValue2); - - 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); + striter = ContactEditorData.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. + 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 ); - if (boolValue == TRUE){ - - ContactData.AddRaw(wxT("KEY;") + strValue2, strValueData); - - } else { - - ContactData.Add(wxT("KEY"), strValueData, TRUE); - - } - - ResetSaveProcessData(); + ResetSaveProcessData(); } @@ -1913,14 +1984,14 @@ void frmContactEditor::SaveContact( wxCommandEvent& event ) 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; // Get the IANA PEN number. - striter = VendorListPEN.find(intValue2); + striter = ContactEditorData.VendorListPEN.find(intValue2); if (striter->first == intValue2){ @@ -1930,7 +2001,7 @@ void frmContactEditor::SaveContact( wxCommandEvent& event ) // Get the element name. - striter = VendorListElement.find(intValue2); + striter = ContactEditorData.VendorListElement.find(intValue2); if (striter->first == intValue2){ @@ -1940,7 +2011,7 @@ void frmContactEditor::SaveContact( wxCommandEvent& event ) // Get the address. - striter = VendorList.find(intValue2); + striter = ContactEditorData.VendorList.find(intValue2); if (striter->first == intValue2){ @@ -1968,14 +2039,14 @@ void frmContactEditor::SaveContact( wxCommandEvent& event ) // 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; // Get the element name. - striter = XTokenListTokens.find(intValue2); + striter = ContactEditorData.XTokenListTokens.find(intValue2); if (striter->first == intValue2){ @@ -1985,7 +2056,7 @@ void frmContactEditor::SaveContact( wxCommandEvent& event ) // Get the address. - striter = XTokenList.find(intValue2); + striter = ContactEditorData.XTokenList.find(intValue2); if (striter->first == intValue2){ @@ -2011,22 +2082,22 @@ void frmContactEditor::SaveContact( wxCommandEvent& event ) 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(""))); + 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){ @@ -2037,16 +2108,16 @@ void frmContactEditor::SaveContact( wxCommandEvent& event ) 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 ); + &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. @@ -2138,7 +2209,7 @@ void frmContactEditor::SaveContact( wxCommandEvent& event ) // DateRev.Append(wxString DateTimeNow->); DateRev.Append(wxT("Z")); - ContactData.Add(wxT("UID"), UIDToken, FALSE); + ContactData.Add(wxT("UID"), ContactEditorData.UIDToken, FALSE); // End the vCard File. @@ -2288,8 +2359,8 @@ void frmContactEditor::SaveContact( wxCommandEvent& event ) ucd->ContactName = cmbDisplayAs->GetValue(); ucd->ContactNameArray = ContactData.GetName(); - 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;