X-Git-Url: http://Server1/repobrowser/?p=xestiaab%2F.git;a=blobdiff_plain;f=source%2Fcontacteditor%2FContactDataObject.cpp;h=bb85052fc83f827f383195a7061ae08827f43d48;hp=7531af086b52c0d412e7689a8eba9d5d9bbd2c67;hb=0eebe029ad2758d33667055f675320d75ba7c492;hpb=a45c3a46e4e37da415a8b8da2aaabe6a4abc4551 diff --git a/source/contacteditor/ContactDataObject.cpp b/source/contacteditor/ContactDataObject.cpp index 7531af0..bb85052 100644 --- a/source/contacteditor/ContactDataObject.cpp +++ b/source/contacteditor/ContactDataObject.cpp @@ -78,6 +78,7 @@ ContactLoadStatus ContactDataObject::LoadFile(wxString Filename){ bool GenderProcessed = FALSE; bool BirthdayProcessed = FALSE; bool AnniversaryProcessed = FALSE; + bool UIDProcessed = FALSE; int ContactLineLen = 0; int QuoteBreakPoint = 0; int GroupCount = 0; @@ -104,6 +105,8 @@ ContactLoadStatus ContactDataObject::LoadFile(wxString Filename){ int CalendarAddressCount = 0; int FreeBusyAddressCount = 0; int KeyCount = 0; + int VendorCount = 0; + int XTokenCount = 0; wxString ContactLine; wxString PropertyLine; wxString PropertySeg1; @@ -206,6 +209,11 @@ ContactLoadStatus ContactDataObject::LoadFile(wxString Filename){ ProcessKind(PropertySeg2); + } else if (Property == wxT("UID") && UIDProcessed == FALSE){ + + UIDToken = PropertySeg2; + UIDProcessed = TRUE; + } else if (Property == wxT("MEMBER")){ ProcessMember(PropertySeg1, PropertySeg2, &GroupCount); @@ -383,6 +391,17 @@ ContactLoadStatus ContactDataObject::LoadFile(wxString Filename){ ProcessKey(PropertySeg1, PropertySeg2, &KeyCount); KeyCount++; + } else if (Property.Mid(0, 3) == wxT("VND")){ + + ProcessVendor(PropertySeg1, PropertySeg2, &VendorCount); + VendorCount++; + + } else if (Property.Mid(0, 2) == wxT("X-")){ + + XTokenList.insert(std::make_pair(XTokenCount, PropertySeg2)); + XTokenListTokens.insert(std::make_pair(XTokenCount, PropertySeg1.Mid(2))); + XTokenCount++; + } } @@ -5436,6 +5455,41 @@ void ContactDataObject::ProcessKey(wxString PropertySeg1, wxString PropertySeg2, } +void ContactDataObject::ProcessVendor(wxString PropertySeg1, wxString PropertySeg2, int *VendorCount){ + + // Split the Vendor three ways. + + wxStringTokenizer wSTVendorDetails(PropertySeg1, wxT("-")); + + wxString wxSVNDID; + wxString wxSVNDPropName; + long ListCtrlIndex; + + while (wSTVendorDetails.HasMoreTokens() == TRUE){ + + wSTVendorDetails.GetNextToken(); + wxSVNDID = wSTVendorDetails.GetNextToken(); + wxSVNDPropName = wSTVendorDetails.GetNextToken(); + break; + + } + + if (!wxSVNDID.IsEmpty() && !wxSVNDPropName.IsEmpty()){ + + // Add the data to the vendor variables. + + VendorList.erase(*VendorCount); + VendorListPEN.erase(*VendorCount); + VendorListElement.erase(*VendorCount); + + VendorList.insert(std::make_pair(*VendorCount, PropertySeg2)); + VendorListPEN.insert(std::make_pair(*VendorCount, wxSVNDID)); + VendorListElement.insert(std::make_pair(*VendorCount, wxSVNDPropName)); + + } + +} + void SplitValues(wxString *PropertyLine, std::map *SplitPoints, std::map *SplitLength,