Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Fixed potential crash in frmContactEditorCalAdr in Edit mode.
[xestiaab/.git] / source / contacteditor / cdo / ContactDataObject.cpp
index afa3a42..5085409 100644 (file)
@@ -2082,6 +2082,7 @@ void ContactDataObject::ProcessTelephone(wxString PropertySeg1, wxString Propert
                        TypeSplitLength.insert(std::make_pair(intSplitsFound, intSplitSize));                                                           
                
                        int intTypeSeek = 0;
+                       bool TypeFound = FALSE;
                
                        for (std::map<int, int>::iterator typeiter = TypeSplitPoints.begin(); 
                        typeiter != TypeSplitPoints.end(); ++typeiter){
@@ -2101,17 +2102,22 @@ void ContactDataObject::ProcessTelephone(wxString PropertySeg1, wxString Propert
                                
                                }
 
-                               if (TypePropertyName == wxT("home")){
+                               if (TypePropertyName == wxT("home") && TypeFound == FALSE){
                                
                                        PropType = PROPERTY_HOME;
+                                       TelTypeUI.Append("home");
+                                       intTypeSeek++;
+                                       TypeFound = TRUE;
                                
-                               } else if (TypePropertyName == wxT("work")){
+                               } else if (TypePropertyName == wxT("work") && TypeFound == FALSE){
                                
                                        PropType = PROPERTY_WORK;
-                                                                       
+                                       TelTypeUI.Append("work");
+                                       intTypeSeek++;
+                                       TypeFound = TRUE;
+                                               
                                }
                                
-                               
                                if (TypePropertyName == wxT("text")){
                                
                                        TelTypeUI.Append(_("text"));
@@ -2389,6 +2395,7 @@ void ContactDataObject::ProcessGeographic(wxString PropertySeg1, wxString Proper
        std::map<int, wxString> *GeopositionListPID = NULL;
        std::map<int, wxString> *GeopositionListTokens = NULL;
        std::map<int, wxString> *GeopositionListMediatype = NULL;
+       std::map<int, wxString> *GeopositionListDataType = NULL;
        std::map<int, int> *GeopositionListPref = NULL;
 
        switch(PropType){
@@ -2399,6 +2406,7 @@ void ContactDataObject::ProcessGeographic(wxString PropertySeg1, wxString Proper
                        GeopositionListPID = &GeneralGeographyListPID;
                        GeopositionListTokens = &GeneralGeographyListTokens;
                        GeopositionListMediatype = &GeneralGeographyListMediatype;
+                       GeopositionListDataType = &GeneralGeographyListDataType;
                        GeopositionListPref = &GeneralGeographyListPref;        
                        break;
                case PROPERTY_HOME:
@@ -2408,6 +2416,7 @@ void ContactDataObject::ProcessGeographic(wxString PropertySeg1, wxString Proper
                        GeopositionListPID = &HomeGeographyListPID;
                        GeopositionListTokens = &HomeGeographyListTokens;
                        GeopositionListMediatype = &HomeGeographyListMediatype;
+                       GeopositionListDataType = &HomeGeographyListDataType;
                        GeopositionListPref = &HomeGeographyListPref;   
                        break;
                case PROPERTY_WORK:
@@ -2416,7 +2425,8 @@ void ContactDataObject::ProcessGeographic(wxString PropertySeg1, wxString Proper
                        GeopositionListAltID = &BusinessGeographyListAltID;
                        GeopositionListPID = &BusinessGeographyListPID;
                        GeopositionListTokens = &BusinessGeographyListTokens;
-                       GeopositionListMediatype = &BusinessGeographyListMediatype;     
+                       GeopositionListMediatype = &BusinessGeographyListMediatype;
+                       GeopositionListDataType = &BusinessGeographyListDataType;
                        GeopositionListPref = &BusinessGeographyListPref;
                        break;
        }
@@ -2458,9 +2468,21 @@ void ContactDataObject::ProcessGeographic(wxString PropertySeg1, wxString Proper
                ProcessTokens(&PropertyName, &PropertyValue, &PropertyTokens, &FirstToken);
        
        }
+       
+       wxStringTokenizer GeoSplitData(PropertySeg2, wxT(":"));
                
-       GeopositionList->insert(std::make_pair(*GeographicCount, PropertySeg2));
+       if (GeoSplitData.CountTokens() > 1){
+
+               GeopositionListDataType->insert(std::make_pair(*GeographicCount, GeoSplitData.GetNextToken()));                 
+               GeopositionList->insert(std::make_pair(*GeographicCount, GeoSplitData.GetString()));
        
+       } else {
+       
+               GeopositionList->insert(std::make_pair(*GeographicCount, PropertySeg2));
+               GeopositionListDataType->insert(std::make_pair(*GeographicCount, "tel"));
+       
+       }
+               
        // Add the name token data.
        
        if (!PropertyTokens.IsEmpty()){
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