From 4f6b7ab45dcd3662217501c23a94bbe97a060509 Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Wed, 6 Jan 2016 18:08:13 +0000 Subject: [PATCH] Improved TEL support. --- .../contacteditor/frmContactEditor-Save.cpp | 44 +++++++++++++++++-- 1 file changed, 40 insertions(+), 4 deletions(-) diff --git a/source/contacteditor/frmContactEditor-Save.cpp b/source/contacteditor/frmContactEditor-Save.cpp index 65e8715..64baede 100644 --- a/source/contacteditor/frmContactEditor-Save.cpp +++ b/source/contacteditor/frmContactEditor-Save.cpp @@ -1075,8 +1075,20 @@ void frmContactEditor::SaveContact( wxCommandEvent& event ) ProcessCaptureStrings(&strAddressFinalValue); - strAddressFinalValue.insert(0, wxT("tel:")); - + if (ContactEditorData.GeneralTelephoneListDataType.find(iter->first) != + ContactEditorData.GeneralTelephoneListDataType.end()){ + + std::map::iterator DataTypeIter = ContactEditorData.GeneralTelephoneListDataType.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.GeneralTelephoneListAltID, @@ -1098,7 +1110,19 @@ void frmContactEditor::SaveContact( wxCommandEvent& event ) 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, @@ -1121,7 +1145,19 @@ void frmContactEditor::SaveContact( wxCommandEvent& event ) 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, -- 2.39.5