From 161661bd91759e073838690eb28ab76e5aa9fb1c Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Sun, 10 Jan 2016 21:44:16 +0000 Subject: [PATCH] Updated TEL processing when saving a contact with frmContactEditor --- .../contacteditor/frmContactEditor-Save.cpp | 22 +++++++++++++------ 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/source/contacteditor/frmContactEditor-Save.cpp b/source/contacteditor/frmContactEditor-Save.cpp index 0add4b5..893b173 100644 --- a/source/contacteditor/frmContactEditor-Save.cpp +++ b/source/contacteditor/frmContactEditor-Save.cpp @@ -1155,11 +1155,11 @@ void frmContactEditor::SaveContact( wxCommandEvent& event ) iter != ContactEditorData.GeneralTelephoneList.end(); ++iter){ wxString strAddressFinalValue = iter->second; + int DataID = iter->first; ProcessCaptureStrings(&strAddressFinalValue); - if (ContactEditorData.GeneralTelephoneListDataType.find(iter->first) != - ContactEditorData.GeneralTelephoneListDataType.end()){ + if (MapDataExists(&DataID, &ContactEditorData.GeneralTelephoneListDataType)){ std::map::iterator DataTypeIter = ContactEditorData.GeneralTelephoneListDataType.find(iter->first); @@ -1172,11 +1172,19 @@ void frmContactEditor::SaveContact( wxCommandEvent& event ) } + 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.GeneralTelephoneListType, + wxT("TYPE"), &ContactEditorData.GeneralTelephoneListTypeInfo, wxT("PREF"), &ContactEditorData.GeneralTelephoneListPref, wxT(""), &ContactEditorData.GeneralTelephoneListTokens ); @@ -1206,12 +1214,12 @@ void frmContactEditor::SaveContact( wxCommandEvent& event ) strAddressFinalValue.insert(0, "tel:"); } - + ProcessSaveData(wxT("TEL"), &strValue2, &boolValue2, &boolValue, &iter, &strAddressFinalValue, &ContactData, wxT("ALTID"), &ContactEditorData.HomeTelephoneListAltID, wxT("PID"), &ContactEditorData.HomeTelephoneListPID, - wxT("TYPE"), &ContactEditorData.HomeTelephoneListType, + wxT("TYPE"), &ContactEditorData.HomeTelephoneListTypeInfo, wxT("PREF"), &ContactEditorData.HomeTelephoneListPref, wxT(""), &ContactEditorData.HomeTelephoneListTokens ); @@ -1241,12 +1249,12 @@ void frmContactEditor::SaveContact( wxCommandEvent& event ) strAddressFinalValue.insert(0, "tel:"); } - + ProcessSaveData(wxT("TEL"), &strValue2, &boolValue2, &boolValue, &iter, &strAddressFinalValue, &ContactData, wxT("ALTID"), &ContactEditorData.BusinessTelephoneListAltID, wxT("PID"), &ContactEditorData.BusinessTelephoneListPID, - wxT("TYPE"), &ContactEditorData.BusinessTelephoneListType, + wxT("TYPE"), &ContactEditorData.BusinessTelephoneListTypeInfo, wxT("PREF"), &ContactEditorData.BusinessTelephoneListPref, wxT(""), &ContactEditorData.BusinessTelephoneListTokens ); -- 2.39.5