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

index b71c1f3..6b80e98 100644 (file)
@@ -2590,6 +2590,7 @@ void ContactDataObject::ProcessLanguage(wxString PropertySeg1, wxString Property
        wxString PropertyValue;
        wxString PropertyTokens;
        bool FirstToken = TRUE;
+       bool PropertyMatched = FALSE;
        
        for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
        intiter != SplitPoints.end(); ++intiter){
@@ -2608,34 +2609,27 @@ void ContactDataObject::ProcessLanguage(wxString PropertySeg1, wxString Property
                
                // Process properties.
                
-               if (PropertyName == wxT("ALTID")){
+               ProcessStringValue(&PropertyName, "ALTID", LanguageListAltID, &PropertyValue, LanguageCount, &PropertyMatched);
+               ProcessStringValue(&PropertyName, "PID", LanguageListPID, &PropertyValue, LanguageCount, &PropertyMatched);
+               ProcessIntegerValue(&PropertyName, "PREF", LanguageListPref, &PropertyValue, LanguageCount, &PropertyMatched);
 
-                       LanguageListAltID->erase(*LanguageCount);
-                       LanguageListAltID->insert(std::make_pair(*LanguageCount, PropertyValue));
+               if (PropertyMatched == TRUE){
                
-               } else if (PropertyName == wxT("PID")){
-
-                       LanguageListPID->erase(*LanguageCount);
-                       LanguageListPID->insert(std::make_pair(*LanguageCount, PropertyValue));
+                       PropertyMatched = FALSE;
+                       continue;
                
-               } else if (PropertyName == wxT("PREF")){
-                       
-                       ProcessIntegerValue(LanguageListPref, &PropertyValue, LanguageCount);
+               }
                
-               } 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