OSDN Git Service

PATCH: [ 969667 ] Ignore positions/tabbed columns (plugins)
authorLaurent Ganier <laoran@users.sourceforge.net>
Sat, 12 Jun 2004 09:31:39 +0000 (09:31 +0000)
committerLaurent Ganier <laoran@users.sourceforge.net>
Sat, 12 Jun 2004 09:31:39 +0000 (09:31 +0000)
38 files changed:
Plugins/dlls/IgnoreColumns.dll [new file with mode: 0644]
Plugins/dlls/IgnoreFieldsComma.dll [new file with mode: 0644]
Plugins/dlls/IgnoreFieldsTab.dll [new file with mode: 0644]
Plugins/dlls/list.txt
Plugins/readme.txt
Plugins/src_VCPP/IgnoreColumns/IgnoreColumns.cpp [new file with mode: 0644]
Plugins/src_VCPP/IgnoreColumns/IgnoreColumns.def [new file with mode: 0644]
Plugins/src_VCPP/IgnoreColumns/IgnoreColumns.dsp [new file with mode: 0644]
Plugins/src_VCPP/IgnoreColumns/IgnoreColumns.idl [new file with mode: 0644]
Plugins/src_VCPP/IgnoreColumns/IgnoreColumns.rc [new file with mode: 0644]
Plugins/src_VCPP/IgnoreColumns/Resource.h [new file with mode: 0644]
Plugins/src_VCPP/IgnoreColumns/StdAfx.cpp [new file with mode: 0644]
Plugins/src_VCPP/IgnoreColumns/StdAfx.h [new file with mode: 0644]
Plugins/src_VCPP/IgnoreColumns/WinMergeScript.cpp [new file with mode: 0644]
Plugins/src_VCPP/IgnoreColumns/WinMergeScript.h [new file with mode: 0644]
Plugins/src_VCPP/IgnoreColumns/typeinfoex.h [new file with mode: 0644]
Plugins/src_VCPP/IgnoreFieldsComma/IgnoreFieldsComma.cpp [new file with mode: 0644]
Plugins/src_VCPP/IgnoreFieldsComma/IgnoreFieldsComma.def [new file with mode: 0644]
Plugins/src_VCPP/IgnoreFieldsComma/IgnoreFieldsComma.dsp [new file with mode: 0644]
Plugins/src_VCPP/IgnoreFieldsComma/IgnoreFieldsComma.idl [new file with mode: 0644]
Plugins/src_VCPP/IgnoreFieldsComma/IgnoreFieldsComma.rc [new file with mode: 0644]
Plugins/src_VCPP/IgnoreFieldsComma/Resource.h [new file with mode: 0644]
Plugins/src_VCPP/IgnoreFieldsComma/StdAfx.cpp [new file with mode: 0644]
Plugins/src_VCPP/IgnoreFieldsComma/StdAfx.h [new file with mode: 0644]
Plugins/src_VCPP/IgnoreFieldsComma/WinMergeScript.cpp [new file with mode: 0644]
Plugins/src_VCPP/IgnoreFieldsComma/WinMergeScript.h [new file with mode: 0644]
Plugins/src_VCPP/IgnoreFieldsComma/typeinfoex.h [new file with mode: 0644]
Plugins/src_VCPP/IgnoreFieldsTab/IgnoreFieldsTab.cpp [new file with mode: 0644]
Plugins/src_VCPP/IgnoreFieldsTab/IgnoreFieldsTab.def [new file with mode: 0644]
Plugins/src_VCPP/IgnoreFieldsTab/IgnoreFieldsTab.dsp [new file with mode: 0644]
Plugins/src_VCPP/IgnoreFieldsTab/IgnoreFieldsTab.idl [new file with mode: 0644]
Plugins/src_VCPP/IgnoreFieldsTab/IgnoreFieldsTab.rc [new file with mode: 0644]
Plugins/src_VCPP/IgnoreFieldsTab/Resource.h [new file with mode: 0644]
Plugins/src_VCPP/IgnoreFieldsTab/StdAfx.cpp [new file with mode: 0644]
Plugins/src_VCPP/IgnoreFieldsTab/StdAfx.h [new file with mode: 0644]
Plugins/src_VCPP/IgnoreFieldsTab/WinMergeScript.cpp [new file with mode: 0644]
Plugins/src_VCPP/IgnoreFieldsTab/WinMergeScript.h [new file with mode: 0644]
Plugins/src_VCPP/IgnoreFieldsTab/typeinfoex.h [new file with mode: 0644]

diff --git a/Plugins/dlls/IgnoreColumns.dll b/Plugins/dlls/IgnoreColumns.dll
new file mode 100644 (file)
index 0000000..7d51390
Binary files /dev/null and b/Plugins/dlls/IgnoreColumns.dll differ
diff --git a/Plugins/dlls/IgnoreFieldsComma.dll b/Plugins/dlls/IgnoreFieldsComma.dll
new file mode 100644 (file)
index 0000000..6e20347
Binary files /dev/null and b/Plugins/dlls/IgnoreFieldsComma.dll differ
diff --git a/Plugins/dlls/IgnoreFieldsTab.dll b/Plugins/dlls/IgnoreFieldsTab.dll
new file mode 100644 (file)
index 0000000..c20f34a
Binary files /dev/null and b/Plugins/dlls/IgnoreFieldsTab.dll differ
index b408b1d..be7f81d 100644 (file)
@@ -1,24 +1,24 @@
 ============
 editor addin           
 ============
-API : EDITOR_SCRIPT
 Event : EDITOR_SCRIPT
+API : EDITOR_SCRIPT
 Add two functions to the context menu : MakeUpper and MakeLower.
 Use : Select a piece of text, right-click and select one function.
 
 ===============
 insert datetime
 ===============
-API : EDITOR_SCRIPT
 Event : EDITOR_SCRIPT
+API : EDITOR_SCRIPT
 Add two functions to the context menu : InsertDate and InsertTime.
 Use : Put the cursor where you want the date/time to be inserted, right-click and select one function.
 
 =========
 UnpackDFM 
 =========
-API : FILE_PACK_UNPACK
 Event : PACK_UNPACK
+API : FILE_PACK_UNPACK
 A plugin for WinMerge which allows WinMerge to compare and merge Delphi's binary dfm files.
 
 The plugin does nothing if it is passed a text-based dfm file. In this case, WinMerge will handle the 
@@ -29,16 +29,50 @@ Written in and for Borland Delphi 4 - because all dfm files are binary for this
 Requires the runtime library vcl40.bpl (in C:/windows/system32), which is part of the Delphi 4 setup. 
 This is deliberate - I have no way to test the plugin on binary dfm files generated by higher versions of Delphi. If you want to usethis plugin for DFM files from >Delphi 4, I'd recommend recompiling it first.
 
-==================================
-WatchBeginningOfLog, WatchEndOfLog
-==================================
+=============
+IgnoreColumns
+=============
+Event : PREDIFF
+API : BUFFER_PREDIFF
+Ignore the characters at specified columns 
+Does not support files with tabulations (no crash, but all tabs will be treated as a normal character)
+First column has number 1.
 
-API : FILE_PACK_UNPACK
-Event : PACK_UNPACK
-For long log files, user is often interested only in the first lines or in the last lines.
-WatchBeginningOfLog truncates the files to the first 1/10th.
-WatchEndOfLog truncates the files to the first 1/10th.
+For the parameters, you just need to rename the dll.
+
+Syntax :
+- delimiters between ranges : _ or ,
+- delimiters between min and max : anything else
+- min and max are included
+- when max = min, max may be omitted
+
+Examples :
+IgnoreColumns _ 3 _ 10 - 20 _ 32 - 33.dll
+= ignore all characters at column 3, and in columns 10 to 20, and 32 to 33
+IgnoreColumns_1,30 to 40.dll
+= ignore all the characters in column 1, and in columns 30 to 40
+
+=================
+IgnoreFieldsComma
+=================
+Event : PREDIFF
+API : BUFFER_PREDIFF
+
+For files with fields, comma as delimiters. For example, format csv.
+Ignore the characters in the specified fields.
+First field has number 1.
+
+Modify the filename to specify the columns. See IgnoreColumn for the syntax.
+
+===============
+IgnoreFieldsTab
+===============
+Event : PREDIFF
+API : BUFFER_PREDIFF
+
+For files with fields, tabulations as delimiters. For example, excel files saved in format txt.
+Ignore the characters in the specified fields.
+First field has number 1.
+
+Modify the filename to specify the columns. See IgnoreColumn for the syntax.
 
-Note in automatic mode : The first (in alphabetical order) of these plugins is applied to all .log files. 
-So delete WatchBeginningOfLog if you want to apply WatchEndOfLog. 
-Note in automatic mode 2 : remember that the plugin is applied even when comparing directories
index a0e41c3..202134d 100644 (file)
@@ -1,4 +1,13 @@
 2004-06-10 Laoran
+ PATCH: [ 969667 ] Ignore positions/tabbed columns (plugins)
+  Plugins: list of sources.txt
+  Plugins\dlls add: IgnoreColumns.dll IgnoreFieldsComma.dll IgnoreFieldsTab.dll 
+  Plugins\dlls: list.txt
+  Plugins\src_VCPP\IgnoreColumns add: all files
+  Plugins\src_VCPP\IgnoreFieldsComma add: all files
+  Plugins\src_VCPP\IgnoreFieldsTab add: all files
+
+2004-06-10 Laoran
  update plugins text doc :
   Plugins: readme_developpers.txt syntax.txt
   Plugins/dlls Add: readme_users.txt
@@ -11,8 +20,8 @@
 2004-04-03 Laoran
  PATCH: [ 923044 ] Partial compare large files
   Plugins: list of sources.txt
-  Plugins\src_VCPP_WatchBeginningOfLog add: all files
-  Plugins\src_VCPP_WatchEndOfLog add: all files
+  Plugins\src_VCPP\WatchBeginningOfLog add: all files
+  Plugins\src_VCPP\WatchEndOfLog add: all files
 
 2004-04-02 Laoran
  Change plugins event title 'CONTEXT_MENU' -> 'EDITOR_SCRIPT'
diff --git a/Plugins/src_VCPP/IgnoreColumns/IgnoreColumns.cpp b/Plugins/src_VCPP/IgnoreColumns/IgnoreColumns.cpp
new file mode 100644 (file)
index 0000000..dfe9420
--- /dev/null
@@ -0,0 +1,72 @@
+// IgnoreColumns.cpp : Implementation of DLL Exports.
+
+
+// Note: Proxy/Stub Information
+//      To build a separate proxy/stub DLL, 
+//      run nmake -f IgnoreColumnsps.mk in the project directory.
+
+#include "stdafx.h"
+#include "resource.h"
+#include <initguid.h>
+#include "IgnoreColumns.h"
+
+#include "IgnoreColumns_i.c"
+#include "WinMergeScript.h"
+
+
+CComModule _Module;
+
+BEGIN_OBJECT_MAP(ObjectMap)
+OBJECT_ENTRY(CLSID_WinMergeScript, CWinMergeScript)
+END_OBJECT_MAP()
+
+/////////////////////////////////////////////////////////////////////////////
+// DLL Entry Point
+
+extern "C"
+BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/)
+{
+    if (dwReason == DLL_PROCESS_ATTACH)
+    {
+        _Module.Init(ObjectMap, hInstance, &LIBID_IgnoreColumnsLib);
+        DisableThreadLibraryCalls(hInstance);
+    }
+    else if (dwReason == DLL_PROCESS_DETACH)
+        _Module.Term();
+    return TRUE;    // ok
+}
+
+/////////////////////////////////////////////////////////////////////////////
+// Used to determine whether the DLL can be unloaded by OLE
+
+STDAPI DllCanUnloadNow(void)
+{
+    return (_Module.GetLockCount()==0) ? S_OK : S_FALSE;
+}
+
+/////////////////////////////////////////////////////////////////////////////
+// Returns a class factory to create an object of the requested type
+
+STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
+{
+    return _Module.GetClassObject(rclsid, riid, ppv);
+}
+
+/////////////////////////////////////////////////////////////////////////////
+// DllRegisterServer - Adds entries to the system registry
+
+STDAPI DllRegisterServer(void)
+{
+    // registers object, typelib and all interfaces in typelib
+    return _Module.RegisterServer(TRUE);
+}
+
+/////////////////////////////////////////////////////////////////////////////
+// DllUnregisterServer - Removes entries from the system registry
+
+STDAPI DllUnregisterServer(void)
+{
+    return _Module.UnregisterServer(TRUE);
+}
+
+
diff --git a/Plugins/src_VCPP/IgnoreColumns/IgnoreColumns.def b/Plugins/src_VCPP/IgnoreColumns/IgnoreColumns.def
new file mode 100644 (file)
index 0000000..0c1a9e1
--- /dev/null
@@ -0,0 +1,9 @@
+; IgnoreColumns.def : Declares the module parameters.
+
+LIBRARY      "IgnoreColumns.DLL"
+
+EXPORTS
+       DllCanUnloadNow     @1 PRIVATE
+       DllGetClassObject   @2 PRIVATE
+       DllRegisterServer   @3 PRIVATE
+       DllUnregisterServer     @4 PRIVATE
diff --git a/Plugins/src_VCPP/IgnoreColumns/IgnoreColumns.dsp b/Plugins/src_VCPP/IgnoreColumns/IgnoreColumns.dsp
new file mode 100644 (file)
index 0000000..e7e0ca4
--- /dev/null
@@ -0,0 +1,242 @@
+# Microsoft Developer Studio Project File - Name="IgnoreColumns" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
+
+CFG=IgnoreColumns - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "IgnoreColumns.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "IgnoreColumns.mak" CFG="IgnoreColumns - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "IgnoreColumns - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "IgnoreColumns - Win32 Unicode Debug" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "IgnoreColumns - Win32 Release MinSize" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "IgnoreColumns - Win32 Release MinDependency" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "IgnoreColumns - Win32 Unicode Release MinSize" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "IgnoreColumns - Win32 Unicode Release MinDependency" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=xicl6.exe
+MTL=midl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "IgnoreColumns - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c
+# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c
+# ADD BASE RSC /l 0x40c /d "_DEBUG"
+# ADD RSC /l 0x40c /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=xilink6.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept
+
+!ELSEIF  "$(CFG)" == "IgnoreColumns - Win32 Unicode Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "DebugU"
+# PROP BASE Intermediate_Dir "DebugU"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "DebugU"
+# PROP Intermediate_Dir "DebugU"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c
+# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c
+# ADD BASE RSC /l 0x40c /d "_DEBUG"
+# ADD RSC /l 0x40c /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=xilink6.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept
+
+!ELSEIF  "$(CFG)" == "IgnoreColumns - Win32 Release MinSize"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "ReleaseMinSize"
+# PROP BASE Intermediate_Dir "ReleaseMinSize"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "ReleaseMinSize"
+# PROP Intermediate_Dir "ReleaseMinSize"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD BASE RSC /l 0x40c /d "NDEBUG"
+# ADD RSC /l 0x40c /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=xilink6.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386
+
+!ELSEIF  "$(CFG)" == "IgnoreColumns - Win32 Release MinDependency"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "ReleaseMinDependency"
+# PROP BASE Intermediate_Dir "ReleaseMinDependency"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "ReleaseMinDependency"
+# PROP Intermediate_Dir "ReleaseMinDependency"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD BASE RSC /l 0x40c /d "NDEBUG"
+# ADD RSC /l 0x40c /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=xilink6.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386
+
+!ELSEIF  "$(CFG)" == "IgnoreColumns - Win32 Unicode Release MinSize"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "ReleaseUMinSize"
+# PROP BASE Intermediate_Dir "ReleaseUMinSize"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "ReleaseUMinSize"
+# PROP Intermediate_Dir "ReleaseUMinSize"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD BASE RSC /l 0x40c /d "NDEBUG"
+# ADD RSC /l 0x40c /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=xilink6.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386
+
+!ELSEIF  "$(CFG)" == "IgnoreColumns - Win32 Unicode Release MinDependency"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "ReleaseUMinDependency"
+# PROP BASE Intermediate_Dir "ReleaseUMinDependency"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "ReleaseUMinDependency"
+# PROP Intermediate_Dir "ReleaseUMinDependency"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD BASE RSC /l 0x40c /d "NDEBUG"
+# ADD RSC /l 0x40c /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=xilink6.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386
+
+!ENDIF 
+
+# Begin Target
+
+# Name "IgnoreColumns - Win32 Debug"
+# Name "IgnoreColumns - Win32 Unicode Debug"
+# Name "IgnoreColumns - Win32 Release MinSize"
+# Name "IgnoreColumns - Win32 Release MinDependency"
+# Name "IgnoreColumns - Win32 Unicode Release MinSize"
+# Name "IgnoreColumns - Win32 Unicode Release MinDependency"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\IgnoreColumns.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\IgnoreColumns.def
+# End Source File
+# Begin Source File
+
+SOURCE=.\IgnoreColumns.idl
+# ADD MTL /tlb ".\IgnoreColumns.tlb" /h "IgnoreColumns.h" /iid "IgnoreColumns_i.c" /Oicf
+# End Source File
+# Begin Source File
+
+SOURCE=.\IgnoreColumns.rc
+# End Source File
+# Begin Source File
+
+SOURCE=.\StdAfx.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\WinMergeScript.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=.\Resource.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\StdAfx.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\typeinfoex.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\WinMergeScript.h
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# Begin Source File
+
+SOURCE=.\WinMergeScript.rgs
+# End Source File
+# End Group
+# End Target
+# End Project
diff --git a/Plugins/src_VCPP/IgnoreColumns/IgnoreColumns.idl b/Plugins/src_VCPP/IgnoreColumns/IgnoreColumns.idl
new file mode 100644 (file)
index 0000000..606187d
--- /dev/null
@@ -0,0 +1,43 @@
+// IgnoreColumns.idl : IDL source for IgnoreColumns.dll
+//
+
+// This file will be processed by the MIDL tool to
+// produce the type library (IgnoreColumns.tlb) and marshalling code.
+
+import "oaidl.idl";
+import "ocidl.idl";
+       [
+               object,
+               uuid(DAFE8196-A8BD-47F1-9D0C-7299D93105E7),
+               dual,
+               helpstring("IWinMergeScript Interface"),
+               pointer_default(unique)
+       ]
+       interface IWinMergeScript : IDispatch
+       {
+               [propget, id(1), helpstring("property PluginEvent")] HRESULT PluginEvent([out, retval] BSTR *pVal);
+               [propget, id(2), helpstring("property PluginDescription")] HRESULT PluginDescription([out, retval] BSTR *pVal);
+               [propget, id(3), helpstring("property PluginFileFilters")] HRESULT PluginFileFilters([out, retval] BSTR *pVal);
+               [propget, id(4), helpstring("property PluginIsAutomatic")] HRESULT PluginIsAutomatic([out, retval] VARIANT_BOOL *pVal);
+               [id(5), helpstring("method PrediffBufferW")] HRESULT PrediffBufferW([in] BSTR * pText, [in] INT * pSize, [in] VARIANT_BOOL * pbChanged, [out, retval] VARIANT_BOOL * pbHandled);
+       };
+
+[
+       uuid(7039A486-4E6F-4A1E-80BE-BCEA359ADA72),
+       version(1.0),
+       helpstring("IgnoreColumns 1.0 Type Library")
+]
+library IgnoreColumnsLib
+{
+       importlib("stdole32.tlb");
+       importlib("stdole2.tlb");
+
+       [
+               uuid(EA7D4D55-FBCC-41C0-933A-7DD5F3E5E641),
+               helpstring("WinMergeScript Class")
+       ]
+       coclass WinMergeScript
+       {
+               [default] interface IWinMergeScript;
+       };
+};
diff --git a/Plugins/src_VCPP/IgnoreColumns/IgnoreColumns.rc b/Plugins/src_VCPP/IgnoreColumns/IgnoreColumns.rc
new file mode 100644 (file)
index 0000000..8c9e954
--- /dev/null
@@ -0,0 +1,117 @@
+//Microsoft Developer Studio generated resource script.
+//
+#include "resource.h"
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+#include "winres.h"
+
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+// French (France) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_FRA)
+#ifdef _WIN32
+LANGUAGE LANG_FRENCH, SUBLANG_FRENCH
+#pragma code_page(1252)
+#endif //_WIN32
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE DISCARDABLE 
+BEGIN
+    "resource.h\0"
+END
+
+2 TEXTINCLUDE DISCARDABLE 
+BEGIN
+    "#include ""winres.h""\r\n"
+    "\0"
+END
+
+3 TEXTINCLUDE DISCARDABLE 
+BEGIN
+    "1 TYPELIB ""IgnoreColumns.tlb""\r\n"
+    "\0"
+END
+
+#endif    // APSTUDIO_INVOKED
+
+
+#ifndef _MAC
+/////////////////////////////////////////////////////////////////////////////
+//
+// Version
+//
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION 1,0,0,1
+ PRODUCTVERSION 1,0,0,1
+ FILEFLAGSMASK 0x3fL
+#ifdef _DEBUG
+ FILEFLAGS 0x1L
+#else
+ FILEFLAGS 0x0L
+#endif
+ FILEOS 0x4L
+ FILETYPE 0x2L
+ FILESUBTYPE 0x0L
+BEGIN
+    BLOCK "StringFileInfo"
+    BEGIN
+        BLOCK "040904B0"
+        BEGIN
+            VALUE "CompanyName", "\0"
+            VALUE "FileDescription", "IgnoreColumns Module\0"
+            VALUE "FileVersion", "1, 0, 0, 1\0"
+            VALUE "InternalName", "IgnoreColumns\0"
+            VALUE "LegalCopyright", "Copyright 2003\0"
+            VALUE "OriginalFilename", "IgnoreColumns.DLL\0"
+            VALUE "ProductName", "IgnoreColumns Module\0"
+            VALUE "ProductVersion", "1, 0, 0, 1\0"
+            VALUE "OLESelfRegister", "\0"
+        END
+    END
+    BLOCK "VarFileInfo"
+    BEGIN
+        VALUE "Translation", 0x409, 1200
+    END
+END
+
+#endif    // !_MAC
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// String Table
+//
+
+STRINGTABLE DISCARDABLE 
+BEGIN
+    IDS_PROJNAME            "IgnoreColumns"
+END
+
+#endif    // French (France) resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+1 TYPELIB "IgnoreColumns.tlb"
+
+/////////////////////////////////////////////////////////////////////////////
+#endif    // not APSTUDIO_INVOKED
+
diff --git a/Plugins/src_VCPP/IgnoreColumns/Resource.h b/Plugins/src_VCPP/IgnoreColumns/Resource.h
new file mode 100644 (file)
index 0000000..91ec8ed
--- /dev/null
@@ -0,0 +1,17 @@
+//{{NO_DEPENDENCIES}}
+// Microsoft Developer Studio generated include file.
+// Used by IgnoreColumns.rc
+//
+#define IDS_PROJNAME                    100
+#define IDR_WINMERGESCRIPT              101
+
+// Next default values for new objects
+// 
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE        201
+#define _APS_NEXT_COMMAND_VALUE         32768
+#define _APS_NEXT_CONTROL_VALUE         201
+#define _APS_NEXT_SYMED_VALUE           102
+#endif
+#endif
diff --git a/Plugins/src_VCPP/IgnoreColumns/StdAfx.cpp b/Plugins/src_VCPP/IgnoreColumns/StdAfx.cpp
new file mode 100644 (file)
index 0000000..a5eea17
--- /dev/null
@@ -0,0 +1,12 @@
+// stdafx.cpp : source file that includes just the standard includes
+//  stdafx.pch will be the pre-compiled header
+//  stdafx.obj will contain the pre-compiled type information
+
+#include "stdafx.h"
+
+#ifdef _ATL_STATIC_REGISTRY
+#include <statreg.h>
+#include <statreg.cpp>
+#endif
+
+#include <atlimpl.cpp>
diff --git a/Plugins/src_VCPP/IgnoreColumns/StdAfx.h b/Plugins/src_VCPP/IgnoreColumns/StdAfx.h
new file mode 100644 (file)
index 0000000..f4acf49
--- /dev/null
@@ -0,0 +1,27 @@
+// stdafx.h : include file for standard system include files,
+//      or project specific include files that are used frequently,
+//      but are changed infrequently
+
+#if !defined(AFX_STDAFX_H__1A520598_1E89_4BFA_98CD_7628B0C3DAA0__INCLUDED_)
+#define AFX_STDAFX_H__1A520598_1E89_4BFA_98CD_7628B0C3DAA0__INCLUDED_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+#define STRICT
+#ifndef _WIN32_WINNT
+#define _WIN32_WINNT 0x0400
+#endif
+#define _ATL_APARTMENT_THREADED
+
+#include <atlbase.h>
+//You may derive a class from CComModule and use it if you want to override
+//something, but do not change the name of _Module
+extern CComModule _Module;
+#include <atlcom.h>
+
+//{{AFX_INSERT_LOCATION}}
+// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
+
+#endif // !defined(AFX_STDAFX_H__1A520598_1E89_4BFA_98CD_7628B0C3DAA0__INCLUDED)
diff --git a/Plugins/src_VCPP/IgnoreColumns/WinMergeScript.cpp b/Plugins/src_VCPP/IgnoreColumns/WinMergeScript.cpp
new file mode 100644 (file)
index 0000000..6207ad8
--- /dev/null
@@ -0,0 +1,229 @@
+// WinMergeScript.cpp : Implementation of CWinMergeScript
+#include "stdafx.h"
+#include "IgnoreColumns.h"
+#include "WinMergeScript.h"
+
+/////////////////////////////////////////////////////////////////////////////
+// CWinMergeScript
+
+
+/** 
+ * @brief Get the name of the current dll
+ */
+LPTSTR GetDllFilename(LPTSTR name, int len)
+{
+       // careful for the last char, the doc does not give this detail
+       name[len] = 0;
+       GetModuleFileName(_Module.GetModuleInstance(), name, len-1);
+       // find last backslash
+       TCHAR * lastslash = _tcsrchr(name, _T('//'));
+       if (lastslash == 0)             
+               lastslash = name;
+       else
+               lastslash ++;
+       TCHAR * lastslash2 = _tcsrchr(lastslash, _T('\\'));
+       if (lastslash2 == 0)            
+               lastslash2 = name;
+       else
+               lastslash2 ++;
+       if (lastslash2 != name)
+               strcpy(name, lastslash2);
+       return name;
+}
+
+
+int CreateArrayFromFilename(int (* value)[2])
+{
+       TCHAR name[256+1];
+       GetDllFilename(name, 256);
+
+       // first pass : prepare the chunks
+       int nValue = 0;
+       TCHAR * token = _tcstok(name, _T(",_"));
+       while( token != NULL )
+       {
+               nValue ++;
+               /* Get next token: */
+               token = _tcstok( NULL, _T(",_") );
+       }
+
+       // pass first chunk 
+       nValue --;
+
+       if (value == 0)
+               // just return the number of values
+               return nValue;
+
+       if (nValue == 0)
+               return nValue;
+
+       token = name + _tcslen(name) + 1;       // pass first chunk 
+       int i;
+       for (i = 0 ; i < nValue ; i++)
+       {
+               value[i][0] = _tcstol(token, &token, 10);
+               while (*token != 0 && !_istdigit(*token))
+                       token ++;
+               if (token[0] == 0)
+               {
+                       value[i][1] = value[i][0];
+               }
+               else
+               {
+                       value[i][1] = _tcstol(token, &token, 10);
+               }
+               token = token + _tcslen(token) + 1;
+       }
+
+       return nValue;
+}
+
+
+STDMETHODIMP CWinMergeScript::get_PluginEvent(BSTR *pVal)
+{
+       *pVal = SysAllocString(L"BUFFER_PREDIFF");
+       return S_OK;
+}
+
+STDMETHODIMP CWinMergeScript::get_PluginDescription(BSTR *pVal)
+{
+       *pVal = SysAllocString(L"Ignore some columns - ignored columns list from the plugin name");
+       return S_OK;
+}
+
+// not used yet
+STDMETHODIMP CWinMergeScript::get_PluginFileFilters(BSTR *pVal)
+{
+       *pVal = SysAllocString(L"\\.txt$");
+       return S_OK;
+}
+
+// not used yet
+STDMETHODIMP CWinMergeScript::get_PluginIsAutomatic(VARIANT_BOOL *pVal)
+{
+       *pVal = VARIANT_TRUE;
+       return S_OK;
+}
+
+STDMETHODIMP CWinMergeScript::PrediffBufferW(BSTR *pText, INT *pSize, VARIANT_BOOL *pbChanged, VARIANT_BOOL *pbHandled)
+{
+       WCHAR * pBeginText = *pText;
+       long nSize = *pSize;
+       WCHAR * pEndText = pBeginText + nSize;
+
+
+       int nExcludedRanges = CreateArrayFromFilename(NULL);
+       int (* aExcludedRanges)[2] = new int[nExcludedRanges][2];
+       if (aExcludedRanges == NULL)
+               nExcludedRanges = 0;
+       else
+               nExcludedRanges = CreateArrayFromFilename(aExcludedRanges);
+
+       if (nExcludedRanges == 0)
+       {
+               *pbChanged = VARIANT_FALSE;
+               *pbHandled = VARIANT_TRUE;
+               return S_OK;
+       }
+
+       // character position begins at 1 for user, but at 0 here
+       int i;
+       for (i = 0 ; i < nExcludedRanges ; i++)
+       {
+               aExcludedRanges[i][0] --;
+               aExcludedRanges[i][1] --;
+       }
+
+
+       WCHAR * pDst = pBeginText;
+       WCHAR * zoneBegin;
+       WCHAR * lineBegin;
+
+       for (zoneBegin = lineBegin = pBeginText; lineBegin < pEndText ; lineBegin = zoneBegin)
+       {
+               // next excluded range in the current line
+               int nextExcludedRange;
+               for (nextExcludedRange = 0 ; nextExcludedRange < nExcludedRanges ; nextExcludedRange ++)
+               {
+                       // look for the end of the included zone
+                       WCHAR * zoneEnd = zoneBegin;
+                       WCHAR * zoneMaxEnd = lineBegin + aExcludedRanges[nextExcludedRange][0];
+                       while (zoneEnd < pEndText && zoneEnd < zoneMaxEnd &&
+                                       *zoneEnd != L'\n' && *zoneEnd != L'\r')
+                               zoneEnd ++;
+
+                       // copy the characters of included columns
+                       wcsncpy(pDst, zoneBegin, zoneEnd - zoneBegin);
+                       pDst += zoneEnd - zoneBegin;
+
+                       // advance the cursor
+                       zoneBegin = zoneEnd;
+
+                       if (zoneEnd < zoneMaxEnd)
+                               break;
+
+                       // look for the end of the excluded zone
+                       zoneEnd = zoneBegin;
+                       zoneMaxEnd = lineBegin + aExcludedRanges[nextExcludedRange][1] + 1;
+                       while (zoneEnd < pEndText && zoneEnd < zoneMaxEnd &&
+                                       *zoneEnd != L'\n' && *zoneEnd != L'\r')
+                               zoneEnd ++;
+
+                       // advance the cursor
+                       zoneBegin = zoneEnd;
+
+                       if (zoneEnd < zoneMaxEnd)
+                               break;
+               }
+
+               if (nextExcludedRange == nExcludedRanges)
+               {
+                       // treat the trailing included zone
+
+                       // look for the end of the included zone
+                       WCHAR * zoneEnd = zoneBegin;
+                       while (zoneEnd < pEndText &&
+                                       *zoneEnd != L'\n' && *zoneEnd != L'\r')
+                               zoneEnd ++;
+
+                       // copy the characters of included columns
+                       wcsncpy(pDst, zoneBegin, zoneEnd - zoneBegin);
+                       pDst += zoneEnd - zoneBegin;
+
+                       // advance the cursor
+                       zoneBegin = zoneEnd;
+               }
+               
+               // keep possible EOL characters 
+               WCHAR * eolEnd = zoneBegin;
+               while (eolEnd < pEndText && 
+                         (*eolEnd == L'\n' || *eolEnd == L'\r'))
+               {
+                       eolEnd ++;
+               }
+
+               if (eolEnd > zoneBegin)
+               {
+                       // copy the EOL characters
+                       wcsncpy(pDst, zoneBegin, eolEnd - zoneBegin);
+                       pDst += eolEnd - zoneBegin;
+                       // advance the cursor
+                       zoneBegin = eolEnd;
+               }
+
+       }
+
+
+       delete [] aExcludedRanges;
+
+       // set the new size
+       *pSize = pDst - pBeginText;
+
+       if (*pSize == nSize)
+               *pbChanged = VARIANT_FALSE;
+       else
+               *pbChanged = VARIANT_TRUE;
+
+       *pbHandled = VARIANT_TRUE;
+       return S_OK;
+}
diff --git a/Plugins/src_VCPP/IgnoreColumns/WinMergeScript.h b/Plugins/src_VCPP/IgnoreColumns/WinMergeScript.h
new file mode 100644 (file)
index 0000000..34bb1d0
--- /dev/null
@@ -0,0 +1,47 @@
+// WinMergeScript.h : Declaration of the CWinMergeScript
+
+#ifndef __WINMERGESCRIPT_H_
+#define __WINMERGESCRIPT_H_
+
+#include "resource.h"       // main symbols
+
+// change 1 : add this include
+#include "typeinfoex.h"
+
+/////////////////////////////////////////////////////////////////////////////
+// CWinMergeScript
+
+// change 2 : add this
+typedef CComTypeInfoHolderModule<1>  CComTypeInfoHolderFileOnly;
+
+class ATL_NO_VTABLE CWinMergeScript : 
+       public CComObjectRootEx<CComSingleThreadModel>,
+       public CComCoClass<CWinMergeScript, &CLSID_WinMergeScript>,
+// change 3 : insert the text ", 1, 0, CComTypeInfoHolderFileOnly" 
+       // public IDispatchImpl<IWinMergeScript, &IID_IWinMergeScript, &LIBID_IgnoreColumnsLib>
+       public IDispatchImpl<IWinMergeScript, &IID_IWinMergeScript, &LIBID_IgnoreColumnsLib, 1, 0, CComTypeInfoHolderFileOnly>
+{
+public:
+       CWinMergeScript()
+       {
+       }
+
+DECLARE_REGISTRY_RESOURCEID(IDR_WINMERGESCRIPT)
+
+DECLARE_PROTECT_FINAL_CONSTRUCT()
+
+BEGIN_COM_MAP(CWinMergeScript)
+       COM_INTERFACE_ENTRY(IWinMergeScript)
+       COM_INTERFACE_ENTRY(IDispatch)
+END_COM_MAP()
+
+// IWinMergeScript
+public:
+       STDMETHOD(PrediffBufferW)(/*[in]*/ BSTR * pText, /*[in]*/ INT * pSize, /*[in]*/ VARIANT_BOOL * pbChanged, /*[out, retval]*/ VARIANT_BOOL * pbHandled);
+       STDMETHOD(get_PluginIsAutomatic)(/*[out, retval]*/ VARIANT_BOOL *pVal);
+       STDMETHOD(get_PluginFileFilters)(/*[out, retval]*/ BSTR *pVal);
+       STDMETHOD(get_PluginDescription)(/*[out, retval]*/ BSTR *pVal);
+       STDMETHOD(get_PluginEvent)(/*[out, retval]*/ BSTR *pVal);
+};
+
+#endif //__WINMERGESCRIPT_H_
diff --git a/Plugins/src_VCPP/IgnoreColumns/typeinfoex.h b/Plugins/src_VCPP/IgnoreColumns/typeinfoex.h
new file mode 100644 (file)
index 0000000..edac4d1
--- /dev/null
@@ -0,0 +1,207 @@
+#ifndef _NEWOBJECTS_ATL_TYPEINFOEX_H_
+#define _NEWOBJECTS_ATL_TYPEINFOEX_H_
+
+// This class is a little changed version of the
+// CComTypeInfoHolder class found in the MS ATL
+// It supports different ways to obtain type info
+// depending on the CComTypeInfoHolder parameter:
+// 
+//  0   - Acts as the Normal CComTypeInfoHolder i.e. loading from the registry only
+//  1   - Loads only from the module resource
+//  2   - Try registry and if not found load from the module
+//  3   - Try from the module and if not found then from the registry
+//
+//  Use this class in the IDispatchImpl templates passed as parent
+//  classes to your components if you want to create components
+//  capable of working with scripts without registration in the
+//  system registry
+//
+//  Michael Elfial, newObjects 2001
+//  http://www.newobjects.com
+
+template <int nObtainMethod = 1>
+class CComTypeInfoHolderModule {
+public:
+       const GUID* m_pguid;
+       const GUID* m_plibid;
+       WORD m_wMajor;
+       WORD m_wMinor;
+
+       ITypeInfo* m_pInfo;
+       long m_dwRef;
+       struct stringdispid
+       {
+               CComBSTR bstr;
+               int nLen;
+               DISPID id;
+       };
+       stringdispid* m_pMap;
+       int m_nCount;
+
+public:
+       HRESULT GetTI(LCID lcid, ITypeInfo** ppInfo)
+       {
+               HRESULT hr = S_OK;
+               if (m_pInfo == NULL)
+                       hr = GetTI(lcid);
+               *ppInfo = m_pInfo;
+               if (m_pInfo != NULL)
+               {
+                       m_pInfo->AddRef();
+                       hr = S_OK;
+               }
+               return hr;
+       }
+       HRESULT GetTI(LCID lcid);
+       HRESULT EnsureTI(LCID lcid)
+       {
+               HRESULT hr = S_OK;
+               if (m_pInfo == NULL)
+                       hr = GetTI(lcid);
+               return hr;
+       }
+
+       // This function is called by the module on exit
+       // It is registered through _Module.AddTermFunc()
+       static void __stdcall Cleanup(DWORD dw)
+       {
+               CComTypeInfoHolder* p = (CComTypeInfoHolder*) dw;
+               if (p->m_pInfo != NULL)
+                       p->m_pInfo->Release();
+               p->m_pInfo = NULL;
+               delete [] p->m_pMap;
+               p->m_pMap = NULL;
+       }
+
+       HRESULT GetTypeInfo(UINT /* itinfo */, LCID lcid, ITypeInfo** pptinfo)
+       {
+               HRESULT hRes = E_POINTER;
+               if (pptinfo != NULL)
+                       hRes = GetTI(lcid, pptinfo);
+               return hRes;
+       }
+       HRESULT GetIDsOfNames(REFIID /* riid */, LPOLESTR* rgszNames, UINT cNames,
+               LCID lcid, DISPID* rgdispid)
+       {
+               HRESULT hRes = EnsureTI(lcid);
+               if (m_pInfo != NULL)
+               {
+                       for (int i=0; i<(int)cNames; i++)
+                       {
+                               int n = ocslen(rgszNames[i]);
+                               for (int 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))
+                                       {
+                                               rgdispid[i] = m_pMap[j].id;
+                                               break;
+                                       }
+                               }
+                               if (j < 0)
+                               {
+                                       hRes = m_pInfo->GetIDsOfNames(rgszNames + i, 1, &rgdispid[i]);
+                                       if (FAILED(hRes))
+                                               break;
+                               }
+                       }
+               }
+               return hRes;
+       }
+
+       HRESULT Invoke(IDispatch* p, DISPID dispidMember, REFIID /* riid */,
+               LCID lcid, WORD wFlags, DISPPARAMS* pdispparams, VARIANT* pvarResult,
+               EXCEPINFO* pexcepinfo, UINT* puArgErr)
+       {
+               HRESULT hRes = EnsureTI(lcid);
+               if (m_pInfo != NULL)
+                       hRes = m_pInfo->Invoke(p, dispidMember, wFlags, pdispparams, pvarResult, pexcepinfo, puArgErr);
+               return hRes;
+       }
+       HRESULT LoadNameCache(ITypeInfo* pTypeInfo)
+       {
+               TYPEATTR* pta;
+               HRESULT hr = pTypeInfo->GetTypeAttr(&pta);
+               if (SUCCEEDED(hr))
+               {
+                       m_nCount = pta->cFuncs;
+                       m_pMap = m_nCount == 0 ? 0 : new stringdispid[m_nCount];
+                       for (int i=0; i<m_nCount; i++)
+                       {
+                               FUNCDESC* pfd;
+                               if (SUCCEEDED(pTypeInfo->GetFuncDesc(i, &pfd)))
+                               {
+                                       CComBSTR bstrName;
+                                       if (SUCCEEDED(pTypeInfo->GetDocumentation(pfd->memid, &bstrName, NULL, NULL, NULL)))
+                                       {
+                                               m_pMap[i].bstr.Attach(bstrName.Detach());
+                                               m_pMap[i].nLen = SysStringLen(m_pMap[i].bstr);
+                                               m_pMap[i].id = pfd->memid;
+                                       }
+                                       pTypeInfo->ReleaseFuncDesc(pfd);
+                               }
+                       }
+                       pTypeInfo->ReleaseTypeAttr(pta);
+               }
+               return S_OK;
+       }
+};
+
+template <int nObtainMethod>
+inline HRESULT CComTypeInfoHolderModule<nObtainMethod>::GetTI(LCID lcid)
+{
+    USES_CONVERSION;
+       //If this assert occurs then most likely didn't initialize properly
+       ATLASSERT(m_plibid != NULL && m_pguid != NULL);
+       ATLASSERT(!::InlineIsEqualGUID(*m_plibid, GUID_NULL) && "Did you forget to pass the LIBID to CComModule::Init?");
+
+       if (m_pInfo != NULL)
+               return S_OK;
+       HRESULT hRes = E_FAIL;
+       EnterCriticalSection(&_Module.m_csTypeInfoHolder);
+       if (m_pInfo == NULL)
+       {
+               ITypeLib* pTypeLib;
+        hRes = E_FAIL;
+        TCHAR szModule[_MAX_PATH+10];
+        LPOLESTR lpszModule;
+        // Select the way
+        switch (nObtainMethod) {
+            case 2: // registry, module
+                hRes = LoadRegTypeLib(*m_plibid, m_wMajor, m_wMinor, lcid, &pTypeLib);
+            case 1: // module
+                if (SUCCEEDED(hRes)) break;
+            case 3: // module, registry
+                GetModuleFileName(_Module.m_hInstTypeLib, szModule, _MAX_PATH);
+                lpszModule = T2OLE(szModule);
+                hRes = LoadTypeLib(lpszModule, &pTypeLib);
+                if (nObtainMethod == 1) break;
+            default:
+                if (FAILED(hRes)) {
+                    hRes = LoadRegTypeLib(*m_plibid, m_wMajor, m_wMinor, lcid, &pTypeLib);
+                }
+        }
+               
+               if (SUCCEEDED(hRes))
+               {
+                       CComPtr<ITypeInfo> spTypeInfo;
+                       hRes = pTypeLib->GetTypeInfoOfGuid(*m_pguid, &spTypeInfo);
+                       if (SUCCEEDED(hRes))
+                       {
+                               CComPtr<ITypeInfo> spInfo(spTypeInfo);
+                               CComPtr<ITypeInfo2> spTypeInfo2;
+                               if (SUCCEEDED(spTypeInfo->QueryInterface(&spTypeInfo2)))
+                                       spInfo = spTypeInfo2;
+
+                               LoadNameCache(spInfo);
+                               m_pInfo = spInfo.Detach();
+                       }
+                       pTypeLib->Release();
+               }
+       }
+       LeaveCriticalSection(&_Module.m_csTypeInfoHolder);
+       _Module.AddTermFunc(Cleanup, (DWORD)this);
+       return hRes;
+}
+
+#endif // _NEWOBJECTS_ATL_TYPEINFOEX_H_
\ No newline at end of file
diff --git a/Plugins/src_VCPP/IgnoreFieldsComma/IgnoreFieldsComma.cpp b/Plugins/src_VCPP/IgnoreFieldsComma/IgnoreFieldsComma.cpp
new file mode 100644 (file)
index 0000000..fd8d85f
--- /dev/null
@@ -0,0 +1,72 @@
+// IgnoreFieldsComma.cpp : Implementation of DLL Exports.
+
+
+// Note: Proxy/Stub Information
+//      To build a separate proxy/stub DLL, 
+//      run nmake -f IgnoreFieldsCommaps.mk in the project directory.
+
+#include "stdafx.h"
+#include "resource.h"
+#include <initguid.h>
+#include "IgnoreFieldsComma.h"
+
+#include "IgnoreFieldsComma_i.c"
+#include "WinMergeScript.h"
+
+
+CComModule _Module;
+
+BEGIN_OBJECT_MAP(ObjectMap)
+OBJECT_ENTRY(CLSID_WinMergeScript, CWinMergeScript)
+END_OBJECT_MAP()
+
+/////////////////////////////////////////////////////////////////////////////
+// DLL Entry Point
+
+extern "C"
+BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/)
+{
+    if (dwReason == DLL_PROCESS_ATTACH)
+    {
+        _Module.Init(ObjectMap, hInstance, &LIBID_IgnoreFieldsCommaLib);
+        DisableThreadLibraryCalls(hInstance);
+    }
+    else if (dwReason == DLL_PROCESS_DETACH)
+        _Module.Term();
+    return TRUE;    // ok
+}
+
+/////////////////////////////////////////////////////////////////////////////
+// Used to determine whether the DLL can be unloaded by OLE
+
+STDAPI DllCanUnloadNow(void)
+{
+    return (_Module.GetLockCount()==0) ? S_OK : S_FALSE;
+}
+
+/////////////////////////////////////////////////////////////////////////////
+// Returns a class factory to create an object of the requested type
+
+STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
+{
+    return _Module.GetClassObject(rclsid, riid, ppv);
+}
+
+/////////////////////////////////////////////////////////////////////////////
+// DllRegisterServer - Adds entries to the system registry
+
+STDAPI DllRegisterServer(void)
+{
+    // registers object, typelib and all interfaces in typelib
+    return _Module.RegisterServer(TRUE);
+}
+
+/////////////////////////////////////////////////////////////////////////////
+// DllUnregisterServer - Removes entries from the system registry
+
+STDAPI DllUnregisterServer(void)
+{
+    return _Module.UnregisterServer(TRUE);
+}
+
+
diff --git a/Plugins/src_VCPP/IgnoreFieldsComma/IgnoreFieldsComma.def b/Plugins/src_VCPP/IgnoreFieldsComma/IgnoreFieldsComma.def
new file mode 100644 (file)
index 0000000..8b8137e
--- /dev/null
@@ -0,0 +1,9 @@
+; IgnoreFieldsComma.def : Declares the module parameters.
+
+LIBRARY      "IgnoreFieldsComma.DLL"
+
+EXPORTS
+       DllCanUnloadNow     @1 PRIVATE
+       DllGetClassObject   @2 PRIVATE
+       DllRegisterServer   @3 PRIVATE
+       DllUnregisterServer     @4 PRIVATE
diff --git a/Plugins/src_VCPP/IgnoreFieldsComma/IgnoreFieldsComma.dsp b/Plugins/src_VCPP/IgnoreFieldsComma/IgnoreFieldsComma.dsp
new file mode 100644 (file)
index 0000000..3236032
--- /dev/null
@@ -0,0 +1,242 @@
+# Microsoft Developer Studio Project File - Name="IgnoreFieldsComma" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
+
+CFG=IgnoreFieldsComma - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "IgnoreFieldsComma.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "IgnoreFieldsComma.mak" CFG="IgnoreFieldsComma - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "IgnoreFieldsComma - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "IgnoreFieldsComma - Win32 Unicode Debug" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "IgnoreFieldsComma - Win32 Release MinSize" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "IgnoreFieldsComma - Win32 Release MinDependency" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "IgnoreFieldsComma - Win32 Unicode Release MinSize" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "IgnoreFieldsComma - Win32 Unicode Release MinDependency" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=xicl6.exe
+MTL=midl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "IgnoreFieldsComma - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c
+# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c
+# ADD BASE RSC /l 0x40c /d "_DEBUG"
+# ADD RSC /l 0x40c /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=xilink6.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept
+
+!ELSEIF  "$(CFG)" == "IgnoreFieldsComma - Win32 Unicode Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "DebugU"
+# PROP BASE Intermediate_Dir "DebugU"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "DebugU"
+# PROP Intermediate_Dir "DebugU"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c
+# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c
+# ADD BASE RSC /l 0x40c /d "_DEBUG"
+# ADD RSC /l 0x40c /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=xilink6.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept
+
+!ELSEIF  "$(CFG)" == "IgnoreFieldsComma - Win32 Release MinSize"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "ReleaseMinSize"
+# PROP BASE Intermediate_Dir "ReleaseMinSize"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "ReleaseMinSize"
+# PROP Intermediate_Dir "ReleaseMinSize"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD BASE RSC /l 0x40c /d "NDEBUG"
+# ADD RSC /l 0x40c /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=xilink6.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386
+
+!ELSEIF  "$(CFG)" == "IgnoreFieldsComma - Win32 Release MinDependency"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "ReleaseMinDependency"
+# PROP BASE Intermediate_Dir "ReleaseMinDependency"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "ReleaseMinDependency"
+# PROP Intermediate_Dir "ReleaseMinDependency"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD BASE RSC /l 0x40c /d "NDEBUG"
+# ADD RSC /l 0x40c /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=xilink6.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386
+
+!ELSEIF  "$(CFG)" == "IgnoreFieldsComma - Win32 Unicode Release MinSize"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "ReleaseUMinSize"
+# PROP BASE Intermediate_Dir "ReleaseUMinSize"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "ReleaseUMinSize"
+# PROP Intermediate_Dir "ReleaseUMinSize"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD BASE RSC /l 0x40c /d "NDEBUG"
+# ADD RSC /l 0x40c /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=xilink6.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386
+
+!ELSEIF  "$(CFG)" == "IgnoreFieldsComma - Win32 Unicode Release MinDependency"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "ReleaseUMinDependency"
+# PROP BASE Intermediate_Dir "ReleaseUMinDependency"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "ReleaseUMinDependency"
+# PROP Intermediate_Dir "ReleaseUMinDependency"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD BASE RSC /l 0x40c /d "NDEBUG"
+# ADD RSC /l 0x40c /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=xilink6.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386
+
+!ENDIF 
+
+# Begin Target
+
+# Name "IgnoreFieldsComma - Win32 Debug"
+# Name "IgnoreFieldsComma - Win32 Unicode Debug"
+# Name "IgnoreFieldsComma - Win32 Release MinSize"
+# Name "IgnoreFieldsComma - Win32 Release MinDependency"
+# Name "IgnoreFieldsComma - Win32 Unicode Release MinSize"
+# Name "IgnoreFieldsComma - Win32 Unicode Release MinDependency"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\IgnoreFieldsComma.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\IgnoreFieldsComma.def
+# End Source File
+# Begin Source File
+
+SOURCE=.\IgnoreFieldsComma.idl
+# ADD MTL /tlb ".\IgnoreFieldsComma.tlb" /h "IgnoreFieldsComma.h" /iid "IgnoreFieldsComma_i.c" /Oicf
+# End Source File
+# Begin Source File
+
+SOURCE=.\IgnoreFieldsComma.rc
+# End Source File
+# Begin Source File
+
+SOURCE=.\StdAfx.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\WinMergeScript.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=.\Resource.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\StdAfx.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\typeinfoex.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\WinMergeScript.h
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# Begin Source File
+
+SOURCE=.\WinMergeScript.rgs
+# End Source File
+# End Group
+# End Target
+# End Project
diff --git a/Plugins/src_VCPP/IgnoreFieldsComma/IgnoreFieldsComma.idl b/Plugins/src_VCPP/IgnoreFieldsComma/IgnoreFieldsComma.idl
new file mode 100644 (file)
index 0000000..d9750e1
--- /dev/null
@@ -0,0 +1,43 @@
+// IgnoreFieldsComma.idl : IDL source for IgnoreFieldsComma.dll
+//
+
+// This file will be processed by the MIDL tool to
+// produce the type library (IgnoreFieldsComma.tlb) and marshalling code.
+
+import "oaidl.idl";
+import "ocidl.idl";
+       [
+               object,
+               uuid(DAFE8196-A8BD-47F1-9D0C-7299D93105E7),
+               dual,
+               helpstring("IWinMergeScript Interface"),
+               pointer_default(unique)
+       ]
+       interface IWinMergeScript : IDispatch
+       {
+               [propget, id(1), helpstring("property PluginEvent")] HRESULT PluginEvent([out, retval] BSTR *pVal);
+               [propget, id(2), helpstring("property PluginDescription")] HRESULT PluginDescription([out, retval] BSTR *pVal);
+               [propget, id(3), helpstring("property PluginFileFilters")] HRESULT PluginFileFilters([out, retval] BSTR *pVal);
+               [propget, id(4), helpstring("property PluginIsAutomatic")] HRESULT PluginIsAutomatic([out, retval] VARIANT_BOOL *pVal);
+               [id(5), helpstring("method PrediffBufferW")] HRESULT PrediffBufferW([in] BSTR * pText, [in] INT * pSize, [in] VARIANT_BOOL * pbChanged, [out, retval] VARIANT_BOOL * pbHandled);
+       };
+
+[
+       uuid(7039A486-4E6F-4A1E-80BE-BCEA359ADA72),
+       version(1.0),
+       helpstring("IgnoreFieldsComma 1.0 Type Library")
+]
+library IgnoreFieldsCommaLib
+{
+       importlib("stdole32.tlb");
+       importlib("stdole2.tlb");
+
+       [
+               uuid(EA7D4D55-FBCC-41C0-933A-7DD5F3E5E641),
+               helpstring("WinMergeScript Class")
+       ]
+       coclass WinMergeScript
+       {
+               [default] interface IWinMergeScript;
+       };
+};
diff --git a/Plugins/src_VCPP/IgnoreFieldsComma/IgnoreFieldsComma.rc b/Plugins/src_VCPP/IgnoreFieldsComma/IgnoreFieldsComma.rc
new file mode 100644 (file)
index 0000000..fc1a99c
--- /dev/null
@@ -0,0 +1,117 @@
+//Microsoft Developer Studio generated resource script.
+//
+#include "resource.h"
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+#include "winres.h"
+
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+// French (France) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_FRA)
+#ifdef _WIN32
+LANGUAGE LANG_FRENCH, SUBLANG_FRENCH
+#pragma code_page(1252)
+#endif //_WIN32
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE DISCARDABLE 
+BEGIN
+    "resource.h\0"
+END
+
+2 TEXTINCLUDE DISCARDABLE 
+BEGIN
+    "#include ""winres.h""\r\n"
+    "\0"
+END
+
+3 TEXTINCLUDE DISCARDABLE 
+BEGIN
+    "1 TYPELIB ""IgnoreFieldsComma.tlb""\r\n"
+    "\0"
+END
+
+#endif    // APSTUDIO_INVOKED
+
+
+#ifndef _MAC
+/////////////////////////////////////////////////////////////////////////////
+//
+// Version
+//
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION 1,0,0,1
+ PRODUCTVERSION 1,0,0,1
+ FILEFLAGSMASK 0x3fL
+#ifdef _DEBUG
+ FILEFLAGS 0x1L
+#else
+ FILEFLAGS 0x0L
+#endif
+ FILEOS 0x4L
+ FILETYPE 0x2L
+ FILESUBTYPE 0x0L
+BEGIN
+    BLOCK "StringFileInfo"
+    BEGIN
+        BLOCK "040904B0"
+        BEGIN
+            VALUE "CompanyName", "\0"
+            VALUE "FileDescription", "IgnoreFieldsComma Module\0"
+            VALUE "FileVersion", "1, 0, 0, 1\0"
+            VALUE "InternalName", "IgnoreFieldsComma\0"
+            VALUE "LegalCopyright", "Copyright 2003\0"
+            VALUE "OriginalFilename", "IgnoreFieldsComma.DLL\0"
+            VALUE "ProductName", "IgnoreFieldsComma Module\0"
+            VALUE "ProductVersion", "1, 0, 0, 1\0"
+            VALUE "OLESelfRegister", "\0"
+        END
+    END
+    BLOCK "VarFileInfo"
+    BEGIN
+        VALUE "Translation", 0x409, 1200
+    END
+END
+
+#endif    // !_MAC
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// String Table
+//
+
+STRINGTABLE DISCARDABLE 
+BEGIN
+    IDS_PROJNAME            "IgnoreFieldsComma"
+END
+
+#endif    // French (France) resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+1 TYPELIB "IgnoreFieldsComma.tlb"
+
+/////////////////////////////////////////////////////////////////////////////
+#endif    // not APSTUDIO_INVOKED
+
diff --git a/Plugins/src_VCPP/IgnoreFieldsComma/Resource.h b/Plugins/src_VCPP/IgnoreFieldsComma/Resource.h
new file mode 100644 (file)
index 0000000..0ef198e
--- /dev/null
@@ -0,0 +1,17 @@
+//{{NO_DEPENDENCIES}}
+// Microsoft Developer Studio generated include file.
+// Used by IgnoreFieldsComma.rc
+//
+#define IDS_PROJNAME                    100
+#define IDR_WINMERGESCRIPT              101
+
+// Next default values for new objects
+// 
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE        201
+#define _APS_NEXT_COMMAND_VALUE         32768
+#define _APS_NEXT_CONTROL_VALUE         201
+#define _APS_NEXT_SYMED_VALUE           102
+#endif
+#endif
diff --git a/Plugins/src_VCPP/IgnoreFieldsComma/StdAfx.cpp b/Plugins/src_VCPP/IgnoreFieldsComma/StdAfx.cpp
new file mode 100644 (file)
index 0000000..a5eea17
--- /dev/null
@@ -0,0 +1,12 @@
+// stdafx.cpp : source file that includes just the standard includes
+//  stdafx.pch will be the pre-compiled header
+//  stdafx.obj will contain the pre-compiled type information
+
+#include "stdafx.h"
+
+#ifdef _ATL_STATIC_REGISTRY
+#include <statreg.h>
+#include <statreg.cpp>
+#endif
+
+#include <atlimpl.cpp>
diff --git a/Plugins/src_VCPP/IgnoreFieldsComma/StdAfx.h b/Plugins/src_VCPP/IgnoreFieldsComma/StdAfx.h
new file mode 100644 (file)
index 0000000..f4acf49
--- /dev/null
@@ -0,0 +1,27 @@
+// stdafx.h : include file for standard system include files,
+//      or project specific include files that are used frequently,
+//      but are changed infrequently
+
+#if !defined(AFX_STDAFX_H__1A520598_1E89_4BFA_98CD_7628B0C3DAA0__INCLUDED_)
+#define AFX_STDAFX_H__1A520598_1E89_4BFA_98CD_7628B0C3DAA0__INCLUDED_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+#define STRICT
+#ifndef _WIN32_WINNT
+#define _WIN32_WINNT 0x0400
+#endif
+#define _ATL_APARTMENT_THREADED
+
+#include <atlbase.h>
+//You may derive a class from CComModule and use it if you want to override
+//something, but do not change the name of _Module
+extern CComModule _Module;
+#include <atlcom.h>
+
+//{{AFX_INSERT_LOCATION}}
+// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
+
+#endif // !defined(AFX_STDAFX_H__1A520598_1E89_4BFA_98CD_7628B0C3DAA0__INCLUDED)
diff --git a/Plugins/src_VCPP/IgnoreFieldsComma/WinMergeScript.cpp b/Plugins/src_VCPP/IgnoreFieldsComma/WinMergeScript.cpp
new file mode 100644 (file)
index 0000000..1c400c9
--- /dev/null
@@ -0,0 +1,224 @@
+// WinMergeScript.cpp : Implementation of CWinMergeScript
+#include "stdafx.h"
+#include "IgnoreFieldsTab.h"
+#include "WinMergeScript.h"
+
+/////////////////////////////////////////////////////////////////////////////
+// CWinMergeScript
+
+
+/** 
+ * @brief Get the name of the current dll
+ */
+LPTSTR GetDllFilename(LPTSTR name, int len)
+{
+       // careful for the last char, the doc does not give this detail
+       name[len] = 0;
+       GetModuleFileName(_Module.GetModuleInstance(), name, len-1);
+       // find last backslash
+       TCHAR * lastslash = _tcsrchr(name, _T('//'));
+       if (lastslash == 0)             
+               lastslash = name;
+       else
+               lastslash ++;
+       TCHAR * lastslash2 = _tcsrchr(lastslash, _T('\\'));
+       if (lastslash2 == 0)            
+               lastslash2 = name;
+       else
+               lastslash2 ++;
+       if (lastslash2 != name)
+               strcpy(name, lastslash2);
+       return name;
+}
+
+
+int CreateArrayFromFilename(int (* value)[2])
+{
+       TCHAR name[256+1];
+       GetDllFilename(name, 256);
+
+       // first pass : prepare the chunks
+       int nValue = 0;
+       TCHAR * token = _tcstok(name, _T(",_"));
+       while( token != NULL )
+       {
+               nValue ++;
+               /* Get next token: */
+               token = _tcstok( NULL, _T(",_") );
+       }
+
+       // pass first chunk 
+       nValue --;
+
+       if (value == 0)
+               // just return the number of values
+               return nValue;
+
+       if (nValue == 0)
+               return nValue;
+
+       token = name + _tcslen(name) + 1;       // pass first chunk 
+       int i;
+       for (i = 0 ; i < nValue ; i++)
+       {
+               value[i][0] = _tcstol(token, &token, 10);
+               while (*token != 0 && !_istdigit(*token))
+                       token ++;
+               if (token[0] == 0)
+               {
+                       value[i][1] = value[i][0];
+               }
+               else
+               {
+                       value[i][1] = _tcstol(token, &token, 10);
+               }
+               token = token + _tcslen(token) + 1;
+       }
+
+       return nValue;
+}
+
+
+STDMETHODIMP CWinMergeScript::get_PluginEvent(BSTR *pVal)
+{
+       *pVal = SysAllocString(L"BUFFER_PREDIFF");
+       return S_OK;
+}
+
+STDMETHODIMP CWinMergeScript::get_PluginDescription(BSTR *pVal)
+{
+       *pVal = SysAllocString(L"Ignore some fields - ignored fields list from the plugin name");
+       return S_OK;
+}
+
+// not used yet
+STDMETHODIMP CWinMergeScript::get_PluginFileFilters(BSTR *pVal)
+{
+       *pVal = SysAllocString(L"\\.csv$");
+       return S_OK;
+}
+
+// not used yet
+STDMETHODIMP CWinMergeScript::get_PluginIsAutomatic(VARIANT_BOOL *pVal)
+{
+       *pVal = VARIANT_TRUE;
+       return S_OK;
+}
+
+
+STDMETHODIMP CWinMergeScript::PrediffBufferW(BSTR *pText, INT *pSize, VARIANT_BOOL *pbChanged, VARIANT_BOOL *pbHandled)
+{
+       WCHAR * pBeginText = *pText;
+       long nSize = *pSize;
+       WCHAR * pEndText = pBeginText + nSize;
+
+
+       int nExcludedRanges = CreateArrayFromFilename(NULL);
+       int (* aExcludedRanges)[2] = new int[nExcludedRanges][2];
+       if (aExcludedRanges == NULL)
+               nExcludedRanges = 0;
+       else
+               nExcludedRanges = CreateArrayFromFilename(aExcludedRanges);
+
+       if (nExcludedRanges == 0)
+       {
+               *pbChanged = VARIANT_FALSE;
+               *pbHandled = VARIANT_TRUE;
+               return S_OK;
+       }
+
+       // first column is 1 for user, but is 0 here
+       int i;
+       for (i = 0 ; i < nExcludedRanges ; i++)
+       {
+               aExcludedRanges[i][0] --;
+               aExcludedRanges[i][1] --;
+       }
+
+
+       WCHAR * pDst = pBeginText;
+       WCHAR * columnBegin;
+
+       // change this to change the delimiter between fields
+       const WCHAR delimiter = L',';
+
+       // order of the column in the current line
+       int iColumn = 0;
+       // next excluded column range in the current line
+       int nextExcludedRange = 0;
+
+       for (columnBegin = pBeginText; columnBegin < pEndText ; )
+       {
+
+               // search for the end of the column (columnEnd = first excluded character)
+               WCHAR * columnEnd = columnBegin;
+               while (columnEnd < pEndText &&
+                               *columnEnd != L'\n' &&
+                               *columnEnd != L'\r' &&
+                               *columnEnd != delimiter)
+                       columnEnd ++;
+
+               // determine the status of this column
+               if (nextExcludedRange < nExcludedRanges && iColumn > aExcludedRanges[nextExcludedRange][1])
+                       nextExcludedRange ++;
+               BOOL bIsColumnIncluded = TRUE;
+               if (nextExcludedRange < nExcludedRanges && iColumn >= aExcludedRanges[nextExcludedRange][0])
+                       bIsColumnIncluded = FALSE;
+
+               // copy the characters of included columns
+               if (bIsColumnIncluded)
+               {
+                       wcsncpy(pDst, columnBegin, columnEnd - columnBegin);
+                       pDst += columnEnd - columnBegin;
+               }
+
+               // advance the cursor
+               columnBegin = columnEnd;
+
+               // keep possible tabulation (only one)
+               if (columnBegin < pEndText)
+                       if (*columnBegin == delimiter)
+                       {
+                               // copy the tabulation
+                               *pDst = delimiter;
+                               pDst ++;
+                               // advance the cursor
+                               columnBegin ++;
+                               // next column
+                               iColumn ++;
+                       }
+
+               // keep possible EOL characters 
+               WCHAR * eolEnd = columnBegin;
+               while (eolEnd < pEndText && (*eolEnd == L'\n' || *eolEnd == L'\r'))
+               {
+                       eolEnd ++;
+               }
+
+               if (eolEnd > columnBegin)
+               {
+                       // copy the EOL characters
+                       wcsncpy(pDst, columnBegin, eolEnd - columnBegin);
+                       pDst += eolEnd - columnBegin;
+                       // advance the cursor
+                       columnBegin = eolEnd;
+                       // reset the column counter
+                       iColumn = 0;
+                       nextExcludedRange = 0;
+               }
+       }
+
+
+       delete [] aExcludedRanges;
+
+       // set the new size
+       *pSize = pDst - pBeginText;
+
+       if (*pSize == nSize)
+               *pbChanged = VARIANT_FALSE;
+       else
+               *pbChanged = VARIANT_TRUE;
+
+       *pbHandled = VARIANT_TRUE;
+       return S_OK;
+}
diff --git a/Plugins/src_VCPP/IgnoreFieldsComma/WinMergeScript.h b/Plugins/src_VCPP/IgnoreFieldsComma/WinMergeScript.h
new file mode 100644 (file)
index 0000000..f048134
--- /dev/null
@@ -0,0 +1,47 @@
+// WinMergeScript.h : Declaration of the CWinMergeScript
+
+#ifndef __WINMERGESCRIPT_H_
+#define __WINMERGESCRIPT_H_
+
+#include "resource.h"       // main symbols
+
+// change 1 : add this include
+#include "typeinfoex.h"
+
+/////////////////////////////////////////////////////////////////////////////
+// CWinMergeScript
+
+// change 2 : add this
+typedef CComTypeInfoHolderModule<1>  CComTypeInfoHolderFileOnly;
+
+class ATL_NO_VTABLE CWinMergeScript : 
+       public CComObjectRootEx<CComSingleThreadModel>,
+       public CComCoClass<CWinMergeScript, &CLSID_WinMergeScript>,
+// change 3 : insert the text ", 1, 0, CComTypeInfoHolderFileOnly" 
+       // public IDispatchImpl<IWinMergeScript, &IID_IWinMergeScript, &LIBID_IgnoreFieldsCommaLib>
+       public IDispatchImpl<IWinMergeScript, &IID_IWinMergeScript, &LIBID_IgnoreFieldsCommaLib, 1, 0, CComTypeInfoHolderFileOnly>
+{
+public:
+       CWinMergeScript()
+       {
+       }
+
+DECLARE_REGISTRY_RESOURCEID(IDR_WINMERGESCRIPT)
+
+DECLARE_PROTECT_FINAL_CONSTRUCT()
+
+BEGIN_COM_MAP(CWinMergeScript)
+       COM_INTERFACE_ENTRY(IWinMergeScript)
+       COM_INTERFACE_ENTRY(IDispatch)
+END_COM_MAP()
+
+// IWinMergeScript
+public:
+       STDMETHOD(PrediffBufferW)(/*[in]*/ BSTR * pText, /*[in]*/ INT * pSize, /*[in]*/ VARIANT_BOOL * pbChanged, /*[out, retval]*/ VARIANT_BOOL * pbHandled);
+       STDMETHOD(get_PluginIsAutomatic)(/*[out, retval]*/ VARIANT_BOOL *pVal);
+       STDMETHOD(get_PluginFileFilters)(/*[out, retval]*/ BSTR *pVal);
+       STDMETHOD(get_PluginDescription)(/*[out, retval]*/ BSTR *pVal);
+       STDMETHOD(get_PluginEvent)(/*[out, retval]*/ BSTR *pVal);
+};
+
+#endif //__WINMERGESCRIPT_H_
diff --git a/Plugins/src_VCPP/IgnoreFieldsComma/typeinfoex.h b/Plugins/src_VCPP/IgnoreFieldsComma/typeinfoex.h
new file mode 100644 (file)
index 0000000..edac4d1
--- /dev/null
@@ -0,0 +1,207 @@
+#ifndef _NEWOBJECTS_ATL_TYPEINFOEX_H_
+#define _NEWOBJECTS_ATL_TYPEINFOEX_H_
+
+// This class is a little changed version of the
+// CComTypeInfoHolder class found in the MS ATL
+// It supports different ways to obtain type info
+// depending on the CComTypeInfoHolder parameter:
+// 
+//  0   - Acts as the Normal CComTypeInfoHolder i.e. loading from the registry only
+//  1   - Loads only from the module resource
+//  2   - Try registry and if not found load from the module
+//  3   - Try from the module and if not found then from the registry
+//
+//  Use this class in the IDispatchImpl templates passed as parent
+//  classes to your components if you want to create components
+//  capable of working with scripts without registration in the
+//  system registry
+//
+//  Michael Elfial, newObjects 2001
+//  http://www.newobjects.com
+
+template <int nObtainMethod = 1>
+class CComTypeInfoHolderModule {
+public:
+       const GUID* m_pguid;
+       const GUID* m_plibid;
+       WORD m_wMajor;
+       WORD m_wMinor;
+
+       ITypeInfo* m_pInfo;
+       long m_dwRef;
+       struct stringdispid
+       {
+               CComBSTR bstr;
+               int nLen;
+               DISPID id;
+       };
+       stringdispid* m_pMap;
+       int m_nCount;
+
+public:
+       HRESULT GetTI(LCID lcid, ITypeInfo** ppInfo)
+       {
+               HRESULT hr = S_OK;
+               if (m_pInfo == NULL)
+                       hr = GetTI(lcid);
+               *ppInfo = m_pInfo;
+               if (m_pInfo != NULL)
+               {
+                       m_pInfo->AddRef();
+                       hr = S_OK;
+               }
+               return hr;
+       }
+       HRESULT GetTI(LCID lcid);
+       HRESULT EnsureTI(LCID lcid)
+       {
+               HRESULT hr = S_OK;
+               if (m_pInfo == NULL)
+                       hr = GetTI(lcid);
+               return hr;
+       }
+
+       // This function is called by the module on exit
+       // It is registered through _Module.AddTermFunc()
+       static void __stdcall Cleanup(DWORD dw)
+       {
+               CComTypeInfoHolder* p = (CComTypeInfoHolder*) dw;
+               if (p->m_pInfo != NULL)
+                       p->m_pInfo->Release();
+               p->m_pInfo = NULL;
+               delete [] p->m_pMap;
+               p->m_pMap = NULL;
+       }
+
+       HRESULT GetTypeInfo(UINT /* itinfo */, LCID lcid, ITypeInfo** pptinfo)
+       {
+               HRESULT hRes = E_POINTER;
+               if (pptinfo != NULL)
+                       hRes = GetTI(lcid, pptinfo);
+               return hRes;
+       }
+       HRESULT GetIDsOfNames(REFIID /* riid */, LPOLESTR* rgszNames, UINT cNames,
+               LCID lcid, DISPID* rgdispid)
+       {
+               HRESULT hRes = EnsureTI(lcid);
+               if (m_pInfo != NULL)
+               {
+                       for (int i=0; i<(int)cNames; i++)
+                       {
+                               int n = ocslen(rgszNames[i]);
+                               for (int 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))
+                                       {
+                                               rgdispid[i] = m_pMap[j].id;
+                                               break;
+                                       }
+                               }
+                               if (j < 0)
+                               {
+                                       hRes = m_pInfo->GetIDsOfNames(rgszNames + i, 1, &rgdispid[i]);
+                                       if (FAILED(hRes))
+                                               break;
+                               }
+                       }
+               }
+               return hRes;
+       }
+
+       HRESULT Invoke(IDispatch* p, DISPID dispidMember, REFIID /* riid */,
+               LCID lcid, WORD wFlags, DISPPARAMS* pdispparams, VARIANT* pvarResult,
+               EXCEPINFO* pexcepinfo, UINT* puArgErr)
+       {
+               HRESULT hRes = EnsureTI(lcid);
+               if (m_pInfo != NULL)
+                       hRes = m_pInfo->Invoke(p, dispidMember, wFlags, pdispparams, pvarResult, pexcepinfo, puArgErr);
+               return hRes;
+       }
+       HRESULT LoadNameCache(ITypeInfo* pTypeInfo)
+       {
+               TYPEATTR* pta;
+               HRESULT hr = pTypeInfo->GetTypeAttr(&pta);
+               if (SUCCEEDED(hr))
+               {
+                       m_nCount = pta->cFuncs;
+                       m_pMap = m_nCount == 0 ? 0 : new stringdispid[m_nCount];
+                       for (int i=0; i<m_nCount; i++)
+                       {
+                               FUNCDESC* pfd;
+                               if (SUCCEEDED(pTypeInfo->GetFuncDesc(i, &pfd)))
+                               {
+                                       CComBSTR bstrName;
+                                       if (SUCCEEDED(pTypeInfo->GetDocumentation(pfd->memid, &bstrName, NULL, NULL, NULL)))
+                                       {
+                                               m_pMap[i].bstr.Attach(bstrName.Detach());
+                                               m_pMap[i].nLen = SysStringLen(m_pMap[i].bstr);
+                                               m_pMap[i].id = pfd->memid;
+                                       }
+                                       pTypeInfo->ReleaseFuncDesc(pfd);
+                               }
+                       }
+                       pTypeInfo->ReleaseTypeAttr(pta);
+               }
+               return S_OK;
+       }
+};
+
+template <int nObtainMethod>
+inline HRESULT CComTypeInfoHolderModule<nObtainMethod>::GetTI(LCID lcid)
+{
+    USES_CONVERSION;
+       //If this assert occurs then most likely didn't initialize properly
+       ATLASSERT(m_plibid != NULL && m_pguid != NULL);
+       ATLASSERT(!::InlineIsEqualGUID(*m_plibid, GUID_NULL) && "Did you forget to pass the LIBID to CComModule::Init?");
+
+       if (m_pInfo != NULL)
+               return S_OK;
+       HRESULT hRes = E_FAIL;
+       EnterCriticalSection(&_Module.m_csTypeInfoHolder);
+       if (m_pInfo == NULL)
+       {
+               ITypeLib* pTypeLib;
+        hRes = E_FAIL;
+        TCHAR szModule[_MAX_PATH+10];
+        LPOLESTR lpszModule;
+        // Select the way
+        switch (nObtainMethod) {
+            case 2: // registry, module
+                hRes = LoadRegTypeLib(*m_plibid, m_wMajor, m_wMinor, lcid, &pTypeLib);
+            case 1: // module
+                if (SUCCEEDED(hRes)) break;
+            case 3: // module, registry
+                GetModuleFileName(_Module.m_hInstTypeLib, szModule, _MAX_PATH);
+                lpszModule = T2OLE(szModule);
+                hRes = LoadTypeLib(lpszModule, &pTypeLib);
+                if (nObtainMethod == 1) break;
+            default:
+                if (FAILED(hRes)) {
+                    hRes = LoadRegTypeLib(*m_plibid, m_wMajor, m_wMinor, lcid, &pTypeLib);
+                }
+        }
+               
+               if (SUCCEEDED(hRes))
+               {
+                       CComPtr<ITypeInfo> spTypeInfo;
+                       hRes = pTypeLib->GetTypeInfoOfGuid(*m_pguid, &spTypeInfo);
+                       if (SUCCEEDED(hRes))
+                       {
+                               CComPtr<ITypeInfo> spInfo(spTypeInfo);
+                               CComPtr<ITypeInfo2> spTypeInfo2;
+                               if (SUCCEEDED(spTypeInfo->QueryInterface(&spTypeInfo2)))
+                                       spInfo = spTypeInfo2;
+
+                               LoadNameCache(spInfo);
+                               m_pInfo = spInfo.Detach();
+                       }
+                       pTypeLib->Release();
+               }
+       }
+       LeaveCriticalSection(&_Module.m_csTypeInfoHolder);
+       _Module.AddTermFunc(Cleanup, (DWORD)this);
+       return hRes;
+}
+
+#endif // _NEWOBJECTS_ATL_TYPEINFOEX_H_
\ No newline at end of file
diff --git a/Plugins/src_VCPP/IgnoreFieldsTab/IgnoreFieldsTab.cpp b/Plugins/src_VCPP/IgnoreFieldsTab/IgnoreFieldsTab.cpp
new file mode 100644 (file)
index 0000000..ec7136e
--- /dev/null
@@ -0,0 +1,72 @@
+// IgnoreFieldsTab.cpp : Implementation of DLL Exports.
+
+
+// Note: Proxy/Stub Information
+//      To build a separate proxy/stub DLL, 
+//      run nmake -f IgnoreFieldsTabps.mk in the project directory.
+
+#include "stdafx.h"
+#include "resource.h"
+#include <initguid.h>
+#include "IgnoreFieldsTab.h"
+
+#include "IgnoreFieldsTab_i.c"
+#include "WinMergeScript.h"
+
+
+CComModule _Module;
+
+BEGIN_OBJECT_MAP(ObjectMap)
+OBJECT_ENTRY(CLSID_WinMergeScript, CWinMergeScript)
+END_OBJECT_MAP()
+
+/////////////////////////////////////////////////////////////////////////////
+// DLL Entry Point
+
+extern "C"
+BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/)
+{
+    if (dwReason == DLL_PROCESS_ATTACH)
+    {
+        _Module.Init(ObjectMap, hInstance, &LIBID_IgnoreFieldsTabLib);
+        DisableThreadLibraryCalls(hInstance);
+    }
+    else if (dwReason == DLL_PROCESS_DETACH)
+        _Module.Term();
+    return TRUE;    // ok
+}
+
+/////////////////////////////////////////////////////////////////////////////
+// Used to determine whether the DLL can be unloaded by OLE
+
+STDAPI DllCanUnloadNow(void)
+{
+    return (_Module.GetLockCount()==0) ? S_OK : S_FALSE;
+}
+
+/////////////////////////////////////////////////////////////////////////////
+// Returns a class factory to create an object of the requested type
+
+STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
+{
+    return _Module.GetClassObject(rclsid, riid, ppv);
+}
+
+/////////////////////////////////////////////////////////////////////////////
+// DllRegisterServer - Adds entries to the system registry
+
+STDAPI DllRegisterServer(void)
+{
+    // registers object, typelib and all interfaces in typelib
+    return _Module.RegisterServer(TRUE);
+}
+
+/////////////////////////////////////////////////////////////////////////////
+// DllUnregisterServer - Removes entries from the system registry
+
+STDAPI DllUnregisterServer(void)
+{
+    return _Module.UnregisterServer(TRUE);
+}
+
+
diff --git a/Plugins/src_VCPP/IgnoreFieldsTab/IgnoreFieldsTab.def b/Plugins/src_VCPP/IgnoreFieldsTab/IgnoreFieldsTab.def
new file mode 100644 (file)
index 0000000..192cc39
--- /dev/null
@@ -0,0 +1,9 @@
+; IgnoreFieldsTab.def : Declares the module parameters.
+
+LIBRARY      "IgnoreFieldsTab.DLL"
+
+EXPORTS
+       DllCanUnloadNow     @1 PRIVATE
+       DllGetClassObject   @2 PRIVATE
+       DllRegisterServer   @3 PRIVATE
+       DllUnregisterServer     @4 PRIVATE
diff --git a/Plugins/src_VCPP/IgnoreFieldsTab/IgnoreFieldsTab.dsp b/Plugins/src_VCPP/IgnoreFieldsTab/IgnoreFieldsTab.dsp
new file mode 100644 (file)
index 0000000..3d6bb4e
--- /dev/null
@@ -0,0 +1,242 @@
+# Microsoft Developer Studio Project File - Name="IgnoreFieldsTab" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
+
+CFG=IgnoreFieldsTab - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "IgnoreFieldsTab.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "IgnoreFieldsTab.mak" CFG="IgnoreFieldsTab - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "IgnoreFieldsTab - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "IgnoreFieldsTab - Win32 Unicode Debug" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "IgnoreFieldsTab - Win32 Release MinSize" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "IgnoreFieldsTab - Win32 Release MinDependency" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "IgnoreFieldsTab - Win32 Unicode Release MinSize" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "IgnoreFieldsTab - Win32 Unicode Release MinDependency" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=xicl6.exe
+MTL=midl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "IgnoreFieldsTab - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c
+# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c
+# ADD BASE RSC /l 0x40c /d "_DEBUG"
+# ADD RSC /l 0x40c /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=xilink6.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept
+
+!ELSEIF  "$(CFG)" == "IgnoreFieldsTab - Win32 Unicode Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "DebugU"
+# PROP BASE Intermediate_Dir "DebugU"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "DebugU"
+# PROP Intermediate_Dir "DebugU"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c
+# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c
+# ADD BASE RSC /l 0x40c /d "_DEBUG"
+# ADD RSC /l 0x40c /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=xilink6.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept
+
+!ELSEIF  "$(CFG)" == "IgnoreFieldsTab - Win32 Release MinSize"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "ReleaseMinSize"
+# PROP BASE Intermediate_Dir "ReleaseMinSize"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "ReleaseMinSize"
+# PROP Intermediate_Dir "ReleaseMinSize"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD BASE RSC /l 0x40c /d "NDEBUG"
+# ADD RSC /l 0x40c /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=xilink6.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386
+
+!ELSEIF  "$(CFG)" == "IgnoreFieldsTab - Win32 Release MinDependency"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "ReleaseMinDependency"
+# PROP BASE Intermediate_Dir "ReleaseMinDependency"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "ReleaseMinDependency"
+# PROP Intermediate_Dir "ReleaseMinDependency"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD BASE RSC /l 0x40c /d "NDEBUG"
+# ADD RSC /l 0x40c /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=xilink6.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386
+
+!ELSEIF  "$(CFG)" == "IgnoreFieldsTab - Win32 Unicode Release MinSize"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "ReleaseUMinSize"
+# PROP BASE Intermediate_Dir "ReleaseUMinSize"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "ReleaseUMinSize"
+# PROP Intermediate_Dir "ReleaseUMinSize"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD BASE RSC /l 0x40c /d "NDEBUG"
+# ADD RSC /l 0x40c /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=xilink6.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386
+
+!ELSEIF  "$(CFG)" == "IgnoreFieldsTab - Win32 Unicode Release MinDependency"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "ReleaseUMinDependency"
+# PROP BASE Intermediate_Dir "ReleaseUMinDependency"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "ReleaseUMinDependency"
+# PROP Intermediate_Dir "ReleaseUMinDependency"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD BASE RSC /l 0x40c /d "NDEBUG"
+# ADD RSC /l 0x40c /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=xilink6.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386
+
+!ENDIF 
+
+# Begin Target
+
+# Name "IgnoreFieldsTab - Win32 Debug"
+# Name "IgnoreFieldsTab - Win32 Unicode Debug"
+# Name "IgnoreFieldsTab - Win32 Release MinSize"
+# Name "IgnoreFieldsTab - Win32 Release MinDependency"
+# Name "IgnoreFieldsTab - Win32 Unicode Release MinSize"
+# Name "IgnoreFieldsTab - Win32 Unicode Release MinDependency"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\IgnoreFieldsTab.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\IgnoreFieldsTab.def
+# End Source File
+# Begin Source File
+
+SOURCE=.\IgnoreFieldsTab.idl
+# ADD MTL /tlb ".\IgnoreFieldsTab.tlb" /h "IgnoreFieldsTab.h" /iid "IgnoreFieldsTab_i.c" /Oicf
+# End Source File
+# Begin Source File
+
+SOURCE=.\IgnoreFieldsTab.rc
+# End Source File
+# Begin Source File
+
+SOURCE=.\StdAfx.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\WinMergeScript.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=.\Resource.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\StdAfx.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\typeinfoex.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\WinMergeScript.h
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# Begin Source File
+
+SOURCE=.\WinMergeScript.rgs
+# End Source File
+# End Group
+# End Target
+# End Project
diff --git a/Plugins/src_VCPP/IgnoreFieldsTab/IgnoreFieldsTab.idl b/Plugins/src_VCPP/IgnoreFieldsTab/IgnoreFieldsTab.idl
new file mode 100644 (file)
index 0000000..1694c52
--- /dev/null
@@ -0,0 +1,43 @@
+// IgnoreFieldsTab.idl : IDL source for IgnoreFieldsTab.dll
+//
+
+// This file will be processed by the MIDL tool to
+// produce the type library (IgnoreFieldsTab.tlb) and marshalling code.
+
+import "oaidl.idl";
+import "ocidl.idl";
+       [
+               object,
+               uuid(DAFE8196-A8BD-47F1-9D0C-7299D93105E7),
+               dual,
+               helpstring("IWinMergeScript Interface"),
+               pointer_default(unique)
+       ]
+       interface IWinMergeScript : IDispatch
+       {
+               [propget, id(1), helpstring("property PluginEvent")] HRESULT PluginEvent([out, retval] BSTR *pVal);
+               [propget, id(2), helpstring("property PluginDescription")] HRESULT PluginDescription([out, retval] BSTR *pVal);
+               [propget, id(3), helpstring("property PluginFileFilters")] HRESULT PluginFileFilters([out, retval] BSTR *pVal);
+               [propget, id(4), helpstring("property PluginIsAutomatic")] HRESULT PluginIsAutomatic([out, retval] VARIANT_BOOL *pVal);
+               [id(5), helpstring("method PrediffBufferW")] HRESULT PrediffBufferW([in] BSTR * pText, [in] INT * pSize, [in] VARIANT_BOOL * pbChanged, [out, retval] VARIANT_BOOL * pbHandled);
+       };
+
+[
+       uuid(7039A486-4E6F-4A1E-80BE-BCEA359ADA72),
+       version(1.0),
+       helpstring("IgnoreFieldsTab 1.0 Type Library")
+]
+library IgnoreFieldsTabLib
+{
+       importlib("stdole32.tlb");
+       importlib("stdole2.tlb");
+
+       [
+               uuid(EA7D4D55-FBCC-41C0-933A-7DD5F3E5E641),
+               helpstring("WinMergeScript Class")
+       ]
+       coclass WinMergeScript
+       {
+               [default] interface IWinMergeScript;
+       };
+};
diff --git a/Plugins/src_VCPP/IgnoreFieldsTab/IgnoreFieldsTab.rc b/Plugins/src_VCPP/IgnoreFieldsTab/IgnoreFieldsTab.rc
new file mode 100644 (file)
index 0000000..aea7ed5
--- /dev/null
@@ -0,0 +1,117 @@
+//Microsoft Developer Studio generated resource script.
+//
+#include "resource.h"
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+#include "winres.h"
+
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+// French (France) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_FRA)
+#ifdef _WIN32
+LANGUAGE LANG_FRENCH, SUBLANG_FRENCH
+#pragma code_page(1252)
+#endif //_WIN32
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE DISCARDABLE 
+BEGIN
+    "resource.h\0"
+END
+
+2 TEXTINCLUDE DISCARDABLE 
+BEGIN
+    "#include ""winres.h""\r\n"
+    "\0"
+END
+
+3 TEXTINCLUDE DISCARDABLE 
+BEGIN
+    "1 TYPELIB ""IgnoreFieldsTab.tlb""\r\n"
+    "\0"
+END
+
+#endif    // APSTUDIO_INVOKED
+
+
+#ifndef _MAC
+/////////////////////////////////////////////////////////////////////////////
+//
+// Version
+//
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION 1,0,0,1
+ PRODUCTVERSION 1,0,0,1
+ FILEFLAGSMASK 0x3fL
+#ifdef _DEBUG
+ FILEFLAGS 0x1L
+#else
+ FILEFLAGS 0x0L
+#endif
+ FILEOS 0x4L
+ FILETYPE 0x2L
+ FILESUBTYPE 0x0L
+BEGIN
+    BLOCK "StringFileInfo"
+    BEGIN
+        BLOCK "040904B0"
+        BEGIN
+            VALUE "CompanyName", "\0"
+            VALUE "FileDescription", "IgnoreFieldsTab Module\0"
+            VALUE "FileVersion", "1, 0, 0, 1\0"
+            VALUE "InternalName", "IgnoreFieldsTab\0"
+            VALUE "LegalCopyright", "Copyright 2003\0"
+            VALUE "OriginalFilename", "IgnoreFieldsTab.DLL\0"
+            VALUE "ProductName", "IgnoreFieldsTab Module\0"
+            VALUE "ProductVersion", "1, 0, 0, 1\0"
+            VALUE "OLESelfRegister", "\0"
+        END
+    END
+    BLOCK "VarFileInfo"
+    BEGIN
+        VALUE "Translation", 0x409, 1200
+    END
+END
+
+#endif    // !_MAC
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// String Table
+//
+
+STRINGTABLE DISCARDABLE 
+BEGIN
+    IDS_PROJNAME            "IgnoreFieldsTab"
+END
+
+#endif    // French (France) resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+1 TYPELIB "IgnoreFieldsTab.tlb"
+
+/////////////////////////////////////////////////////////////////////////////
+#endif    // not APSTUDIO_INVOKED
+
diff --git a/Plugins/src_VCPP/IgnoreFieldsTab/Resource.h b/Plugins/src_VCPP/IgnoreFieldsTab/Resource.h
new file mode 100644 (file)
index 0000000..fc78c24
--- /dev/null
@@ -0,0 +1,17 @@
+//{{NO_DEPENDENCIES}}
+// Microsoft Developer Studio generated include file.
+// Used by IgnoreFieldsTab.rc
+//
+#define IDS_PROJNAME                    100
+#define IDR_WINMERGESCRIPT              101
+
+// Next default values for new objects
+// 
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE        201
+#define _APS_NEXT_COMMAND_VALUE         32768
+#define _APS_NEXT_CONTROL_VALUE         201
+#define _APS_NEXT_SYMED_VALUE           102
+#endif
+#endif
diff --git a/Plugins/src_VCPP/IgnoreFieldsTab/StdAfx.cpp b/Plugins/src_VCPP/IgnoreFieldsTab/StdAfx.cpp
new file mode 100644 (file)
index 0000000..a5eea17
--- /dev/null
@@ -0,0 +1,12 @@
+// stdafx.cpp : source file that includes just the standard includes
+//  stdafx.pch will be the pre-compiled header
+//  stdafx.obj will contain the pre-compiled type information
+
+#include "stdafx.h"
+
+#ifdef _ATL_STATIC_REGISTRY
+#include <statreg.h>
+#include <statreg.cpp>
+#endif
+
+#include <atlimpl.cpp>
diff --git a/Plugins/src_VCPP/IgnoreFieldsTab/StdAfx.h b/Plugins/src_VCPP/IgnoreFieldsTab/StdAfx.h
new file mode 100644 (file)
index 0000000..f4acf49
--- /dev/null
@@ -0,0 +1,27 @@
+// stdafx.h : include file for standard system include files,
+//      or project specific include files that are used frequently,
+//      but are changed infrequently
+
+#if !defined(AFX_STDAFX_H__1A520598_1E89_4BFA_98CD_7628B0C3DAA0__INCLUDED_)
+#define AFX_STDAFX_H__1A520598_1E89_4BFA_98CD_7628B0C3DAA0__INCLUDED_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+#define STRICT
+#ifndef _WIN32_WINNT
+#define _WIN32_WINNT 0x0400
+#endif
+#define _ATL_APARTMENT_THREADED
+
+#include <atlbase.h>
+//You may derive a class from CComModule and use it if you want to override
+//something, but do not change the name of _Module
+extern CComModule _Module;
+#include <atlcom.h>
+
+//{{AFX_INSERT_LOCATION}}
+// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
+
+#endif // !defined(AFX_STDAFX_H__1A520598_1E89_4BFA_98CD_7628B0C3DAA0__INCLUDED)
diff --git a/Plugins/src_VCPP/IgnoreFieldsTab/WinMergeScript.cpp b/Plugins/src_VCPP/IgnoreFieldsTab/WinMergeScript.cpp
new file mode 100644 (file)
index 0000000..5be1627
--- /dev/null
@@ -0,0 +1,224 @@
+// WinMergeScript.cpp : Implementation of CWinMergeScript
+#include "stdafx.h"
+#include "IgnoreFieldsTab.h"
+#include "WinMergeScript.h"
+
+/////////////////////////////////////////////////////////////////////////////
+// CWinMergeScript
+
+
+/** 
+ * @brief Get the name of the current dll
+ */
+LPTSTR GetDllFilename(LPTSTR name, int len)
+{
+       // careful for the last char, the doc does not give this detail
+       name[len] = 0;
+       GetModuleFileName(_Module.GetModuleInstance(), name, len-1);
+       // find last backslash
+       TCHAR * lastslash = _tcsrchr(name, _T('//'));
+       if (lastslash == 0)             
+               lastslash = name;
+       else
+               lastslash ++;
+       TCHAR * lastslash2 = _tcsrchr(lastslash, _T('\\'));
+       if (lastslash2 == 0)            
+               lastslash2 = name;
+       else
+               lastslash2 ++;
+       if (lastslash2 != name)
+               strcpy(name, lastslash2);
+       return name;
+}
+
+
+int CreateArrayFromFilename(int (* value)[2])
+{
+       TCHAR name[256+1];
+       GetDllFilename(name, 256);
+
+       // first pass : prepare the chunks
+       int nValue = 0;
+       TCHAR * token = _tcstok(name, _T(",_"));
+       while( token != NULL )
+       {
+               nValue ++;
+               /* Get next token: */
+               token = _tcstok( NULL, _T(",_") );
+       }
+
+       // pass first chunk 
+       nValue --;
+
+       if (value == 0)
+               // just return the number of values
+               return nValue;
+
+       if (nValue == 0)
+               return nValue;
+
+       token = name + _tcslen(name) + 1;       // pass first chunk 
+       int i;
+       for (i = 0 ; i < nValue ; i++)
+       {
+               value[i][0] = _tcstol(token, &token, 10);
+               while (*token != 0 && !_istdigit(*token))
+                       token ++;
+               if (token[0] == 0)
+               {
+                       value[i][1] = value[i][0];
+               }
+               else
+               {
+                       value[i][1] = _tcstol(token, &token, 10);
+               }
+               token = token + _tcslen(token) + 1;
+       }
+
+       return nValue;
+}
+
+
+STDMETHODIMP CWinMergeScript::get_PluginEvent(BSTR *pVal)
+{
+       *pVal = SysAllocString(L"BUFFER_PREDIFF");
+       return S_OK;
+}
+
+STDMETHODIMP CWinMergeScript::get_PluginDescription(BSTR *pVal)
+{
+       *pVal = SysAllocString(L"Ignore some fields - ignored fields list from the plugin name");
+       return S_OK;
+}
+
+// not used yet
+STDMETHODIMP CWinMergeScript::get_PluginFileFilters(BSTR *pVal)
+{
+       *pVal = SysAllocString(L"\\.txt$");
+       return S_OK;
+}
+
+// not used yet
+STDMETHODIMP CWinMergeScript::get_PluginIsAutomatic(VARIANT_BOOL *pVal)
+{
+       *pVal = VARIANT_TRUE;
+       return S_OK;
+}
+
+
+STDMETHODIMP CWinMergeScript::PrediffBufferW(BSTR *pText, INT *pSize, VARIANT_BOOL *pbChanged, VARIANT_BOOL *pbHandled)
+{
+       WCHAR * pBeginText = *pText;
+       long nSize = *pSize;
+       WCHAR * pEndText = pBeginText + nSize;
+
+
+       int nExcludedRanges = CreateArrayFromFilename(NULL);
+       int (* aExcludedRanges)[2] = new int[nExcludedRanges][2];
+       if (aExcludedRanges == NULL)
+               nExcludedRanges = 0;
+       else
+               nExcludedRanges = CreateArrayFromFilename(aExcludedRanges);
+
+       if (nExcludedRanges == 0)
+       {
+               *pbChanged = VARIANT_FALSE;
+               *pbHandled = VARIANT_TRUE;
+               return S_OK;
+       }
+
+       // first column is 1 for user, but is 0 here
+       int i;
+       for (i = 0 ; i < nExcludedRanges ; i++)
+       {
+               aExcludedRanges[i][0] --;
+               aExcludedRanges[i][1] --;
+       }
+
+
+       WCHAR * pDst = pBeginText;
+       WCHAR * columnBegin;
+
+       // change this to change the delimiter between fields
+       const WCHAR delimiter = L'\t';
+
+       // order of the column in the current line
+       int iColumn = 0;
+       // next excluded column range in the current line
+       int nextExcludedRange = 0;
+
+       for (columnBegin = pBeginText; columnBegin < pEndText ; )
+       {
+
+               // search for the end of the column (columnEnd = first excluded character)
+               WCHAR * columnEnd = columnBegin;
+               while (columnEnd < pEndText &&
+                               *columnEnd != L'\n' &&
+                               *columnEnd != L'\r' &&
+                               *columnEnd != delimiter)
+                       columnEnd ++;
+
+               // determine the status of this column
+               if (nextExcludedRange < nExcludedRanges && iColumn > aExcludedRanges[nextExcludedRange][1])
+                       nextExcludedRange ++;
+               BOOL bIsColumnIncluded = TRUE;
+               if (nextExcludedRange < nExcludedRanges && iColumn >= aExcludedRanges[nextExcludedRange][0])
+                       bIsColumnIncluded = FALSE;
+
+               // copy the characters of included columns
+               if (bIsColumnIncluded)
+               {
+                       wcsncpy(pDst, columnBegin, columnEnd - columnBegin);
+                       pDst += columnEnd - columnBegin;
+               }
+
+               // advance the cursor
+               columnBegin = columnEnd;
+
+               // keep possible tabulation (only one)
+               if (columnBegin < pEndText)
+                       if (*columnBegin == delimiter)
+                       {
+                               // copy the tabulation
+                               *pDst = delimiter;
+                               pDst ++;
+                               // advance the cursor
+                               columnBegin ++;
+                               // next column
+                               iColumn ++;
+                       }
+
+               // keep possible EOL characters 
+               WCHAR * eolEnd = columnBegin;
+               while (eolEnd < pEndText && (*eolEnd == L'\n' || *eolEnd == L'\r'))
+               {
+                       eolEnd ++;
+               }
+
+               if (eolEnd > columnBegin)
+               {
+                       // copy the EOL characters
+                       wcsncpy(pDst, columnBegin, eolEnd - columnBegin);
+                       pDst += eolEnd - columnBegin;
+                       // advance the cursor
+                       columnBegin = eolEnd;
+                       // reset the column counter
+                       iColumn = 0;
+                       nextExcludedRange = 0;
+               }
+       }
+
+
+       delete [] aExcludedRanges;
+
+       // set the new size
+       *pSize = pDst - pBeginText;
+
+       if (*pSize == nSize)
+               *pbChanged = VARIANT_FALSE;
+       else
+               *pbChanged = VARIANT_TRUE;
+
+       *pbHandled = VARIANT_TRUE;
+       return S_OK;
+}
diff --git a/Plugins/src_VCPP/IgnoreFieldsTab/WinMergeScript.h b/Plugins/src_VCPP/IgnoreFieldsTab/WinMergeScript.h
new file mode 100644 (file)
index 0000000..e2ec4e8
--- /dev/null
@@ -0,0 +1,47 @@
+// WinMergeScript.h : Declaration of the CWinMergeScript
+
+#ifndef __WINMERGESCRIPT_H_
+#define __WINMERGESCRIPT_H_
+
+#include "resource.h"       // main symbols
+
+// change 1 : add this include
+#include "typeinfoex.h"
+
+/////////////////////////////////////////////////////////////////////////////
+// CWinMergeScript
+
+// change 2 : add this
+typedef CComTypeInfoHolderModule<1>  CComTypeInfoHolderFileOnly;
+
+class ATL_NO_VTABLE CWinMergeScript : 
+       public CComObjectRootEx<CComSingleThreadModel>,
+       public CComCoClass<CWinMergeScript, &CLSID_WinMergeScript>,
+// change 3 : insert the text ", 1, 0, CComTypeInfoHolderFileOnly" 
+       // public IDispatchImpl<IWinMergeScript, &IID_IWinMergeScript, &LIBID_IgnoreFieldsTabLib>
+       public IDispatchImpl<IWinMergeScript, &IID_IWinMergeScript, &LIBID_IgnoreFieldsTabLib, 1, 0, CComTypeInfoHolderFileOnly>
+{
+public:
+       CWinMergeScript()
+       {
+       }
+
+DECLARE_REGISTRY_RESOURCEID(IDR_WINMERGESCRIPT)
+
+DECLARE_PROTECT_FINAL_CONSTRUCT()
+
+BEGIN_COM_MAP(CWinMergeScript)
+       COM_INTERFACE_ENTRY(IWinMergeScript)
+       COM_INTERFACE_ENTRY(IDispatch)
+END_COM_MAP()
+
+// IWinMergeScript
+public:
+       STDMETHOD(PrediffBufferW)(/*[in]*/ BSTR * pText, /*[in]*/ INT * pSize, /*[in]*/ VARIANT_BOOL * pbChanged, /*[out, retval]*/ VARIANT_BOOL * pbHandled);
+       STDMETHOD(get_PluginIsAutomatic)(/*[out, retval]*/ VARIANT_BOOL *pVal);
+       STDMETHOD(get_PluginFileFilters)(/*[out, retval]*/ BSTR *pVal);
+       STDMETHOD(get_PluginDescription)(/*[out, retval]*/ BSTR *pVal);
+       STDMETHOD(get_PluginEvent)(/*[out, retval]*/ BSTR *pVal);
+};
+
+#endif //__WINMERGESCRIPT_H_
diff --git a/Plugins/src_VCPP/IgnoreFieldsTab/typeinfoex.h b/Plugins/src_VCPP/IgnoreFieldsTab/typeinfoex.h
new file mode 100644 (file)
index 0000000..edac4d1
--- /dev/null
@@ -0,0 +1,207 @@
+#ifndef _NEWOBJECTS_ATL_TYPEINFOEX_H_
+#define _NEWOBJECTS_ATL_TYPEINFOEX_H_
+
+// This class is a little changed version of the
+// CComTypeInfoHolder class found in the MS ATL
+// It supports different ways to obtain type info
+// depending on the CComTypeInfoHolder parameter:
+// 
+//  0   - Acts as the Normal CComTypeInfoHolder i.e. loading from the registry only
+//  1   - Loads only from the module resource
+//  2   - Try registry and if not found load from the module
+//  3   - Try from the module and if not found then from the registry
+//
+//  Use this class in the IDispatchImpl templates passed as parent
+//  classes to your components if you want to create components
+//  capable of working with scripts without registration in the
+//  system registry
+//
+//  Michael Elfial, newObjects 2001
+//  http://www.newobjects.com
+
+template <int nObtainMethod = 1>
+class CComTypeInfoHolderModule {
+public:
+       const GUID* m_pguid;
+       const GUID* m_plibid;
+       WORD m_wMajor;
+       WORD m_wMinor;
+
+       ITypeInfo* m_pInfo;
+       long m_dwRef;
+       struct stringdispid
+       {
+               CComBSTR bstr;
+               int nLen;
+               DISPID id;
+       };
+       stringdispid* m_pMap;
+       int m_nCount;
+
+public:
+       HRESULT GetTI(LCID lcid, ITypeInfo** ppInfo)
+       {
+               HRESULT hr = S_OK;
+               if (m_pInfo == NULL)
+                       hr = GetTI(lcid);
+               *ppInfo = m_pInfo;
+               if (m_pInfo != NULL)
+               {
+                       m_pInfo->AddRef();
+                       hr = S_OK;
+               }
+               return hr;
+       }
+       HRESULT GetTI(LCID lcid);
+       HRESULT EnsureTI(LCID lcid)
+       {
+               HRESULT hr = S_OK;
+               if (m_pInfo == NULL)
+                       hr = GetTI(lcid);
+               return hr;
+       }
+
+       // This function is called by the module on exit
+       // It is registered through _Module.AddTermFunc()
+       static void __stdcall Cleanup(DWORD dw)
+       {
+               CComTypeInfoHolder* p = (CComTypeInfoHolder*) dw;
+               if (p->m_pInfo != NULL)
+                       p->m_pInfo->Release();
+               p->m_pInfo = NULL;
+               delete [] p->m_pMap;
+               p->m_pMap = NULL;
+       }
+
+       HRESULT GetTypeInfo(UINT /* itinfo */, LCID lcid, ITypeInfo** pptinfo)
+       {
+               HRESULT hRes = E_POINTER;
+               if (pptinfo != NULL)
+                       hRes = GetTI(lcid, pptinfo);
+               return hRes;
+       }
+       HRESULT GetIDsOfNames(REFIID /* riid */, LPOLESTR* rgszNames, UINT cNames,
+               LCID lcid, DISPID* rgdispid)
+       {
+               HRESULT hRes = EnsureTI(lcid);
+               if (m_pInfo != NULL)
+               {
+                       for (int i=0; i<(int)cNames; i++)
+                       {
+                               int n = ocslen(rgszNames[i]);
+                               for (int 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))
+                                       {
+                                               rgdispid[i] = m_pMap[j].id;
+                                               break;
+                                       }
+                               }
+                               if (j < 0)
+                               {
+                                       hRes = m_pInfo->GetIDsOfNames(rgszNames + i, 1, &rgdispid[i]);
+                                       if (FAILED(hRes))
+                                               break;
+                               }
+                       }
+               }
+               return hRes;
+       }
+
+       HRESULT Invoke(IDispatch* p, DISPID dispidMember, REFIID /* riid */,
+               LCID lcid, WORD wFlags, DISPPARAMS* pdispparams, VARIANT* pvarResult,
+               EXCEPINFO* pexcepinfo, UINT* puArgErr)
+       {
+               HRESULT hRes = EnsureTI(lcid);
+               if (m_pInfo != NULL)
+                       hRes = m_pInfo->Invoke(p, dispidMember, wFlags, pdispparams, pvarResult, pexcepinfo, puArgErr);
+               return hRes;
+       }
+       HRESULT LoadNameCache(ITypeInfo* pTypeInfo)
+       {
+               TYPEATTR* pta;
+               HRESULT hr = pTypeInfo->GetTypeAttr(&pta);
+               if (SUCCEEDED(hr))
+               {
+                       m_nCount = pta->cFuncs;
+                       m_pMap = m_nCount == 0 ? 0 : new stringdispid[m_nCount];
+                       for (int i=0; i<m_nCount; i++)
+                       {
+                               FUNCDESC* pfd;
+                               if (SUCCEEDED(pTypeInfo->GetFuncDesc(i, &pfd)))
+                               {
+                                       CComBSTR bstrName;
+                                       if (SUCCEEDED(pTypeInfo->GetDocumentation(pfd->memid, &bstrName, NULL, NULL, NULL)))
+                                       {
+                                               m_pMap[i].bstr.Attach(bstrName.Detach());
+                                               m_pMap[i].nLen = SysStringLen(m_pMap[i].bstr);
+                                               m_pMap[i].id = pfd->memid;
+                                       }
+                                       pTypeInfo->ReleaseFuncDesc(pfd);
+                               }
+                       }
+                       pTypeInfo->ReleaseTypeAttr(pta);
+               }
+               return S_OK;
+       }
+};
+
+template <int nObtainMethod>
+inline HRESULT CComTypeInfoHolderModule<nObtainMethod>::GetTI(LCID lcid)
+{
+    USES_CONVERSION;
+       //If this assert occurs then most likely didn't initialize properly
+       ATLASSERT(m_plibid != NULL && m_pguid != NULL);
+       ATLASSERT(!::InlineIsEqualGUID(*m_plibid, GUID_NULL) && "Did you forget to pass the LIBID to CComModule::Init?");
+
+       if (m_pInfo != NULL)
+               return S_OK;
+       HRESULT hRes = E_FAIL;
+       EnterCriticalSection(&_Module.m_csTypeInfoHolder);
+       if (m_pInfo == NULL)
+       {
+               ITypeLib* pTypeLib;
+        hRes = E_FAIL;
+        TCHAR szModule[_MAX_PATH+10];
+        LPOLESTR lpszModule;
+        // Select the way
+        switch (nObtainMethod) {
+            case 2: // registry, module
+                hRes = LoadRegTypeLib(*m_plibid, m_wMajor, m_wMinor, lcid, &pTypeLib);
+            case 1: // module
+                if (SUCCEEDED(hRes)) break;
+            case 3: // module, registry
+                GetModuleFileName(_Module.m_hInstTypeLib, szModule, _MAX_PATH);
+                lpszModule = T2OLE(szModule);
+                hRes = LoadTypeLib(lpszModule, &pTypeLib);
+                if (nObtainMethod == 1) break;
+            default:
+                if (FAILED(hRes)) {
+                    hRes = LoadRegTypeLib(*m_plibid, m_wMajor, m_wMinor, lcid, &pTypeLib);
+                }
+        }
+               
+               if (SUCCEEDED(hRes))
+               {
+                       CComPtr<ITypeInfo> spTypeInfo;
+                       hRes = pTypeLib->GetTypeInfoOfGuid(*m_pguid, &spTypeInfo);
+                       if (SUCCEEDED(hRes))
+                       {
+                               CComPtr<ITypeInfo> spInfo(spTypeInfo);
+                               CComPtr<ITypeInfo2> spTypeInfo2;
+                               if (SUCCEEDED(spTypeInfo->QueryInterface(&spTypeInfo2)))
+                                       spInfo = spTypeInfo2;
+
+                               LoadNameCache(spInfo);
+                               m_pInfo = spInfo.Detach();
+                       }
+                       pTypeLib->Release();
+               }
+       }
+       LeaveCriticalSection(&_Module.m_csTypeInfoHolder);
+       _Module.AddTermFunc(Cleanup, (DWORD)this);
+       return hRes;
+}
+
+#endif // _NEWOBJECTS_ATL_TYPEINFOEX_H_
\ No newline at end of file