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

index ec9a03d..323475c 100644 (file)
@@ -3054,6 +3054,7 @@ void ContactDataObject::ProcessURL(wxString PropertySeg1, wxString PropertySeg2,
        }
        
        intPrevValue = 4;
+       bool PropertyMatched = FALSE;
        
        for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
        intiter != SplitPoints.end(); ++intiter){
@@ -3087,45 +3088,31 @@ void ContactDataObject::ProcessURL(wxString PropertySeg1, wxString PropertySeg2,
                
                CaptureString(&PropertyValue, FALSE);
                
-               if (PropertyName == wxT("ALTID")){
-
-                       WebsiteListAltID->erase(*URLCount);
-                       WebsiteListAltID->insert(std::make_pair(*URLCount, PropertyValue));
+               ProcessStringValue(&PropertyName, "ALTID", WebsiteListAltID, &PropertyValue, URLCount, &PropertyMatched);
+               ProcessStringValue(&PropertyName, "PID", WebsiteListPID, &PropertyValue, URLCount, &PropertyMatched);
+               ProcessStringValue(&PropertyName, "MEDIATYPE", WebsiteListMediatype, &PropertyValue, URLCount, &PropertyMatched);
+               ProcessIntegerValue(&PropertyName, "PREF", WebsiteListPref, &PropertyValue, URLCount, &PropertyMatched);
                
-               } else if (PropertyName == wxT("PID")){
-
-                       WebsiteListPID->erase(*URLCount);
-                       WebsiteListPID->insert(std::make_pair(*URLCount, PropertyValue));
-                       
-               } else if (PropertyName == wxT("PREF")){
-
-                       ProcessIntegerValue(WebsiteListPref, &PropertyValue, URLCount);
-                                                       
-               } else if (PropertyName == wxT("MEDIATYPE")){
+               if (PropertyMatched == TRUE){
                
-                       WebsiteListMediatype->erase(*URLCount);
-                       WebsiteListMediatype->insert(std::make_pair(*URLCount, PropertyValue));
+                       PropertyMatched = FALSE;
+                       continue;
                
-               } else {
+               }
                
-                       // Something else we don't know about so append
-                       // to the tokens variable.
+               if (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty() && PropertyName != wxT("TYPE")){
+       
+                       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