X-Git-Url: http://Server1/repobrowser/?a=blobdiff_plain;f=source%2Fcontacteditor%2FContactDataObject.cpp;h=245341be5d81c0bc64588103f7491b7e59c949e2;hb=ad76a9933d9cfcee0abe970c996a944b56e3caf8;hp=323475c242c36001e4161382a75bf42a845bace9;hpb=daa8c8c9811772ffe0ca21639b365f438d5c35bc;p=xestiaab%2F.git diff --git a/source/contacteditor/ContactDataObject.cpp b/source/contacteditor/ContactDataObject.cpp index 323475c..245341b 100644 --- a/source/contacteditor/ContactDataObject.cpp +++ b/source/contacteditor/ContactDataObject.cpp @@ -3199,6 +3199,7 @@ void ContactDataObject::ProcessTitle(wxString PropertySeg1, wxString PropertySeg } intPrevValue = 6; + bool PropertyMatched = FALSE; for (std::map::iterator intiter = SplitPoints.begin(); intiter != SplitPoints.end(); ++intiter){ @@ -3232,45 +3233,31 @@ void ContactDataObject::ProcessTitle(wxString PropertySeg1, wxString PropertySeg CaptureString(&PropertyValue, FALSE); - if (PropertyName == wxT("ALTID")){ + ProcessStringValue(&PropertyName, "ALTID", TitleListAltID, &PropertyValue, TitleCount, &PropertyMatched); + ProcessStringValue(&PropertyName, "PID", TitleListPID, &PropertyValue, TitleCount, &PropertyMatched); + ProcessStringValue(&PropertyName, "LANGUAGE", TitleListLanguage, &PropertyValue, TitleCount, &PropertyMatched); + ProcessIntegerValue(&PropertyName, "PREF", TitleListPref, &PropertyValue, TitleCount, &PropertyMatched); - TitleListAltID->erase(*TitleCount); - TitleListAltID->insert(std::make_pair(*TitleCount, PropertyValue)); + if (PropertyMatched == TRUE){ - } else if (PropertyName == wxT("PID")){ - - TitleListPID->erase(*TitleCount); - TitleListPID->insert(std::make_pair(*TitleCount, PropertyValue)); + PropertyMatched = FALSE; + continue; - } else if (PropertyName == wxT("PREF")){ + } - ProcessIntegerValue(TitleListPref, &PropertyValue, TitleCount); - - } else if (PropertyName == wxT("LANGUAGE")){ - - TitleListLanguage->erase(*TitleCount); - TitleListLanguage->insert(std::make_pair(*TitleCount, PropertyValue)); - - } else { + if (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty() && PropertyName != wxT("TYPE")){ + + if (FirstToken == TRUE){ - // Something else we don't know about so append - // to the tokens variable. + PropertyTokens.Append(PropertyName + wxT("=") + PropertyValue); + FirstToken = FALSE; - if (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty() && PropertyName != wxT("TYPE")){ + } else { - if (FirstToken == TRUE){ - - PropertyTokens.Append(PropertyName + wxT("=") + PropertyValue); - FirstToken = FALSE; - - } else { - - PropertyTokens.Append(wxT(";") + PropertyName + wxT("=") + PropertyValue); - - } + PropertyTokens.Append(wxT(";") + PropertyName + wxT("=") + PropertyValue); } - + } } @@ -3357,6 +3344,7 @@ void ContactDataObject::ProcessRole(wxString PropertySeg1, wxString PropertySeg2 } intPrevValue = 5; + bool PropertyMatched = FALSE; for (std::map::iterator intiter = SplitPoints.begin(); intiter != SplitPoints.end(); ++intiter){ @@ -3390,47 +3378,33 @@ void ContactDataObject::ProcessRole(wxString PropertySeg1, wxString PropertySeg2 CaptureString(&PropertyValue, FALSE); - if (PropertyName == wxT("ALTID")){ - - RoleListAltID->erase(*RoleCount); - RoleListAltID->insert(std::make_pair(*RoleCount, PropertyValue)); + ProcessStringValue(&PropertyName, "ALTID", RoleListAltID, &PropertyValue, RoleCount, &PropertyMatched); + ProcessStringValue(&PropertyName, "PID", RoleListPID, &PropertyValue, RoleCount, &PropertyMatched); + ProcessStringValue(&PropertyName, "LANGUAGE", RoleListLanguage, &PropertyValue, RoleCount, &PropertyMatched); + ProcessIntegerValue(&PropertyName, "PREF", RoleListPref, &PropertyValue, RoleCount, &PropertyMatched); - } else if (PropertyName == wxT("PID")){ - - RoleListPID->erase(*RoleCount); - RoleListPID->insert(std::make_pair(*RoleCount, PropertyValue)); + if (PropertyMatched == TRUE){ - } else if (PropertyName == wxT("PREF")){ - - ProcessIntegerValue(RoleListPref, &PropertyValue, RoleCount); - - } else if (PropertyName == wxT("LANGUAGE")){ + PropertyMatched = FALSE; + continue; - RoleListLanguage->erase(*RoleCount); - RoleListLanguage->insert(std::make_pair(*RoleCount, PropertyValue)); + } - } else { + if (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty() && PropertyName != wxT("TYPE")){ + + if (FirstToken == TRUE){ - // Something else we don't know about so append - // to the tokens variable. + PropertyTokens.Append(PropertyName + wxT("=") + PropertyValue); + FirstToken = FALSE; - if (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty() && PropertyName != wxT("TYPE")){ + } else { - if (FirstToken == TRUE){ - - PropertyTokens.Append(PropertyName + wxT("=") + PropertyValue); - FirstToken = FALSE; - - } else { - - PropertyTokens.Append(wxT(";") + PropertyName + wxT("=") + PropertyValue); - - } + PropertyTokens.Append(wxT(";") + PropertyName + wxT("=") + PropertyValue); } - - } + } + } // Add the data to the General/Home/Work address variables.