From 56cd32a96e2b59f696556a6f074de1f69fd7a7c8 Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Sun, 10 Jan 2016 20:51:54 +0000 Subject: [PATCH] Now insert 'geo:' with value if no data type is given for GEO. --- .../contacteditor/frmContactEditor-Save.cpp | 60 +++++++++++++++---- 1 file changed, 48 insertions(+), 12 deletions(-) diff --git a/source/contacteditor/frmContactEditor-Save.cpp b/source/contacteditor/frmContactEditor-Save.cpp index e05199d..9148b98 100644 --- a/source/contacteditor/frmContactEditor-Save.cpp +++ b/source/contacteditor/frmContactEditor-Save.cpp @@ -1356,14 +1356,26 @@ void frmContactEditor::SaveContact( wxCommandEvent& event ) 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, + &iter, &strGeoFinalValue, &ContactData, wxT("ALTID"), &ContactEditorData.GeneralGeographyListAltID, wxT("PID"), &ContactEditorData.GeneralGeographyListPID, wxT("MEDIATYPE"), &ContactEditorData.GeneralGeographyListMediatype, @@ -1379,14 +1391,26 @@ void frmContactEditor::SaveContact( wxCommandEvent& event ) 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, &ContactEditorData.HomeGeographyList, &ContactData, + &iter, &strGeoFinalValue, &ContactData, wxT("ALTID"), &ContactEditorData.HomeGeographyListAltID, wxT("PID"), &ContactEditorData.HomeGeographyListPID, wxT("MEDIATYPE"), &ContactEditorData.HomeGeographyListMediatype, @@ -1402,14 +1426,26 @@ void frmContactEditor::SaveContact( wxCommandEvent& event ) 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, &ContactEditorData.BusinessGeographyList, &ContactData, + &iter, &strGeoFinalValue, &ContactData, wxT("ALTID"), &ContactEditorData.BusinessGeographyListAltID, wxT("PID"), &ContactEditorData.BusinessGeographyListPID, wxT("MEDIATYPE"), &ContactEditorData.BusinessGeographyListMediatype, -- 2.39.2