From 9df6fa24ffcd0cb8e6b5f5fc5ec4f09bb411ac89 Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Mon, 28 Dec 2015 03:53:22 +0000 Subject: [PATCH] Replaced string processing in MEMBER with ProcessStringValue. --- source/contacteditor/ContactDataObject.cpp | 26 +++++++++------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/source/contacteditor/ContactDataObject.cpp b/source/contacteditor/ContactDataObject.cpp index 47fe119..d794af2 100644 --- a/source/contacteditor/ContactDataObject.cpp +++ b/source/contacteditor/ContactDataObject.cpp @@ -731,6 +731,7 @@ void ContactDataObject::ProcessMember(wxString PropertySeg1, wxString PropertySe wxString PropertyTokens; std::map::iterator SLiter; bool FirstToken = TRUE; + bool PropertyMatched = FALSE; for (std::map::iterator intiter = SplitPoints.begin(); intiter != SplitPoints.end(); ++intiter){ @@ -747,26 +748,19 @@ void ContactDataObject::ProcessMember(wxString PropertySeg1, wxString PropertySe CaptureString(&PropertyValue, FALSE); - if (PropertyName == wxT("ALTID")){ - - GroupsListAltID.erase(*GroupCount); - GroupsListAltID.insert(std::make_pair(*GroupCount, PropertyValue)); + ProcessStringValue(&PropertyName, "ALTID", &GroupsListAltID, &PropertyValue, GroupCount, &PropertyMatched); + ProcessStringValue(&PropertyName, "PID", &GroupsListPID, &PropertyValue, GroupCount, &PropertyMatched); + ProcessStringValue(&PropertyName, "MEDIATYPE", &GroupsListMediaType, &PropertyValue, GroupCount, &PropertyMatched); + ProcessIntegerValue(&PropertyName, "PREF", &GroupsListPref, &PropertyValue, GroupCount, &PropertyMatched); - } else if (PropertyName == wxT("PID")){ - - GroupsListPID.erase(*GroupCount); - GroupsListPID.insert(std::make_pair(*GroupCount, PropertyValue)); + if (PropertyMatched == TRUE){ - } else if (PropertyName == wxT("PREF")){ - - ProcessIntegerValue(&GroupsListPref, &PropertyValue, GroupCount); + PropertyMatched = FALSE; + continue; - } else if (PropertyName == wxT("MEDIATYPE")){ - - GroupsListMediaType.erase(*GroupCount); - GroupsListMediaType.insert(std::make_pair(*GroupCount, PropertyValue)); + } - } else if (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty()){ + if (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty()){ if (FirstToken == TRUE){ -- 2.39.2