[Winmerge-svn] SF.net SVN: winmerge:[5873] branches/R2_10
Windows visual diff and merge for files and directories
Brought to you by:
christianlist,
grimmdp
From: <ki...@us...> - 2008-09-01 19:24:45
|
Revision: 5873 http://winmerge.svn.sourceforge.net/winmerge/?rev=5873&view=rev Author: kimmov Date: 2008-09-01 19:24:42 +0000 (Mon, 01 Sep 2008) Log Message: ----------- PATCH: [ 1979321 ] Plugins: Show processing instructions in XML files Submitted by Marco De Paoli Commit actual code changes, previous commit contained only project changes. Modified Paths: -------------- branches/R2_10/Plugins/dlls/DisplayXMLFiles.dll branches/R2_10/Plugins/src_VCPP/DisplayXMLFiles/DisplayXMLFiles.rc branches/R2_10/Plugins/src_VCPP/DisplayXMLFiles/WinMergeScript.cpp branches/R2_10/Plugins/src_VCPP/DisplayXMLFiles/typeinfoex.h branches/R2_10/Src/ExpatMapLib/expat_maps.cpp Modified: branches/R2_10/Plugins/src_VCPP/DisplayXMLFiles/DisplayXMLFiles.rc =================================================================== --- branches/R2_10/Plugins/src_VCPP/DisplayXMLFiles/DisplayXMLFiles.rc 2008-09-01 17:50:37 UTC (rev 5872) +++ branches/R2_10/Plugins/src_VCPP/DisplayXMLFiles/DisplayXMLFiles.rc 2008-09-01 19:24:42 UTC (rev 5873) @@ -54,8 +54,8 @@ // VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,1,0,0 - PRODUCTVERSION 1,1,0,0 + FILEVERSION 1,1,1,0 + PRODUCTVERSION 1,1,1,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -73,7 +73,7 @@ VALUE "Comments", "WinMerge plugin\0" VALUE "CompanyName", "\0" VALUE "FileDescription", "DisplayXMLFiles Module\0" - VALUE "FileVersion", "1, 1, 0, 0\0" + VALUE "FileVersion", "1, 1, 1, 0\0" VALUE "InternalName", "DisplayXMLFiles\0" VALUE "LegalCopyright", "Copyright 2003-2008\0" VALUE "LegalTrademarks", "\0" @@ -81,7 +81,7 @@ VALUE "OriginalFilename", "DisplayXMLFiles.DLL\0" VALUE "PrivateBuild", "\0" VALUE "ProductName", "DisplayXMLFiles Module\0" - VALUE "ProductVersion", "1, 1, 0, 0\0" + VALUE "ProductVersion", "1, 1, 1, 0\0" VALUE "SpecialBuild", "\0" END END Modified: branches/R2_10/Plugins/src_VCPP/DisplayXMLFiles/WinMergeScript.cpp =================================================================== --- branches/R2_10/Plugins/src_VCPP/DisplayXMLFiles/WinMergeScript.cpp 2008-09-01 17:50:37 UTC (rev 5872) +++ branches/R2_10/Plugins/src_VCPP/DisplayXMLFiles/WinMergeScript.cpp 2008-09-01 19:24:42 UTC (rev 5873) @@ -214,12 +214,26 @@ static void XMLCALL ProcessingInstructionHandler(void *userData, const char *target, const char *data) { CXMLData *pData = (CXMLData*)userData; - // Not yet implemented + + // End the previous element if needed + if (pData->bNeedsEnding) + { + fprintf(pData->pOutput,">\n"); + pData->bNeedsEnding = false; + } + + // Indent + for (int i = 0; i < pData->iDepth; i++) + { + fprintf(pData->pOutput,"\t"); + } + + // Output processing instruction + fprintf(pData->pOutput, "<?%s %s?>\n", target, data); } static void XMLCALL CommentHandler(void *userData, const char *data) { - int i; CXMLData *pData = (CXMLData*)userData; // End the previous element if needed @@ -230,7 +244,7 @@ } // Indent - for (i = 0; i < pData->iDepth; i++) + for (int i = 0; i < pData->iDepth; i++) { fprintf(pData->pOutput,"\t"); } @@ -285,7 +299,7 @@ XML_SetUserData(parser, &oData); XML_SetElementHandler(parser, StartElementHandler, EndElementHandler); XML_SetDefaultHandler(parser, DefaultHandler); - //XML_SetProcessingInstructionHandler(parser, ProcessingInstructionHandler); + XML_SetProcessingInstructionHandler(parser, ProcessingInstructionHandler); XML_SetCommentHandler(parser, CommentHandler); XML_SetXmlDeclHandler(parser, XmlDeclHandler); XML_SetUnknownEncodingHandler(parser, WinMerge_Plug_UnknownEncodingHandler, this); Modified: branches/R2_10/Plugins/src_VCPP/DisplayXMLFiles/typeinfoex.h =================================================================== --- branches/R2_10/Plugins/src_VCPP/DisplayXMLFiles/typeinfoex.h 2008-09-01 17:50:37 UTC (rev 5872) +++ branches/R2_10/Plugins/src_VCPP/DisplayXMLFiles/typeinfoex.h 2008-09-01 19:24:42 UTC (rev 5873) @@ -89,7 +89,8 @@ for (int i=0; i<(int)cNames; i++) { int n = ocslen(rgszNames[i]); - for (int j=m_nCount-1; j>=0; j--) + int j; + for (j=m_nCount-1; j>=0; j--) { if ((n == m_pMap[j].nLen) && (memcmp(m_pMap[j].bstr, rgszNames[i], m_pMap[j].nLen * sizeof(OLECHAR)) == 0)) Modified: branches/R2_10/Src/ExpatMapLib/expat_maps.cpp =================================================================== --- branches/R2_10/Src/ExpatMapLib/expat_maps.cpp 2008-09-01 17:50:37 UTC (rev 5872) +++ branches/R2_10/Src/ExpatMapLib/expat_maps.cpp 2008-09-01 19:24:42 UTC (rev 5873) @@ -137,7 +137,7 @@ } } // Lets allow any encoding at all, and provide ISO-8859-1 map - for (i=0; i<256; ++i) + for (int i=0; i<256; ++i) { // i->i gives us identity for ASCII, and ISO-8859-1 for remainder // because Unicode character set is numbered exactly like ISO-8859-1 @@ -158,7 +158,7 @@ info->map[i] = (i<127 ? i : 0); } // Populate code bytes as given in our map table - for (i=0; mapinfo->mapdata[i] != -1; i += 2) + for (int i=0; mapinfo->mapdata[i] != -1; i += 2) { int src = mapinfo->mapdata[i]; int dest = mapinfo->mapdata[i+1]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |