wxString PropertyValue;
wxString PropertyTokens;
bool FirstToken = TRUE;
+ bool PropertyMatched = FALSE;
for (std::map<int, int>::iterator intiter = SplitPoints.begin();
intiter != SplitPoints.end(); ++intiter){
CaptureString(&PropertyValue, FALSE);
- if (PropertyName == wxT("ALTID")){
-
- TZListAltID->erase(*TimeZoneCount);
- TZListAltID->insert(std::make_pair(*TimeZoneCount, PropertyValue));
+ ProcessStringValue(&PropertyName, "ALTID", TZListAltID, &PropertyValue, TimeZoneCount, &PropertyMatched);
+ ProcessStringValue(&PropertyName, "PID", TZListPID, &PropertyValue, TimeZoneCount, &PropertyMatched);
+ ProcessStringValue(&PropertyName, "MEDIATYPE", TZListMediatype, &PropertyValue, TimeZoneCount, &PropertyMatched);
+ ProcessIntegerValue(&PropertyName, "PREF", TZListPref, &PropertyValue, TimeZoneCount, &PropertyMatched);
- } else if (PropertyName == wxT("PID")){
-
- TZListPID->erase(*TimeZoneCount);
- TZListPID->insert(std::make_pair(*TimeZoneCount, PropertyValue));
-
- } else if (PropertyName == wxT("PREF")){
-
- ProcessIntegerValue(TZListPref, &PropertyValue, TimeZoneCount);
+ if (PropertyMatched == TRUE){
- } else if (PropertyName == wxT("MEDIATYPE")){
-
- TZListMediatype->erase(*TimeZoneCount);
- TZListMediatype->insert(std::make_pair(*TimeZoneCount, PropertyValue));
+ PropertyMatched = FALSE;
+ continue;
+
+ }
- } 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);
}
-
+
}
}
int intPref = 0;
int intType = 0;
long ListCtrlIndex;
+ bool PropertyMatched = FALSE;
SplitValues(&PropertySeg1, &SplitPoints, &SplitLength, intPrevValue);
// Process properties.
- if (PropertyName == wxT("LABEL")){
+ ProcessStringValue(&PropertyName, "LABEL", AddressListLabel, &PropertyValue, AddressCount, &PropertyMatched);
+ ProcessStringValue(&PropertyName, "LANGUAGE", AddressListLang, &PropertyValue, AddressCount, &PropertyMatched);
+ ProcessStringValue(&PropertyName, "ALTID", AddressListAltID, &PropertyValue, AddressCount, &PropertyMatched);
+ ProcessStringValue(&PropertyName, "PID", AddressListPID, &PropertyValue, AddressCount, &PropertyMatched);
+ ProcessStringValue(&PropertyName, "GEO", AddressListGeo, &PropertyValue, AddressCount, &PropertyMatched);
+ ProcessStringValue(&PropertyName, "TZ", AddressListTimezone, &PropertyValue, AddressCount, &PropertyMatched);
+ ProcessStringValue(&PropertyName, "MEDIATYPE", AddressListMediatype, &PropertyValue, AddressCount, &PropertyMatched);
+ ProcessIntegerValue(&PropertyName, "PREF", AddressListPref, &PropertyValue, AddressCount, &PropertyMatched);
- AddressListLabel->erase(*AddressCount);
- AddressListLabel->insert(std::make_pair(*AddressCount, PropertyValue));
-
- } else if (PropertyName == wxT("LANGUAGE")){
-
- AddressListLang->erase(*AddressCount);
- AddressListLang->insert(std::make_pair(*AddressCount, PropertyValue));
-
- } else if (PropertyName == wxT("ALTID")){
-
- AddressListAltID->erase(*AddressCount);
- AddressListAltID->insert(std::make_pair(*AddressCount, PropertyValue));
-
- } else if (PropertyName == wxT("PID")){
-
- AddressListPID->erase(*AddressCount);
- AddressListPID->insert(std::make_pair(*AddressCount, PropertyValue));
-
- } else if (PropertyName == wxT("GEO")){
-
- AddressListGeo->erase(*AddressCount);
- AddressListGeo->insert(std::make_pair(*AddressCount, PropertyValue));
-
- } else if (PropertyName == wxT("TZ")){
-
- AddressListTimezone->erase(*AddressCount);
- AddressListTimezone->insert(std::make_pair(*AddressCount, PropertyValue));
+ if (PropertyMatched == TRUE){
- } else if (PropertyName == wxT("MEDIATYPE")){
-
- AddressListMediatype->erase(*AddressCount);
- AddressListMediatype->insert(std::make_pair(*AddressCount, PropertyValue));
+ PropertyMatched = FALSE;
+ continue;
- } else if (PropertyName == wxT("PREF")){
-
- ProcessIntegerValue(AddressListPref, &PropertyValue, AddressCount);
+ }
- } 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);
}
-
+
}
}