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

index 8467edf..6ee703e 100644 (file)
@@ -4950,6 +4950,7 @@ void ContactDataObject::ProcessKey(wxString PropertySeg1, wxString PropertySeg2,
        CheckType(&PropertySeg1, &SplitPoints, &SplitLength, &intPrevValue, &PropType);
 
        intPrevValue = 4;
+       bool PropertyMatched = FALSE;
 
        for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
        intiter != SplitPoints.end(); ++intiter){
@@ -4979,39 +4980,29 @@ void ContactDataObject::ProcessKey(wxString PropertySeg1, wxString PropertySeg2,
                        
                        PropertyValue.Remove(0, 1);
                        
-               }                               
+               }
                
-               if (PropertyName == wxT("ALTID")){
-
-                       KeyListAltID.erase(*KeyCount);
-                       KeyListAltID.insert(std::make_pair(*KeyCount, PropertyValue));
+               ProcessStringValue(&PropertyName, "ALTID", &KeyListAltID, &PropertyValue, KeyCount, &PropertyMatched);
+               ProcessStringValue(&PropertyName, "PID", &KeyListPID, &PropertyValue, KeyCount, &PropertyMatched);
+               ProcessIntegerValue(&PropertyName, "PREF", &KeyListPref, &PropertyValue, KeyCount, &PropertyMatched);
                
-               } else if (PropertyName == wxT("PID")){
-
-                       KeyListPID.erase(*KeyCount);
-                       KeyListPID.insert(std::make_pair(*KeyCount, PropertyValue));
+               if (PropertyMatched == TRUE){
                
-               } else if (PropertyName == wxT("PREF")){
-
-                       ProcessIntegerValue(&KeyListPref, &PropertyValue, KeyCount);
+                       PropertyMatched = FALSE;
+                       continue;
                
-               } else {
+               }
+
+               if (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty() && PropertyName != wxT("TYPE")){
                
-                       // Something else we don't know about so append
-                       // to the tokens variable.
+                       if (FirstToken == TRUE){
                        
-                       if (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty() && PropertyName != wxT("TYPE")){
+                               PropertyTokens.Append(PropertyName + wxT("=") + PropertyValue);
+                               FirstToken = FALSE;
                        
-                               if (FirstToken == TRUE){
-                               
-                                       PropertyTokens.Append(PropertyName + wxT("=") + PropertyValue);
-                                       FirstToken = FALSE;
-                               
-                               } else {
-                               
-                                       PropertyTokens.Append(wxT(";") + PropertyName + wxT("=") + PropertyValue);
-                               
-                               }
+                       } 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