X-Git-Url: http://Server1/repobrowser/?p=xestiaab%2F.git;a=blobdiff_plain;f=source%2Fcontacteditor%2FContactDataObject.cpp;h=66f42594d4daccf647c123e2dfc6f471d6b451e6;hp=b9035ed311aa7004c4d2572539450f2df62418dd;hb=17d33f5a39d1b64be75d308a78467290e96b7e38;hpb=db50ff1e15d18ad7e4451279f91086cc4d6050c5 diff --git a/source/contacteditor/ContactDataObject.cpp b/source/contacteditor/ContactDataObject.cpp index b9035ed..66f4259 100644 --- a/source/contacteditor/ContactDataObject.cpp +++ b/source/contacteditor/ContactDataObject.cpp @@ -79,6 +79,7 @@ ContactLoadStatus ContactDataObject::LoadFile(wxString Filename){ bool BirthdayProcessed = FALSE; bool AnniversaryProcessed = FALSE; bool UIDProcessed = FALSE; + bool RevisionProcessed = FALSE; int ContactLineLen = 0; int QuoteBreakPoint = 0; int SourceCount = 0; @@ -226,6 +227,11 @@ ContactLoadStatus ContactDataObject::LoadFile(wxString Filename){ ProcessXML(PropertySeg1, PropertySeg2, &XMLCount); XMLCount++; + } else if (Property == wxT("REV") && RevisionProcessed == FALSE){ + + ProcessRevision(PropertySeg1, PropertySeg2); + RevisionProcessed = TRUE; + } else if (Property == wxT("MEMBER")){ ProcessMember(PropertySeg1, PropertySeg2, &GroupCount); @@ -447,6 +453,85 @@ void ContactDataObject::ProcessKind(wxString KindType){ } +void ContactDataObject::ProcessRevision(wxString PropertySeg1, wxString PropertySeg2){ + + size_t intPropertyLen = PropertySeg1.Len(); + std::map SplitPoints; + std::map SplitLength; + std::map::iterator SLiter; + wxString PropertyData; + wxString PropertyName; + wxString PropertyValue; + wxString PropertyTokens; + bool FirstToken = TRUE; + int intSplitsFound = 0; + int intSplitSize = 0; + int intPrevValue = 5; + int intPref = 0; + int intType = 0; + + SplitValues(&PropertySeg1, &SplitPoints, &SplitLength, intPrevValue); + + intPrevValue = 4; + + for (std::map::iterator intiter = SplitPoints.begin(); + intiter != SplitPoints.end(); ++intiter){ + + SLiter = SplitLength.find(intiter->first); + + PropertyData = PropertySeg1.Mid(intPrevValue, (SLiter->second)); + + wxStringTokenizer PropertyElement (PropertyData, wxT("=")); + PropertyName = PropertyElement.GetNextToken(); + PropertyValue = PropertyElement.GetNextToken(); + + intPrevValue = intiter->second; + + // Process properties. + + size_t intPropertyValueLen = PropertyValue.Len(); + + if (PropertyValue.Mid((intPropertyValueLen - 1), 1) == wxT("\"")){ + + PropertyValue.Trim(); + PropertyValue.RemoveLast(); + + } + + if (PropertyValue.Mid(0, 1) == wxT("\"")){ + + PropertyValue.Remove(0, 1); + + } + + CaptureString(&PropertyValue, FALSE); + + if (FirstToken == TRUE){ + + PropertyTokens.Append(PropertyName + wxT("=") + PropertyValue); + FirstToken = FALSE; + + } else { + + PropertyTokens.Append(wxT(";") + PropertyName + wxT("=") + PropertyValue); + + } + + } + + CaptureString(&PropertySeg2, FALSE); + + Revision = PropertySeg2; + + if (!PropertyTokens.IsEmpty()){ + + RevisionTokens = PropertyTokens; + + } + + +} + void ContactDataObject::ProcessSource(wxString PropertySeg1, wxString PropertySeg2, int *SourceCount){ size_t intPropertyLen = PropertySeg1.Len();