X-Git-Url: http://Server1/repobrowser/?p=xestiaab%2F.git;a=blobdiff_plain;f=source%2Fcontacteditor%2FContactDataObject.cpp;h=54e0bfd1294367f85ff8c683258232f58b759b0b;hp=266a5e0eceda576864815d8774381b50d3e64821;hb=02c28b750d6eb441da1053646ca981a4a6473b75;hpb=5ab6af24eb42838438875f9c7af77210ccfa44a8 diff --git a/source/contacteditor/ContactDataObject.cpp b/source/contacteditor/ContactDataObject.cpp index 266a5e0..54e0bfd 100644 --- a/source/contacteditor/ContactDataObject.cpp +++ b/source/contacteditor/ContactDataObject.cpp @@ -74,6 +74,7 @@ ContactLoadStatus ContactDataObject::LoadFile(wxString Filename){ bool QuoteMode = FALSE; bool PropertyFind = TRUE; bool KindProcessed = FALSE; + bool NameProcessed = FALSE; int ContactLineLen = 0; int QuoteBreakPoint = 0; int GroupCount = 0; @@ -190,6 +191,11 @@ ContactLoadStatus ContactDataObject::LoadFile(wxString Filename){ ProcessFN(PropertySeg1, PropertySeg2, &FNCount); FNCount++; + } else if (Property == wxT("N") && NameProcessed == FALSE){ + + ProcessN(PropertySeg1, PropertySeg2); + NameProcessed = TRUE; + } } @@ -428,6 +434,57 @@ void ContactDataObject::ProcessFN(wxString PropertySeg1, wxString PropertySeg2, } +void ContactDataObject::ProcessN(wxString PropertySeg1, wxString PropertySeg2){ + + std::map SplitPoints; + std::map SplitLength; + + int intPrevValue = 3; + int intPref = 0; + int intType = 0; + + SplitValues(&PropertySeg1, &SplitPoints, &SplitLength, intPrevValue); + + intPrevValue = 2; + + NameForename = PropertySeg2; + + wxString PropertyName; + wxString PropertyValue; + wxString PropertyData; + wxString PropertyTokens; + std::map::iterator SLiter; + bool FirstToken = TRUE; + + 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; + + CaptureString(&PropertyValue, FALSE); + + if (PropertyName == wxT("ALTID")){ + + NameAltID = PropertyValue; + + } else if (PropertyName == wxT("LANGUAGE")){ + + NameLanguage = PropertyValue; + + } + + } + +} + void SplitValues(wxString *PropertyLine, std::map *SplitPoints, std::map *SplitLength,