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

index 546cd21..245341b 100644 (file)
@@ -3344,6 +3344,7 @@ void ContactDataObject::ProcessRole(wxString PropertySeg1, wxString PropertySeg2
        }
 
        intPrevValue = 5;
+       bool PropertyMatched = FALSE;
                
        for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
        intiter != SplitPoints.end(); ++intiter){
@@ -3377,47 +3378,33 @@ void ContactDataObject::ProcessRole(wxString PropertySeg1, wxString PropertySeg2
                
                CaptureString(&PropertyValue, FALSE);
                
-               if (PropertyName == wxT("ALTID")){
-               
-                       RoleListAltID->erase(*RoleCount);
-                       RoleListAltID->insert(std::make_pair(*RoleCount, PropertyValue));
+               ProcessStringValue(&PropertyName, "ALTID", RoleListAltID, &PropertyValue, RoleCount, &PropertyMatched);
+               ProcessStringValue(&PropertyName, "PID", RoleListPID, &PropertyValue, RoleCount, &PropertyMatched);
+               ProcessStringValue(&PropertyName, "LANGUAGE", RoleListLanguage, &PropertyValue, RoleCount, &PropertyMatched);
+               ProcessIntegerValue(&PropertyName, "PREF", RoleListPref, &PropertyValue, RoleCount, &PropertyMatched);
                
-               } else if (PropertyName == wxT("PID")){
-
-                       RoleListPID->erase(*RoleCount);
-                       RoleListPID->insert(std::make_pair(*RoleCount, PropertyValue));
+               if (PropertyMatched == TRUE){
                
-               } else if (PropertyName == wxT("PREF")){
-
-                       ProcessIntegerValue(RoleListPref, &PropertyValue, RoleCount);
-                               
-               } else if (PropertyName == wxT("LANGUAGE")){
+                       PropertyMatched = FALSE;
+                       continue;
                
-                       RoleListLanguage->erase(*RoleCount);
-                       RoleListLanguage->insert(std::make_pair(*RoleCount, PropertyValue));
+               }
                
-               } else {
+               if (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty() && PropertyName != wxT("TYPE")){
+       
+                       if (FirstToken == TRUE){
                
-                       // Something else we don't know about so append
-                       // to the tokens variable.
+                               PropertyTokens.Append(PropertyName + wxT("=") + PropertyValue);
+                               FirstToken = FALSE;
                
-                       if (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty() && PropertyName != wxT("TYPE")){
+                       } else {
                
-                               if (FirstToken == TRUE){
-                       
-                                       PropertyTokens.Append(PropertyName + wxT("=") + PropertyValue);
-                                       FirstToken = FALSE;
-                       
-                               } else {
-                       
-                                       PropertyTokens.Append(wxT(";") + PropertyName + wxT("=") + PropertyValue);
-                       
-                               }
+                               PropertyTokens.Append(wxT(";") + PropertyName + wxT("=") + PropertyValue);
                
                        }
-               
-               }
        
+               }
+               
        }
        
        // Add the data to the General/Home/Work address variables.
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