X-Git-Url: http://Server1/repobrowser/?a=blobdiff_plain;f=source%2Fcontacteditor%2FContactDataObject.cpp;h=cba012d203e72e94539da814a01a01e773e902fd;hb=097d1f80669c0a3f88cc9867e8fee80e48f3890f;hp=ddb6a573c0dad0532ed314662467c390f69e5b29;hpb=fc09ab48fbdbbe77b63ce30e051b3118eb006f0b;p=xestiaab%2F.git diff --git a/source/contacteditor/ContactDataObject.cpp b/source/contacteditor/ContactDataObject.cpp index ddb6a57..cba012d 100644 --- a/source/contacteditor/ContactDataObject.cpp +++ b/source/contacteditor/ContactDataObject.cpp @@ -511,17 +511,8 @@ void ContactDataObject::ProcessRevision(wxString PropertySeg1, wxString Property } CaptureString(&PropertyValue, FALSE); - - if (FirstToken == TRUE){ - - PropertyTokens.Append(PropertyName + wxT("=") + PropertyValue); - FirstToken = FALSE; - - } else { - - PropertyTokens.Append(wxT(";") + PropertyName + wxT("=") + PropertyValue); - - } + + ProcessTokens(&PropertyName, &PropertyValue, &PropertyTokens, &FirstToken); } @@ -612,20 +603,7 @@ void ContactDataObject::ProcessSource(wxString PropertySeg1, wxString PropertySe } - if (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty() && PropertyName != wxT("TYPE")){ - - if (FirstToken == TRUE){ - - PropertyTokens.Append(PropertyName + wxT("=") + PropertyValue); - FirstToken = FALSE; - - } else { - - PropertyTokens.Append(wxT(";") + PropertyName + wxT("=") + PropertyValue); - - } - - } + ProcessTokens(&PropertyName, &PropertyValue, &PropertyTokens, &FirstToken); } @@ -760,20 +738,7 @@ void ContactDataObject::ProcessMember(wxString PropertySeg1, wxString PropertySe } - if (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty()){ - - if (FirstToken == TRUE){ - - PropertyTokens.Append(PropertyName + wxT("=") + PropertyValue); - FirstToken = FALSE; - - } else { - - PropertyTokens.Append(wxT(";") + PropertyName + wxT("=") + PropertyValue); - - } - - } + ProcessTokens(&PropertyName, &PropertyValue, &PropertyTokens, &FirstToken); } @@ -850,20 +815,7 @@ void ContactDataObject::ProcessFN(wxString PropertySeg1, wxString PropertySeg2, } - if (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty()){ - - if (FirstToken == TRUE){ - - PropertyTokens.Append(PropertyName + wxT("=") + PropertyValue); - FirstToken = FALSE; - - } else { - - PropertyTokens.Append(wxT(";") + PropertyName + wxT("=") + PropertyValue); - - } - - } + ProcessTokens(&PropertyName, &PropertyValue, &PropertyTokens, &FirstToken); } @@ -929,16 +881,7 @@ void ContactDataObject::ProcessN(wxString PropertySeg1, wxString PropertySeg2){ } else if (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty()){ - if (FirstToken == TRUE){ - - PropertyTokens.Append(PropertyName + wxT("=") + PropertyValue); - FirstToken = FALSE; - - } else { - - PropertyTokens.Append(wxT(";") + PropertyName + wxT("=") + PropertyValue); - - } + ProcessTokens(&PropertyName, &PropertyValue, &PropertyTokens, &FirstToken); } @@ -1070,20 +1013,7 @@ void ContactDataObject::ProcessClientPIDMap(wxString PropertySeg1, wxString Prop CaptureString(&PropertyValue, FALSE); - if (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty()){ - - if (FirstToken == TRUE){ - - PropertyTokens.Append(PropertyName + wxT("=") + PropertyValue); - FirstToken = FALSE; - - } else { - - PropertyTokens.Append(wxT(";") + PropertyName + wxT("=") + PropertyValue); - - } - - } + ProcessTokens(&PropertyName, &PropertyValue, &PropertyTokens, &FirstToken); } @@ -1192,20 +1122,7 @@ void ContactDataObject::ProcessNickname(wxString PropertySeg1, wxString Property } - if (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty() && PropertyName != wxT("TYPE")){ - - if (FirstToken == TRUE){ - - PropertyTokens.Append(PropertyName + wxT("=") + PropertyValue); - FirstToken = FALSE; - - } else { - - PropertyTokens.Append(wxT(";") + PropertyName + wxT("=") + PropertyValue); - - } - - } + ProcessTokens(&PropertyName, &PropertyValue, &PropertyTokens, &FirstToken); } @@ -1267,20 +1184,7 @@ void ContactDataObject::ProcessGender(wxString PropertySeg1, wxString PropertySe } - if (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty()){ - - if (FirstToken == TRUE){ - - PropertyTokens.Append(PropertyName + wxT("=") + PropertyValue); - FirstToken = FALSE; - - } else { - - PropertyTokens.Append(wxT(";") + PropertyName + wxT("=") + PropertyValue); - - } - - } + ProcessTokens(&PropertyName, &PropertyValue, &PropertyTokens, &FirstToken); } @@ -1400,20 +1304,7 @@ void ContactDataObject::ProcessBirthday(wxString PropertySeg1, wxString Property // Something else we don't know about so append // to the tokens variable. - if (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty()){ - - if (FirstToken == TRUE){ - - PropertyTokens.Append(PropertyName + wxT("=") + PropertyValue); - FirstToken = FALSE; - - } else { - - PropertyTokens.Append(wxT(";") + PropertyName + wxT("=") + PropertyValue); - - } - - } + ProcessTokens(&PropertyName, &PropertyValue, &PropertyTokens, &FirstToken); } @@ -1526,20 +1417,7 @@ void ContactDataObject::ProcessAnniversary(wxString PropertySeg1, wxString Prope // Something else we don't know about so append // to the tokens variable. - if (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty()){ - - if (FirstToken == TRUE){ - - PropertyTokens.Append(PropertyName + wxT("=") + PropertyValue); - FirstToken = FALSE; - - } else { - - PropertyTokens.Append(wxT(";") + PropertyName + wxT("=") + PropertyValue); - - } - - } + ProcessTokens(&PropertyName, &PropertyValue, &PropertyTokens, &FirstToken); } @@ -1656,16 +1534,7 @@ void ContactDataObject::ProcessTimeZone(wxString PropertySeg1, wxString Property if (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty() && PropertyName != wxT("TYPE")){ - if (FirstToken == TRUE){ - - PropertyTokens.Append(PropertyName + wxT("=") + PropertyValue); - FirstToken = FALSE; - - } else { - - PropertyTokens.Append(wxT(";") + PropertyName + wxT("=") + PropertyValue); - - } + ProcessTokens(&PropertyName, &PropertyValue, &PropertyTokens, &FirstToken); } @@ -1837,20 +1706,7 @@ void ContactDataObject::ProcessAddress(wxString PropertySeg1, wxString PropertyS } - if (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty() && PropertyName != wxT("TYPE")){ - - if (FirstToken == TRUE){ - - PropertyTokens.Append(PropertyName + wxT("=") + PropertyValue); - FirstToken = FALSE; - - } else { - - PropertyTokens.Append(wxT(";") + PropertyName + wxT("=") + PropertyValue); - - } - - } + ProcessTokens(&PropertyName, &PropertyValue, &PropertyTokens, &FirstToken); } @@ -2086,20 +1942,7 @@ void ContactDataObject::ProcessEmail(wxString PropertySeg1, wxString PropertySeg } - if (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty() && PropertyName != wxT("TYPE")){ - - if (FirstToken == TRUE){ - - PropertyTokens.Append(PropertyName + wxT("=") + PropertyValue); - FirstToken = FALSE; - - } else { - - PropertyTokens.Append(wxT(";") + PropertyName + wxT("=") + PropertyValue); - - } - - } + ProcessTokens(&PropertyName, &PropertyValue, &PropertyTokens, &FirstToken); } @@ -2211,20 +2054,7 @@ void ContactDataObject::ProcessIM(wxString PropertySeg1, wxString PropertySeg2, } - if (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty() && PropertyName != wxT("TYPE")){ - - if (FirstToken == TRUE){ - - PropertyTokens.Append(PropertyName + wxT("=") + PropertyValue); - FirstToken = FALSE; - - } else { - - PropertyTokens.Append(wxT(";") + PropertyName + wxT("=") + PropertyValue); - - } - - } + ProcessTokens(&PropertyName, &PropertyValue, &PropertyTokens, &FirstToken); } @@ -2500,20 +2330,7 @@ void ContactDataObject::ProcessTelephone(wxString PropertySeg1, wxString Propert } - if (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty() && PropertyName != wxT("TYPE")){ - - if (FirstToken == TRUE){ - - PropertyTokens.Append(PropertyName + wxT("=") + PropertyValue); - FirstToken = FALSE; - - } else { - - PropertyTokens.Append(wxT(";") + PropertyName + wxT("=") + PropertyValue); - - } - - } + ProcessTokens(&PropertyName, &PropertyValue, &PropertyTokens, &FirstToken); } @@ -2620,20 +2437,7 @@ void ContactDataObject::ProcessLanguage(wxString PropertySeg1, wxString Property } - if (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty() && PropertyName != wxT("TYPE")){ - - if (FirstToken == TRUE){ - - PropertyTokens.Append(PropertyName + wxT("=") + PropertyValue); - FirstToken = FALSE; - - } else { - - PropertyTokens.Append(wxT(";") + PropertyName + wxT("=") + PropertyValue); - - } - - } + ProcessTokens(&PropertyName, &PropertyValue, &PropertyTokens, &FirstToken); } @@ -2744,20 +2548,7 @@ void ContactDataObject::ProcessGeographic(wxString PropertySeg1, wxString Proper } - if (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty() && PropertyName != wxT("TYPE")){ - - if (FirstToken == TRUE){ - - PropertyTokens.Append(PropertyName + wxT("=") + PropertyValue); - FirstToken = FALSE; - - } else { - - PropertyTokens.Append(wxT(";") + PropertyName + wxT("=") + PropertyValue); - - } - - } + ProcessTokens(&PropertyName, &PropertyValue, &PropertyTokens, &FirstToken); } @@ -2956,20 +2747,7 @@ void ContactDataObject::ProcessRelated(wxString PropertySeg1, wxString PropertyS } - if (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty() && PropertyName != wxT("TYPE")){ - - if (FirstToken == TRUE){ - - PropertyTokens.Append(PropertyName + wxT("=") + PropertyValue); - FirstToken = FALSE; - - } else { - - PropertyTokens.Append(wxT(";") + PropertyName + wxT("=") + PropertyValue); - - } - - } + ProcessTokens(&PropertyName, &PropertyValue, &PropertyTokens, &FirstToken); } @@ -3100,20 +2878,7 @@ void ContactDataObject::ProcessURL(wxString PropertySeg1, wxString PropertySeg2, } - if (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty() && PropertyName != wxT("TYPE")){ - - if (FirstToken == TRUE){ - - PropertyTokens.Append(PropertyName + wxT("=") + PropertyValue); - FirstToken = FALSE; - - } else { - - PropertyTokens.Append(wxT(";") + PropertyName + wxT("=") + PropertyValue); - - } - - } + ProcessTokens(&PropertyName, &PropertyValue, &PropertyTokens, &FirstToken); } @@ -3245,20 +3010,7 @@ void ContactDataObject::ProcessTitle(wxString PropertySeg1, wxString PropertySeg } - if (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty() && PropertyName != wxT("TYPE")){ - - if (FirstToken == TRUE){ - - PropertyTokens.Append(PropertyName + wxT("=") + PropertyValue); - FirstToken = FALSE; - - } else { - - PropertyTokens.Append(wxT(";") + PropertyName + wxT("=") + PropertyValue); - - } - - } + ProcessTokens(&PropertyName, &PropertyValue, &PropertyTokens, &FirstToken); } @@ -3390,20 +3142,7 @@ void ContactDataObject::ProcessRole(wxString PropertySeg1, wxString PropertySeg2 } - if (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty() && PropertyName != wxT("TYPE")){ - - if (FirstToken == TRUE){ - - PropertyTokens.Append(PropertyName + wxT("=") + PropertyValue); - FirstToken = FALSE; - - } else { - - PropertyTokens.Append(wxT(";") + PropertyName + wxT("=") + PropertyValue); - - } - - } + ProcessTokens(&PropertyName, &PropertyValue, &PropertyTokens, &FirstToken); } @@ -3540,20 +3279,7 @@ void ContactDataObject::ProcessOrganisation(wxString PropertySeg1, wxString Prop } - if (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty() && PropertyName != wxT("TYPE")){ - - if (FirstToken == TRUE){ - - PropertyTokens.Append(PropertyName + wxT("=") + PropertyValue); - FirstToken = FALSE; - - } else { - - PropertyTokens.Append(wxT(";") + PropertyName + wxT("=") + PropertyValue); - - } - - } + ProcessTokens(&PropertyName, &PropertyValue, &PropertyTokens, &FirstToken); } @@ -3685,20 +3411,7 @@ void ContactDataObject::ProcessNote(wxString PropertySeg1, wxString PropertySeg2 } - if (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty() && PropertyName != wxT("TYPE")){ - - if (FirstToken == TRUE){ - - PropertyTokens.Append(PropertyName + wxT("=") + PropertyValue); - FirstToken = FALSE; - - } else { - - PropertyTokens.Append(wxT(";") + PropertyName + wxT("=") + PropertyValue); - - } - - } + ProcessTokens(&PropertyName, &PropertyValue, &PropertyTokens, &FirstToken); } @@ -3801,20 +3514,7 @@ void ContactDataObject::ProcessCategory(wxString PropertySeg1, wxString Property } - if (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty() && PropertyName != wxT("TYPE")){ - - if (FirstToken == TRUE){ - - PropertyTokens.Append(PropertyName + wxT("=") + PropertyValue); - FirstToken = FALSE; - - } else { - - PropertyTokens.Append(wxT(";") + PropertyName + wxT("=") + PropertyValue); - - } - - } + ProcessTokens(&PropertyName, &PropertyValue, &PropertyTokens, &FirstToken); } @@ -4061,20 +3761,7 @@ void ContactDataObject::ProcessPhoto(wxString PropertySeg1, wxString PropertySeg } - if (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty() && PropertyName != wxT("TYPE")){ - - if (FirstToken == TRUE){ - - PropertyTokens.Append(PropertyName + wxT("=") + PropertyValue); - FirstToken = FALSE; - - } else { - - PropertyTokens.Append(wxT(";") + PropertyName + wxT("=") + PropertyValue); - - } - - } + ProcessTokens(&PropertyName, &PropertyValue, &PropertyTokens, &FirstToken); } @@ -4249,20 +3936,7 @@ void ContactDataObject::ProcessLogo(wxString PropertySeg1, wxString PropertySeg2 } - if (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty() && PropertyName != wxT("TYPE")){ - - if (FirstToken == TRUE){ - - PropertyTokens.Append(PropertyName + wxT("=") + PropertyValue); - FirstToken = FALSE; - - } else { - - PropertyTokens.Append(wxT(";") + PropertyName + wxT("=") + PropertyValue); - - } - - } + ProcessTokens(&PropertyName, &PropertyValue, &PropertyTokens, &FirstToken); } @@ -4438,20 +4112,7 @@ void ContactDataObject::ProcessSound(wxString PropertySeg1, wxString PropertySeg } - if (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty() && PropertyName != wxT("TYPE")){ - - if (FirstToken == TRUE){ - - PropertyTokens.Append(PropertyName + wxT("=") + PropertyValue); - FirstToken = FALSE; - - } else { - - PropertyTokens.Append(wxT(";") + PropertyName + wxT("=") + PropertyValue); - - } - - } + ProcessTokens(&PropertyName, &PropertyValue, &PropertyTokens, &FirstToken); } @@ -4626,20 +4287,7 @@ void ContactDataObject::ProcessCalendarURI(wxString PropertySeg1, wxString Prope } - if (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty() && PropertyName != wxT("TYPE")){ - - if (FirstToken == TRUE){ - - PropertyTokens.Append(PropertyName + wxT("=") + PropertyValue); - FirstToken = FALSE; - - } else { - - PropertyTokens.Append(wxT(";") + PropertyName + wxT("=") + PropertyValue); - - } - - } + ProcessTokens(&PropertyName, &PropertyValue, &PropertyTokens, &FirstToken); } @@ -4749,20 +4397,7 @@ void ContactDataObject::ProcessCalendarAddressURI(wxString PropertySeg1, wxStrin } - if (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty() && PropertyName != wxT("TYPE")){ - - if (FirstToken == TRUE){ - - PropertyTokens.Append(PropertyName + wxT("=") + PropertyValue); - FirstToken = FALSE; - - } else { - - PropertyTokens.Append(wxT(";") + PropertyName + wxT("=") + PropertyValue); - - } - - } + ProcessTokens(&PropertyName, &PropertyValue, &PropertyTokens, &FirstToken); } @@ -4872,20 +4507,7 @@ void ContactDataObject::ProcessCalendarFreeBusy(wxString PropertySeg1, wxString } - if (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty() && PropertyName != wxT("TYPE")){ - - if (FirstToken == TRUE){ - - PropertyTokens.Append(PropertyName + wxT("=") + PropertyValue); - FirstToken = FALSE; - - } else { - - PropertyTokens.Append(wxT(";") + PropertyName + wxT("=") + PropertyValue); - - } - - } + ProcessTokens(&PropertyName, &PropertyValue, &PropertyTokens, &FirstToken); } @@ -4993,20 +4615,7 @@ void ContactDataObject::ProcessKey(wxString PropertySeg1, wxString PropertySeg2, } - if (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty() && PropertyName != wxT("TYPE")){ - - if (FirstToken == TRUE){ - - PropertyTokens.Append(PropertyName + wxT("=") + PropertyValue); - FirstToken = FALSE; - - } else { - - PropertyTokens.Append(wxT(";") + PropertyName + wxT("=") + PropertyValue); - - } - - } + ProcessTokens(&PropertyName, &PropertyValue, &PropertyTokens, &FirstToken); } @@ -5161,14 +4770,14 @@ void ContactDataObject::ProcessVendor(wxString PropertySeg1, wxString PropertySe void ProcessTokens(wxString *PropertyName, wxString *PropertyValue, wxString *PropertyTokens, - bool FirstToken){ + bool *FirstToken){ if (!PropertyName->IsEmpty() && !PropertyValue->IsEmpty() && *PropertyName != wxT("TYPE")){ - if (FirstToken == TRUE){ + if (*FirstToken == TRUE){ PropertyTokens->Append(*PropertyName + wxT("=") + *PropertyValue); - FirstToken = FALSE; + *FirstToken = FALSE; } else {