Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Replaced string processing in EMAIL with ProcessStringValue.
authorSteve Brokenshire <sbrokenshire@xestia.co.uk>
Mon, 28 Dec 2015 04:20:12 +0000 (04:20 +0000)
committerSteve Brokenshire <sbrokenshire@xestia.co.uk>
Mon, 28 Dec 2015 04:20:12 +0000 (04:20 +0000)
source/contacteditor/ContactDataObject.cpp

index 75612ac..ac80f15 100644 (file)
@@ -2056,6 +2056,7 @@ void ContactDataObject::ProcessEmail(wxString PropertySeg1, wxString PropertySeg
        wxString PropertyValue;
        wxString PropertyTokens;
        bool FirstToken = TRUE;
+       bool PropertyMatched = FALSE;
        
        for (std::map<int, int>::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);
                        
                        }
-               
+                       
                }
        
        }
Xestia Software Development
Yn Maystri
© 2006 - 2019 Xestia Software Development
Software

Xestia Address Book
Xestia Calendar
Development

Xestia Gelforn
Everything else

About
News
Privacy Policy