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

index 0668659..b71c1f3 100644 (file)
@@ -2470,6 +2470,8 @@ void ContactDataObject::ProcessTelephone(wxString PropertySeg1, wxString Propert
 
        intPrevValue = 4;
        
+       bool PropertyMatched = FALSE;
+       
        for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
        intiter != SplitPoints.end(); ++intiter){
        
@@ -2487,34 +2489,27 @@ void ContactDataObject::ProcessTelephone(wxString PropertySeg1, wxString Propert
                
                // Process properties.
                
-               if (PropertyName == wxT("ALTID")){
-
-                       TelephoneListAltID->erase(*TelephoneCount);
-                       TelephoneListAltID->insert(std::make_pair(*TelephoneCount, PropertyValue));
+               ProcessStringValue(&PropertyName, "ALTID", TelephoneListAltID, &PropertyValue, TelephoneCount, &PropertyMatched);
+               ProcessStringValue(&PropertyName, "PID", TelephoneListPID, &PropertyValue, TelephoneCount, &PropertyMatched);
+               ProcessIntegerValue(&PropertyName, "PREF", TelephoneListPref, &PropertyValue, TelephoneCount, &PropertyMatched);
                
-               } else if (PropertyName == wxT("PID")){
-
-                       TelephoneListPID->erase(*TelephoneCount);
-                       TelephoneListPID->insert(std::make_pair(*TelephoneCount, PropertyValue));
+               if (PropertyMatched == TRUE){
                
-               } else if (PropertyName == wxT("PREF")){
-
-                       ProcessIntegerValue(TelephoneListPref, &PropertyValue, TelephoneCount);
+                       PropertyMatched = FALSE;
+                       continue;
                
-               } else {
+               }
+
+               if (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty() && PropertyName != wxT("TYPE")){
                
-                       if (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty() && PropertyName != wxT("TYPE")){
+                       if (FirstToken == TRUE){
                        
-                               if (FirstToken == TRUE){
-                               
-                                       PropertyTokens.Append(PropertyName + wxT("=") + PropertyValue);
-                                       FirstToken = FALSE;
-                               
-                               } else {
-                               
-                                       PropertyTokens.Append(wxT(";") + PropertyName + wxT("=") + PropertyValue);
-                               
-                               }
+                               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