From 761f457eb9757276b88bc324e9ee7d964d628734 Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Mon, 28 Dec 2015 04:20:12 +0000 Subject: [PATCH] Replaced string processing in EMAIL with ProcessStringValue. --- source/contacteditor/ContactDataObject.cpp | 42 ++++++++++------------ 1 file changed, 18 insertions(+), 24 deletions(-) diff --git a/source/contacteditor/ContactDataObject.cpp b/source/contacteditor/ContactDataObject.cpp index 75612ac..ac80f15 100644 --- a/source/contacteditor/ContactDataObject.cpp +++ b/source/contacteditor/ContactDataObject.cpp @@ -2056,6 +2056,7 @@ void ContactDataObject::ProcessEmail(wxString PropertySeg1, wxString PropertySeg wxString PropertyValue; wxString PropertyTokens; bool FirstToken = TRUE; + bool PropertyMatched = FALSE; for (std::map::iterator intiter = SplitPoints.begin(); intiter != SplitPoints.end(); ++intiter){ @@ -2074,37 +2075,30 @@ void ContactDataObject::ProcessEmail(wxString PropertySeg1, wxString PropertySeg // Process properties. - if (PropertyName == wxT("ALTID")){ - - EmailListAltID->erase(*EmailCount); - EmailListAltID->insert(std::make_pair(*EmailCount, PropertyValue)); + ProcessStringValue(&PropertyName, "ALTID", EmailListAltID, &PropertyValue, EmailCount, &PropertyMatched); + ProcessStringValue(&PropertyName, "PID", EmailListPID, &PropertyValue, EmailCount, &PropertyMatched); + ProcessIntegerValue(&PropertyName, "PREF", EmailListPref, &PropertyValue, EmailCount, &PropertyMatched); - } else if (PropertyName == wxT("PID")){ - - EmailListPID->erase(*EmailCount); - EmailListPID->insert(std::make_pair(*EmailCount, PropertyValue)); + if (PropertyMatched == TRUE){ - } else if (PropertyName == wxT("PREF")){ - - ProcessIntegerValue(EmailListPref, &PropertyValue, EmailCount); + PropertyMatched = FALSE; + continue; - } else { + } - if (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty() && PropertyName != wxT("TYPE")){ + if (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty() && PropertyName != wxT("TYPE")){ - if (FirstToken == TRUE){ - - PropertyTokens.Append(PropertyName + wxT("=") + PropertyValue); - FirstToken = FALSE; - - } else { - - PropertyTokens.Append(wxT(";") + PropertyName + wxT("=") + PropertyValue); - - } + if (FirstToken == TRUE){ + + PropertyTokens.Append(PropertyName + wxT("=") + PropertyValue); + FirstToken = FALSE; + + } else { + + PropertyTokens.Append(wxT(";") + PropertyName + wxT("=") + PropertyValue); } - + } } -- 2.39.2