From: Steve Brokenshire Date: Sun, 6 Dec 2015 12:40:48 +0000 (+0000) Subject: Added vCard34Conv object for the input format conversion of vCard3 to work properly. X-Git-Tag: release-0.09~257 X-Git-Url: http://Server1/repobrowser/?a=commitdiff_plain;h=d5d06b2c4528b796f35c669aacab2dcef07438e2;p=xestiaab%2F.git Added vCard34Conv object for the input format conversion of vCard3 to work properly. --- diff --git a/source/convert.cpp b/source/convert.cpp index 0cfaa9f..1f19d97 100644 --- a/source/convert.cpp +++ b/source/convert.cpp @@ -136,9 +136,6 @@ ConvertResult ConvertContact(wxString InputFormat, wxString OutputFormat, if (vCard4Format.Get("VERSION") != "4.0"){ return CONVERTRESULT_INPUTFILEINVALIDFORMAT; } - - // No conversion needs to be as the card is already - // in the vCard 4.0 format. } else if (InputFormat == "vCard3"){ @@ -154,7 +151,15 @@ ConvertResult ConvertContact(wxString InputFormat, wxString OutputFormat, if (InputvCard.Get("VERSION") != "3.0"){ return CONVERTRESULT_INPUTFILEINVALIDFORMAT; } - + + vCard34Conv vCard34ConvObj; + + vCard vCard4Format; + + vCard34ConvObj.ConvertToV4(&InputFileData, &vCard4Format); + + FinalData = vCard4Format.WriteString(); + } // Convert the vCard into the required format and @@ -188,7 +193,8 @@ ConvertResult ConvertContact(wxString InputFormat, wxString OutputFormat, } else { // Write out the data to the console. - + + FinalData.Trim(); std::cout << FinalData << std::endl; }