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

index 7f81b11..51fb95d 100644 (file)
@@ -4015,6 +4015,7 @@ void ContactDataObject::ProcessPhoto(wxString PropertySeg1, wxString PropertySeg
        CheckType(&PropertySeg1, &SplitPoints, &SplitLength, &intPrevValue, &PropType);
 
        intPrevValue = 6;
+       bool PropertyMatched = FALSE;
 
        for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
        intiter != SplitPoints.end(); ++intiter){
@@ -4048,47 +4049,33 @@ void ContactDataObject::ProcessPhoto(wxString PropertySeg1, wxString PropertySeg
                
                CaptureString(&PropertyValue, FALSE);
                
-               if (PropertyName == wxT("ALTID")){
-
-                       PicturesListAltID.erase(*PhotoCount);
-                       PicturesListAltID.insert(std::make_pair(*PhotoCount, PropertyValue));
-               
-               } else if (PropertyName == wxT("PID")){
-
-                       PicturesListPID.erase(*PhotoCount);
-                       PicturesListPID.insert(std::make_pair(*PhotoCount, PropertyValue));
+               ProcessStringValue(&PropertyName, "ALTID", &PicturesListAltID, &PropertyValue, PhotoCount, &PropertyMatched);
+               ProcessStringValue(&PropertyName, "PID", &PicturesListPID, &PropertyValue, PhotoCount, &PropertyMatched);
+               ProcessStringValue(&PropertyName, "MEDIATYPE", &PicturesListMediatype, &PropertyValue, PhotoCount, &PropertyMatched);
+               ProcessIntegerValue(&PropertyName, "PREF", &PicturesListPref, &PropertyValue, PhotoCount, &PropertyMatched);
                
-               } else if (PropertyName == wxT("PREF")){
-
-                       ProcessIntegerValue(&PicturesListPref, &PropertyValue, PhotoCount);
+               if (PropertyMatched == TRUE){
                
-               } else if (PropertyName == wxT("MEDIATYPE")){
+                       PropertyMatched = FALSE;
+                       continue;
                
-                       PicturesListMediatype.erase(*PhotoCount);
-                       PicturesListMediatype.insert(std::make_pair(*PhotoCount, PropertyValue));
-                                       
-               } 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);
                        
                        }
                
                }
-       
+                       
        }       
        
        intPropertyLen = PropertySeg2.Len();
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