}
}
-
+
}
ResetSaveProcessData();
- // Process Label.
+ // Build the values for the ANNIVERSARY property.
+
+ // ALTID
+
+ if (!ContactEditorData.AnniversaryAltID.IsEmpty()){
- strValue3 = ContactEditorData.AnniversaryAltID;
+ wxString DataValue;
+ DataValue = ContactEditorData.AnniversaryAltID;
+
+ EscapeString(&DataValue, FALSE);
+
+ strValue3.Append("ALTID=");
+ strValue3.Append(DataValue);
+
+ boolValue2 = TRUE;
- if (!strValue3.IsEmpty()){
-
- strValue3.Trim();
- strValue3.Trim();
- boolValue2 = TRUE;
- strValue2.Append(wxT("ALTID=\"") + strValue3 + wxT("\""));
-
- boolValue = TRUE;
-
}
- //strValue3 = ContactData.Convert(GeneralAddressList, FALSE);
- //strValue2 =
+ // CALSCALE.
+
+ if (!ContactEditorData.AnniversaryCalScale.IsEmpty()){
- // Process Language.
+ wxString DataValue;
+ DataValue = ContactEditorData.AnniversaryCalScale;
- strValue3 = ContactEditorData.AnniversaryCalScale;
+ EscapeString(&DataValue, FALSE);
+
+ if (boolValue2 == TRUE){
+
+ strValue3.Append(";");
+
+ }
+
+ strValue3.Append("CALSCALE=");
+ strValue3.Append(DataValue);
+
+ boolValue2 = TRUE;
- if (!strValue3.IsEmpty()){
-
- strValue3.Trim();
- strValue3.Trim();
-
- if (boolValue2 == TRUE){
-
- strValue2.Append(wxT(";"));
-
- } else {
-
- boolValue2 = TRUE;
-
- }
-
- strValue2.Append(wxT("CALSCALE=") + strValue3);
-
- boolValue = TRUE;
-
}
- // Process Tokens.
+ // Extra tokens.
- strValue2 = ContactEditorData.AnniversaryTokens;
+ if (!ContactEditorData.AnniversaryTokens.IsEmpty()){
- // Deal with ANNIVERSARY.
+ wxString DataValue;
+ DataValue = ContactEditorData.AnniversaryTokens;
+
+ EscapeString(&DataValue, FALSE);
+
+ if (boolValue2 == TRUE){
+
+ strValue3.Append(";");
+
+ }
+
+ strValue3.Append(DataValue);
+
+ }
+
+ // Write the ANNIVERSARY property.
if (!txtAnniversary->IsEmpty()){
-
- strValue = txtAnniversary->GetValue();
-
- if (!strValue.IsEmpty() || !strValue2.IsEmpty()){
-
- if (!strValue2.IsEmpty()){
-
- EscapeString(&strValue2, FALSE);
- EscapeString(&strValue, FALSE);
-
- ContactData.AddRaw(wxT("ANNIVERSARY;VALUE=text;") + strValue2 + wxT(";"), strValue);
-
- } else {
-
- EscapeString(&strValue, FALSE);
-
- ContactData.AddRaw(wxT("ANNIVERSARY;VALUE=text"), strValue);
-
- }
-
- }
-
+
+ if (!txtAnniversary->GetValue().IsEmpty()){
+
+ strValue = txtAnniversary->GetValue();
+
+ if (!strValue3.IsEmpty()){
+
+ ContactData.AddRaw("ANNIVERSARY;VALUE=text;" + strValue3, strValue);
+
+ } else {
+
+ ContactData.AddRaw("ANNIVERSARY;VALUE=text", strValue);
+
+ }
+
+ }
+
} else {
-
+
// Look for T and replace data before this.
// Get Day, Month & Year.
}
- if (!FinalAnniversaryString.IsEmpty() || !strValue2.IsEmpty()){
+ if (!FinalAnniversaryString.IsEmpty() || !strValue3.IsEmpty()){
- if (!strValue2.IsEmpty()){
+ if (!strValue3.IsEmpty()){
EscapeString(&strValue2, FALSE);
EscapeString(&strValue, FALSE);
- ContactData.AddRaw(wxT("ANNIVERSARY") + strValue2 + wxT(";"), FinalAnniversaryString);
+ ContactData.AddRaw(wxT("ANNIVERSARY;") + strValue3, FinalAnniversaryString);
} else {
}
}
-
- }
+ }
+
// Setup the addresses (General, Home, Business).
- //intValue = GeneralAddressList.size();
ResetSaveProcessData();
-
+
for (std::map<int,wxString>::iterator iter = ContactEditorData.GeneralAddressList.begin();
iter != ContactEditorData.GeneralAddressList.end(); ++iter){
intValue2 = iter->first;
+ wxString strIMFinalValue = iter->second;
+
+ ProcessCaptureStrings(&strIMFinalValue);
+
+ if (ContactEditorData.GeneralIMListTypeInfo.find(iter->first) !=
+ ContactEditorData.GeneralIMListTypeInfo.end()){
+
+ std::map<int,wxString>::iterator DataTypeIter = ContactEditorData.GeneralIMListTypeInfo.find(iter->first);
+
+ strIMFinalValue.insert(0, ":");
+ strIMFinalValue.insert(0, DataTypeIter->second);
+
+ } else {
+
+ strIMFinalValue.insert(0, "none:");
+
+ }
+
// Process Alternative ID.
ProcessSaveData(wxT("IMPP"), &strValue2, &boolValue2, &boolValue,
- &iter, &ContactEditorData.GeneralIMList, &ContactData,
+ &iter, &strIMFinalValue, &ContactData,
wxT("ALTID"), &ContactEditorData.GeneralIMListAltID,
wxT("PID"), &ContactEditorData.GeneralIMListPID,
wxT("MEDIATYPE"), &ContactEditorData.GeneralIMListMediatype,
for (std::map<int,wxString>::iterator iter = ContactEditorData.HomeIMList.begin();
iter != ContactEditorData.HomeIMList.end(); ++iter){
+ wxString strIMFinalValue = iter->second;
+
+ ProcessCaptureStrings(&strIMFinalValue);
+
+ if (ContactEditorData.HomeIMListTypeInfo.find(iter->first) !=
+ ContactEditorData.HomeIMListTypeInfo.end()){
+
+ std::map<int,wxString>::iterator DataTypeIter = ContactEditorData.HomeIMListTypeInfo.find(iter->first);
+
+ strIMFinalValue.insert(0, ":");
+ strIMFinalValue.insert(0, DataTypeIter->second);
+
+ } else {
+
+ strIMFinalValue.insert(0, "none:");
+
+ }
+
ProcessSaveData(wxT("IMPP;TYPE=home"), &strValue2, &boolValue2, &boolValue,
&iter, &ContactEditorData.HomeIMList, &ContactData,
wxT("ALTID"), &ContactEditorData.HomeIMListAltID,
for (std::map<int,wxString>::iterator iter = ContactEditorData.BusinessIMList.begin();
iter != ContactEditorData.BusinessIMList.end(); ++iter){
+ wxString strIMFinalValue = iter->second;
+
+ ProcessCaptureStrings(&strIMFinalValue);
+
+ if (ContactEditorData.BusinessIMListTypeInfo.find(iter->first) !=
+ ContactEditorData.BusinessIMListTypeInfo.end()){
+
+ std::map<int,wxString>::iterator DataTypeIter = ContactEditorData.BusinessIMListTypeInfo.find(iter->first);
+
+ strIMFinalValue.insert(0, ":");
+ strIMFinalValue.insert(0, DataTypeIter->second);
+
+ } else {
+
+ strIMFinalValue.insert(0, "none:");
+
+ }
+
ProcessSaveData(wxT("IMPP;TYPE=work"), &strValue2, &boolValue2, &boolValue,
&iter, &ContactEditorData.BusinessIMList, &ContactData,
wxT("ALTID"), &ContactEditorData.BusinessIMListAltID,
iter != ContactEditorData.GeneralTelephoneList.end(); ++iter){
wxString strAddressFinalValue = iter->second;
+ int DataID = iter->first;
ProcessCaptureStrings(&strAddressFinalValue);
- if (ContactEditorData.GeneralTelephoneListDataType.find(iter->first) !=
- ContactEditorData.GeneralTelephoneListDataType.end()){
+ if (MapDataExists(&DataID, &ContactEditorData.GeneralTelephoneListDataType)){
std::map<int,wxString>::iterator DataTypeIter = ContactEditorData.GeneralTelephoneListDataType.find(iter->first);
}
+ wxString strAddressTypeInfo;
+
+ if (MapDataExists(&DataID, &ContactEditorData.GeneralTelephoneListTypeInfo)){
+
+ strAddressTypeInfo = ContactEditorData.GeneralTelephoneListTypeInfo.find(iter->first)->second;
+
+ }
+
ProcessSaveData(wxT("TEL"), &strValue2, &boolValue2, &boolValue,
&iter, &strAddressFinalValue, &ContactData,
wxT("ALTID"), &ContactEditorData.GeneralTelephoneListAltID,
wxT("PID"), &ContactEditorData.GeneralTelephoneListPID,
- wxT("TYPE"), &ContactEditorData.GeneralTelephoneListType,
+ wxT("TYPE"), &ContactEditorData.GeneralTelephoneListTypeInfo,
wxT("PREF"), &ContactEditorData.GeneralTelephoneListPref,
wxT(""), &ContactEditorData.GeneralTelephoneListTokens );
strAddressFinalValue.insert(0, "tel:");
}
-
+
ProcessSaveData(wxT("TEL"), &strValue2, &boolValue2, &boolValue,
&iter, &strAddressFinalValue, &ContactData,
wxT("ALTID"), &ContactEditorData.HomeTelephoneListAltID,
wxT("PID"), &ContactEditorData.HomeTelephoneListPID,
- wxT("TYPE"), &ContactEditorData.HomeTelephoneListType,
+ wxT("TYPE"), &ContactEditorData.HomeTelephoneListTypeInfo,
wxT("PREF"), &ContactEditorData.HomeTelephoneListPref,
wxT(""), &ContactEditorData.HomeTelephoneListTokens );
strAddressFinalValue.insert(0, "tel:");
}
-
+
ProcessSaveData(wxT("TEL"), &strValue2, &boolValue2, &boolValue,
&iter, &strAddressFinalValue, &ContactData,
wxT("ALTID"), &ContactEditorData.BusinessTelephoneListAltID,
wxT("PID"), &ContactEditorData.BusinessTelephoneListPID,
- wxT("TYPE"), &ContactEditorData.BusinessTelephoneListType,
+ wxT("TYPE"), &ContactEditorData.BusinessTelephoneListTypeInfo,
wxT("PREF"), &ContactEditorData.BusinessTelephoneListPref,
wxT(""), &ContactEditorData.BusinessTelephoneListTokens );