From 63f15d7585fc844613b9ab0c1ba296e13ccc7e7b Mon Sep 17 00:00:00 2001 From: Takashi Sawanaka Date: Wed, 8 Nov 2023 21:33:46 +0900 Subject: [PATCH 01/58] Replace the source code written in VBScript with JScript --- Plugins/dlls/insert datetime.sct | 42 ++++++++++++++++---------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/Plugins/dlls/insert datetime.sct b/Plugins/dlls/insert datetime.sct index ea14b73ee96..0fa8ec66415 100644 --- a/Plugins/dlls/insert datetime.sct +++ b/Plugins/dlls/insert datetime.sct @@ -17,33 +17,33 @@ - From 2f2aae44dcdefd4d4453b9baaeb81859e74cd5f7 Mon Sep 17 00:00:00 2001 From: Takashi Sawanaka Date: Mon, 15 Jan 2024 23:11:26 +0900 Subject: [PATCH 02/58] WIP --- ALL.vs2022.sln | 1 + Plugins/dlls/IgnoreLeadingLineNumbers.sct | 166 ++++++++++------------ Src/Plugins.cpp | 24 +++- 3 files changed, 101 insertions(+), 90 deletions(-) diff --git a/ALL.vs2022.sln b/ALL.vs2022.sln index 962d42912d2..001a1b9ab81 100644 --- a/ALL.vs2022.sln +++ b/ALL.vs2022.sln @@ -204,6 +204,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Scripts", "Scripts", "{32E7 Plugins\dlls\CompareMSVisioFiles.sct = Plugins\dlls\CompareMSVisioFiles.sct Plugins\dlls\CompareMSWordFiles.sct = Plugins\dlls\CompareMSWordFiles.sct Plugins\dlls\editor addin.sct = Plugins\dlls\editor addin.sct + Plugins\dlls\IgnoreLeadingLineNumbers.sct = Plugins\dlls\IgnoreLeadingLineNumbers.sct Plugins\dlls\insert datetime.sct = Plugins\dlls\insert datetime.sct Plugins\dlls\PrediffLineFilter.sct = Plugins\dlls\PrediffLineFilter.sct EndProjectSection diff --git a/Plugins/dlls/IgnoreLeadingLineNumbers.sct b/Plugins/dlls/IgnoreLeadingLineNumbers.sct index 1de507d270e..f6db638aaa2 100644 --- a/Plugins/dlls/IgnoreLeadingLineNumbers.sct +++ b/Plugins/dlls/IgnoreLeadingLineNumbers.sct @@ -19,107 +19,95 @@ - diff --git a/Src/Plugins.cpp b/Src/Plugins.cpp index 6d56dc3692a..51ab3eba7f8 100644 --- a/Src/Plugins.cpp +++ b/Src/Plugins.cpp @@ -1358,7 +1358,29 @@ bool InvokePrediffBuffer(BSTR & bstrBuf, int & nChanged, IDispatch *piScript) // VARIANT_BOOL DiffingPreprocessW(BSTR * buffer, UINT * nSize, VARIANT_BOOL * bChanged) HRESULT h = ::safeInvokeW(piScript, &vboolHandled, L"PrediffBufferW", opFxn[3], vpboolChanged, vpiSize, vpbstrBuf); - bool bSuccess = ! FAILED(h) && vboolHandled.boolVal; + bool bSuccess = !FAILED(h); + if (bSuccess) + { + if (vboolHandled.vt == (VT_ARRAY | VT_VARIANT)) + { + long ubound = 0; + SafeArrayGetUBound(vboolHandled.parray, 1, &ubound); + VARIANT* p; + SafeArrayAccessData(vboolHandled.parray, reinterpret_cast(&p)); + if (ubound >= 3) + { + bSuccess = p[0].boolVal; + SysFreeString(bstrBuf); + bstrBuf = SysAllocStringLen(p[1].bstrVal, SysStringLen(p[1].bstrVal)); + nBufSize = p[2].iVal; + changed = p[3].boolVal; + } + } + else + { + bSuccess = vboolHandled.boolVal; + } + } if (bSuccess && changed) { // remove trailing charracters in the rare case that bstrBuf was not resized From 68788d226466dd9782f4633afc91f5e5c0e8e884 Mon Sep 17 00:00:00 2001 From: Takashi Sawanaka Date: Tue, 16 Jan 2024 09:16:30 +0900 Subject: [PATCH 03/58] WIP --- Src/Common/lwdisp.c | 171 ++++++++++++++++++++++++++++---------------- Src/Plugins.cpp | 24 +------ 2 files changed, 112 insertions(+), 83 deletions(-) diff --git a/Src/Common/lwdisp.c b/Src/Common/lwdisp.c index 3830cc70ff8..1273edaad56 100644 --- a/Src/Common/lwdisp.c +++ b/Src/Common/lwdisp.c @@ -350,6 +350,93 @@ LPDISPATCH NTAPI CreateDispatchBySource(LPCTSTR source, LPCWSTR progid) return (LPDISPATCH)pv; } +static BOOL NeedsConversion(LPDISPATCH pi, DISPID id, VARIANT *argv, int cArgs) +{ + BOOL bParamByRef = FALSE; + BOOL bNeedToConv = FALSE; + int i; + + for (i = 0; i < cArgs; i++) + { + if (V_ISBYREF(&argv[i])) + { + bParamByRef = TRUE; + break; + } + } + if (bParamByRef) + { + ITypeInfo* pTypeInfo; + HRESULT hr; + + hr = pi->lpVtbl->GetTypeInfo(pi, 0, 0, &pTypeInfo); + if (SUCCEEDED(hr)) + { + FUNCDESC* pFuncDesc = NULL; + ITypeInfo2* pTypeInfo2 = NULL; + pTypeInfo->lpVtbl->QueryInterface(pTypeInfo, &IID_ITypeInfo2, &pTypeInfo2); + if (pTypeInfo2 != NULL) + { + UINT nIndex; + hr = pTypeInfo2->lpVtbl->GetFuncIndexOfMemId(pTypeInfo2, id, INVOKE_FUNC, &nIndex); + if (SUCCEEDED(hr)) + { + hr = pTypeInfo->lpVtbl->GetFuncDesc(pTypeInfo, nIndex, &pFuncDesc); + if (SUCCEEDED(hr)) + { + if (pFuncDesc->oVft == 0) + bNeedToConv = TRUE; + pTypeInfo->lpVtbl->ReleaseFuncDesc(pTypeInfo, pFuncDesc); + } + } + pTypeInfo2->lpVtbl->Release(pTypeInfo2); + } + pTypeInfo->lpVtbl->Release(pTypeInfo); + } + } + return bNeedToConv; +} + +static void MoveVariantValue(VARIANT* dst, VARIANT* src) +{ + if ((V_VT(dst) & ~VT_BYREF) == VT_BSTR && V_VT(src) == VT_BSTR) + { + SysFreeString(*V_BSTRREF(dst)); + *V_BSTRREF(dst) = V_BSTR(src); + V_VT(src) = VT_EMPTY; + return; + } + VARIANT varTemp; + VariantInit(&varTemp); + VariantChangeType(&varTemp, src, 0, (unsigned short)(V_VT(dst) & ~VT_BYREF)); + switch (V_VT(dst) & ~VT_BYREF) { + case VT_BOOL: + *V_BOOLREF(dst) = V_BOOL(&varTemp); + break; + case VT_I1: + *V_I2REF(dst) = V_I1(&varTemp); + break; + case VT_I2: + *V_I2REF(dst) = V_I2(&varTemp); + break; + case VT_I4: + *V_I4REF(dst) = V_I4(&varTemp); + break; + case VT_R4: + *V_R4REF(dst) = V_R4(&varTemp); + break; + case VT_R8: + *V_R8REF(dst) = V_R8(&varTemp); + break; + case VT_BSTR: + SysFreeString(*V_BSTRREF(dst)); + *V_BSTRREF(dst) = V_BSTR(&varTemp); + V_VT(&varTemp) = VT_EMPTY; + break; + } + VariantClear(&varTemp); +} + STDAPI invokeV(LPDISPATCH pi, VARIANT *ret, DISPID id, LPCCH op, VARIANT *argv) { HRESULT sc = E_FAIL; @@ -368,51 +455,10 @@ STDAPI invokeV(LPDISPATCH pi, VARIANT *ret, DISPID id, LPCCH op, VARIANT *argv) } if (pi != NULL) { - BOOL bParamByRef = FALSE; - BOOL bNeedToConv = FALSE; VARIANT varParams[12] = { 0 }; VARIANT varData[12] = { 0 }; + BOOL bNeedToConv = NeedsConversion(pi, id, argv, dispparams.cArgs); int i; - - for (i = 0; i < (int)dispparams.cArgs; i++) - { - if (V_ISBYREF(&argv[i])) - { - bParamByRef = TRUE; - break; - } - } - if (bParamByRef) - { - ITypeInfo *pTypeInfo; - HRESULT hr; - - hr = pi->lpVtbl->GetTypeInfo(pi, 0, 0, &pTypeInfo); - if (SUCCEEDED(hr)) - { - FUNCDESC* pFuncDesc = NULL; - ITypeInfo2 *pTypeInfo2 = NULL; - pTypeInfo->lpVtbl->QueryInterface(pTypeInfo, &IID_ITypeInfo2, &pTypeInfo2); - if (pTypeInfo2 != NULL) - { - UINT nIndex; - hr = pTypeInfo2->lpVtbl->GetFuncIndexOfMemId(pTypeInfo2, id, INVOKE_FUNC, &nIndex); - if (SUCCEEDED(hr)) - { - hr = pTypeInfo->lpVtbl->GetFuncDesc(pTypeInfo, nIndex, &pFuncDesc); - if (SUCCEEDED(hr)) - { - if (pFuncDesc->oVft == 0) - bNeedToConv = TRUE; - pTypeInfo->lpVtbl->ReleaseFuncDesc(pTypeInfo, pFuncDesc); - } - } - pTypeInfo2->lpVtbl->Release(pTypeInfo2); - } - pTypeInfo->lpVtbl->Release(pTypeInfo); - } - } - if (bNeedToConv) { for (i = 0; i < (int)dispparams.cArgs; i++) @@ -453,27 +499,32 @@ STDAPI invokeV(LPDISPATCH pi, VARIANT *ret, DISPID id, LPCCH op, VARIANT *argv) { if (bNeedToConv) { - for (i = 0; i < (int)dispparams.cArgs; i++) + if (V_VT(ret) == (VT_ARRAY | VT_VARIANT)) { - if (V_ISBYREF(&argv[i])) + long ubound = 0; + SafeArrayGetUBound(V_ARRAY(ret), 1, &ubound); + VARIANT* p = NULL; + int j = ubound; + SafeArrayAccessData(V_ARRAY(ret), (void**)(&p)); + for (i = 0; i < (int)dispparams.cArgs; i++) { - VARIANT varTemp; - VariantInit(&varTemp); - VariantChangeType(&varTemp, &varData[i], 0, (unsigned short)(V_VT(&argv[i]) & ~VT_BYREF)); - switch(V_VT(&varTemp)) { - case VT_BOOL: *V_BOOLREF(&argv[i]) = V_BOOL(&varTemp); break; - case VT_I1: *V_I2REF(&argv[i]) = V_I1(&varTemp); break; - case VT_I2: *V_I2REF(&argv[i]) = V_I2(&varTemp); break; - case VT_I4: *V_I4REF(&argv[i]) = V_I4(&varTemp); break; - case VT_R4: *V_R4REF(&argv[i]) = V_R4(&varTemp); break; - case VT_R8: *V_R8REF(&argv[i]) = V_R8(&varTemp); break; - case VT_BSTR: - SysFreeString(*V_BSTRREF(&argv[i])); - *V_BSTRREF(&argv[i]) = V_BSTR(&varTemp); - break; - } + if (V_ISBYREF(&argv[i]) && j > 0) + MoveVariantValue(&argv[i], &p[j--]); + VariantClear(&varParams[i]); + } + VARIANT_BOOL bResult = V_BOOL(&p[0]); + VariantClear(ret); + V_BOOL(ret) = bResult; + V_VT(ret) = VT_BOOL; + } + else + { + for (i = 0; i < (int)dispparams.cArgs; i++) + { + if (V_ISBYREF(&argv[i])) + MoveVariantValue(&argv[i], &varData[i]); + VariantClear(&varParams[i]); } - VariantClear(&varParams[i]); } } } diff --git a/Src/Plugins.cpp b/Src/Plugins.cpp index 51ab3eba7f8..6d56dc3692a 100644 --- a/Src/Plugins.cpp +++ b/Src/Plugins.cpp @@ -1358,29 +1358,7 @@ bool InvokePrediffBuffer(BSTR & bstrBuf, int & nChanged, IDispatch *piScript) // VARIANT_BOOL DiffingPreprocessW(BSTR * buffer, UINT * nSize, VARIANT_BOOL * bChanged) HRESULT h = ::safeInvokeW(piScript, &vboolHandled, L"PrediffBufferW", opFxn[3], vpboolChanged, vpiSize, vpbstrBuf); - bool bSuccess = !FAILED(h); - if (bSuccess) - { - if (vboolHandled.vt == (VT_ARRAY | VT_VARIANT)) - { - long ubound = 0; - SafeArrayGetUBound(vboolHandled.parray, 1, &ubound); - VARIANT* p; - SafeArrayAccessData(vboolHandled.parray, reinterpret_cast(&p)); - if (ubound >= 3) - { - bSuccess = p[0].boolVal; - SysFreeString(bstrBuf); - bstrBuf = SysAllocStringLen(p[1].bstrVal, SysStringLen(p[1].bstrVal)); - nBufSize = p[2].iVal; - changed = p[3].boolVal; - } - } - else - { - bSuccess = vboolHandled.boolVal; - } - } + bool bSuccess = ! FAILED(h) && vboolHandled.boolVal; if (bSuccess && changed) { // remove trailing charracters in the rare case that bstrBuf was not resized From 0037eea5e08d7c38727708372e673bb2c094552d Mon Sep 17 00:00:00 2001 From: Takashi Sawanaka Date: Tue, 16 Jan 2024 21:02:13 +0900 Subject: [PATCH 04/58] WIP --- Plugins/dlls/IgnoreLeadingLineNumbers.sct | 22 ++++------------------ Src/Common/lwdisp.c | 1 + 2 files changed, 5 insertions(+), 18 deletions(-) diff --git a/Plugins/dlls/IgnoreLeadingLineNumbers.sct b/Plugins/dlls/IgnoreLeadingLineNumbers.sct index f6db638aaa2..28410b09427 100644 --- a/Plugins/dlls/IgnoreLeadingLineNumbers.sct +++ b/Plugins/dlls/IgnoreLeadingLineNumbers.sct @@ -71,25 +71,11 @@ function PrediffBufferW(text, size, bChanged) { var eol = (matches != null) ? matches[0] : "\r\n"; var lines = text.split(eol); for (var l = 0; l < lines.length; l++) { - var bLineHasStarted = true; - var sTemp = ""; - var line = lines[l]; - for (var i = 0; i < line.length; i++) { // For all chars... - var sChar = line.substr(i, 1); - switch (sChar) { - case "N": case "n": case "1": case "2": case "3": case "4": case "5": case "6": case "7": case "8": case "9": case "0": // N or number... - if (bLineHasStarted) { // if line has started... - sChar = ""; - bChanged = true; - } - break; - default: - bLineHasStarted = false; - break; - } - sTemp += sChar; + var line = lines[l].replace(/^[Nn0123456789]+/, ''); + if (line !== lines[l]) { + lines[l] = line; + bChanged = true; } - lines[l] = sTemp; } if (bChanged) { // if text has changed... diff --git a/Src/Common/lwdisp.c b/Src/Common/lwdisp.c index 1273edaad56..ca0b5dd294d 100644 --- a/Src/Common/lwdisp.c +++ b/Src/Common/lwdisp.c @@ -511,6 +511,7 @@ STDAPI invokeV(LPDISPATCH pi, VARIANT *ret, DISPID id, LPCCH op, VARIANT *argv) if (V_ISBYREF(&argv[i]) && j > 0) MoveVariantValue(&argv[i], &p[j--]); VariantClear(&varParams[i]); + VariantClear(&varData[i]); } VARIANT_BOOL bResult = V_BOOL(&p[0]); VariantClear(ret); From 2e2ea851221262b967e74010143ed95cff9042fc Mon Sep 17 00:00:00 2001 From: Takashi Sawanaka Date: Thu, 18 Jan 2024 09:19:30 +0900 Subject: [PATCH 05/58] WIP --- Plugins/dlls/IgnoreLeadingLineNumbers.sct | 2 +- Plugins/dlls/PrediffLineFilter.sct | 380 ++++++++++------------ Src/MergeAppCOMClass.cpp | 8 +- Src/MergeAppCOMClass.h | 19 +- 4 files changed, 190 insertions(+), 219 deletions(-) diff --git a/Plugins/dlls/IgnoreLeadingLineNumbers.sct b/Plugins/dlls/IgnoreLeadingLineNumbers.sct index 28410b09427..7c6889970c7 100644 --- a/Plugins/dlls/IgnoreLeadingLineNumbers.sct +++ b/Plugins/dlls/IgnoreLeadingLineNumbers.sct @@ -52,7 +52,7 @@ function get_PluginDescription() { } function get_PluginFileFilters() { - return "\.nc$"; + return "\\.nc$"; } function get_PluginIsAutomatic() { diff --git a/Plugins/dlls/PrediffLineFilter.sct b/Plugins/dlls/PrediffLineFilter.sct index 75cd77fe777..73cdc410bec 100644 --- a/Plugins/dlls/PrediffLineFilter.sct +++ b/Plugins/dlls/PrediffLineFilter.sct @@ -20,221 +20,185 @@ - +/* + This is a plugin for WinMerge. + It does almost the same thing as Substitution filters. + Copyright (C) 2018-2023 Takashi Sawanaka - diff --git a/Src/MergeAppCOMClass.cpp b/Src/MergeAppCOMClass.cpp index 0112e1fe37f..94055a34d75 100644 --- a/Src/MergeAppCOMClass.cpp +++ b/Src/MergeAppCOMClass.cpp @@ -8,9 +8,9 @@ static PARAMDATA paramData_Translate[] = { { L"text", VT_BSTR, }, }; static PARAMDATA paramData_GetOption[] = -{ { L"name", VT_BSTR }, { L"defaultValue", VT_VARIANT|VT_BYREF }, }; +{ { L"name", VT_BSTR }, { L"defaultValue", VT_VARIANT}, }; static PARAMDATA paramData_SaveOption[] = -{ { L"name", VT_BSTR }, { L"value", VT_VARIANT|VT_BYREF }, }; +{ { L"name", VT_BSTR }, { L"value", VT_VARIANT}, }; static METHODDATA methodData_MergeApp[] = { { L"Translate", paramData_Translate, DISPID_Translate, 3, CC_STDCALL, 1, DISPATCH_METHOD, VT_BSTR }, @@ -34,7 +34,7 @@ BSTR STDMETHODCALLTYPE MergeAppCOMClass::Translate(BSTR text) return SysAllocString(tr(text).c_str()); } -VARIANT STDMETHODCALLTYPE MergeAppCOMClass::GetOption(BSTR name, const VARIANT& varDefault) +VARIANT STDMETHODCALLTYPE MergeAppCOMClass::GetOption(BSTR name, VARIANT varDefault) { VARIANT varResult; VariantInit(&varResult); @@ -85,7 +85,7 @@ VARIANT STDMETHODCALLTYPE MergeAppCOMClass::GetOption(BSTR name, const VARIANT& return varResult; } -void STDMETHODCALLTYPE MergeAppCOMClass::SaveOption(BSTR name, const VARIANT& varValue) +void STDMETHODCALLTYPE MergeAppCOMClass::SaveOption(BSTR name, VARIANT varValue) { auto value = GetOptionsMgr()->Get(name); const VARIANT* pvar = ((varValue.vt & VT_BYREF) != 0) ? varValue.pvarVal : &varValue; diff --git a/Src/MergeAppCOMClass.h b/Src/MergeAppCOMClass.h index cd7b9c19686..d8a5b8c4be3 100644 --- a/Src/MergeAppCOMClass.h +++ b/Src/MergeAppCOMClass.h @@ -33,7 +33,14 @@ class MyDispatch : public T, public IDispatch HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void** ppvObject) override { - return E_NOTIMPL; + if (riid == IID_IUnknown || riid == IID_IDispatch) + { + *ppvObject = static_cast(this); + AddRef(); + return S_OK; + } + *ppvObject = nullptr; + return E_NOINTERFACE; } ULONG STDMETHODCALLTYPE AddRef(void) override @@ -68,7 +75,7 @@ class MyDispatch : public T, public IDispatch HRESULT STDMETHODCALLTYPE Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS* pDispParams, VARIANT* pVarResult, EXCEPINFO* pExcepInfo, UINT* puArgErr) override { - return m_pTypeInfo->Invoke(this, dispIdMember, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr); + return m_pTypeInfo->Invoke(static_cast(this), dispIdMember, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr); } protected: ULONG m_cRef; @@ -78,8 +85,8 @@ class MyDispatch : public T, public IDispatch struct IMergeApp : public IUnknown { virtual BSTR STDMETHODCALLTYPE Translate(BSTR text) = 0; - virtual VARIANT STDMETHODCALLTYPE GetOption(BSTR name, const VARIANT& varDefault) = 0; - virtual void STDMETHODCALLTYPE SaveOption(BSTR name, const VARIANT& varValue) = 0; + virtual VARIANT STDMETHODCALLTYPE GetOption(BSTR name, VARIANT varDefault) = 0; + virtual void STDMETHODCALLTYPE SaveOption(BSTR name, VARIANT varValue) = 0; }; class MergeAppCOMClass : public MyDispatch @@ -91,7 +98,7 @@ class MergeAppCOMClass : public MyDispatch MergeAppCOMClass& operator=(const MergeAppCOMClass&) = delete; BSTR STDMETHODCALLTYPE Translate(BSTR text) override; - VARIANT STDMETHODCALLTYPE GetOption(BSTR name, const VARIANT& varDefault) override; - void STDMETHODCALLTYPE SaveOption(BSTR name, const VARIANT& varValue) override; + VARIANT STDMETHODCALLTYPE GetOption(BSTR name, VARIANT varDefault) override; + void STDMETHODCALLTYPE SaveOption(BSTR name, VARIANT varValue) override; }; From ae998ff8aca1f194d52ee6cd23f7cf98dceef067 Mon Sep 17 00:00:00 2001 From: Takashi Sawanaka Date: Thu, 18 Jan 2024 19:42:33 +0900 Subject: [PATCH 06/58] WIP --- Plugins/dlls/PrediffLineFilter.sct | 37 ++++++++++++++++-------------- Src/MergeAppCOMClass.cpp | 10 +++++++- Src/MergeAppCOMClass.h | 3 +++ 3 files changed, 32 insertions(+), 18 deletions(-) diff --git a/Plugins/dlls/PrediffLineFilter.sct b/Plugins/dlls/PrediffLineFilter.sct index 73cdc410bec..0621939ee78 100644 --- a/Plugins/dlls/PrediffLineFilter.sct +++ b/Plugins/dlls/PrediffLineFilter.sct @@ -81,48 +81,51 @@ function PluginOnEvent(eventType, obj) { function PrediffBufferW(pText, pSize, pbChanged) { if (pText == "") { - pbChanged = false var result = new ActiveXObject("Scripting.Dictionary"); result.Add(0, true); - result.Add(1, pText); - result.Add(2, pSize); - result.Add(3, pbChanged); + result.Add(1, ""); + result.Add(2, 0); + result.Add(3, false); return result.Items(); } var pattern, replaceText, ignoreCase; - var lines = pText.split(pText, "\n"); - var count = regRead(REGKEY_PATH & "Count", 0); + var lines = pText.split("\n"); + var count = regRead(REGKEY_PATH + "Count", 0); for (var i = 1; i <= count; i++) { - if (regRead(REGKEY_PATH & "Enabled" & i, true)) { - pattern = regRead(REGKEY_PATH & "Pattern" & i, ""); - ignoreCase = regRead(REGKEY_PATH & "IgnoreCase" & i, false); - replaceText = regRead(REGKEY_PATH & "ReplaceText" & i, ""); - if (regRead(REGKEY_PATH & "UseRegExp" & i, true)) { + if (regRead(REGKEY_PATH + "Enabled" + i, true)) { + pattern = regRead(REGKEY_PATH + "Pattern" + i, ""); + ignoreCase = regRead(REGKEY_PATH + "IgnoreCase" + i, false); + replaceText = regRead(REGKEY_PATH + "ReplaceText" + i, ""); + if (regRead(REGKEY_PATH + "UseRegExp" + i, true)) { var re = new RegExp(pattern, ignoreCase ? "gi" : "g"); - for (var j = 0; j < lines.length; j++) + for (var j = 0; j < lines.length; j++) { lines[j] = lines[j].replace(re, replaceText); + } } else { - for (var j = 0; j < lines.length; j++) + for (var j = 0; j < lines.length; j++) { lines[j] = replacei(lines[j], pattern, replaceText, ignoreCase); + } } } } pbChanged = true; var result = new ActiveXObject("Scripting.Dictionary"); + pText = lines.join("\n"); + pSize = pText.length; result.Add(0, true); - result.Add(1, lines.join('\n')); - result.Add(2, pText.length); + result.Add(1, pText); + result.Add(2, pSize); result.Add(3, pbChanged); return result.Items(); } function replacei(text, find, replace, ignorecase) { if (!ignorecase) - return this.split(str).join(replace); + return text.split(find).join(replace); var textLower = text.toLowerCase(); var findLower = find.toLowerCase(); var pos = textLower.length; - while ((pos = textLower.lastIndexOf(findLower, pos)) != -1) { + while (pos >= 0 && (pos = textLower.lastIndexOf(findLower, pos)) >= 0) { text = text.substr(0, pos) + replace + text.substr(pos + findLower.length); pos--; } diff --git a/Src/MergeAppCOMClass.cpp b/Src/MergeAppCOMClass.cpp index 94055a34d75..3513af99c0c 100644 --- a/Src/MergeAppCOMClass.cpp +++ b/Src/MergeAppCOMClass.cpp @@ -6,16 +6,19 @@ #include "MergeApp.h" static PARAMDATA paramData_Translate[] = -{ { L"text", VT_BSTR, }, }; +{ { L"text", VT_BSTR }, }; static PARAMDATA paramData_GetOption[] = { { L"name", VT_BSTR }, { L"defaultValue", VT_VARIANT}, }; static PARAMDATA paramData_SaveOption[] = { { L"name", VT_BSTR }, { L"value", VT_VARIANT}, }; +static PARAMDATA paramData_Log[] = +{ { L"level", VT_I4 }, { L"text", VT_BSTR }, }; static METHODDATA methodData_MergeApp[] = { { L"Translate", paramData_Translate, DISPID_Translate, 3, CC_STDCALL, 1, DISPATCH_METHOD, VT_BSTR }, { L"GetOption", paramData_GetOption, DISPID_GetOption, 4, CC_STDCALL, 2, DISPATCH_METHOD, VT_VARIANT }, { L"SaveOption", paramData_SaveOption, DISPID_SaveOption, 5, CC_STDCALL, 2, DISPATCH_METHOD, VT_NULL }, + { L"Log", paramData_Log, DISPID_Log, 6, CC_STDCALL, 2, DISPATCH_METHOD, VT_NULL }, }; static INTERFACEDATA idata_MergeApp = { methodData_MergeApp, static_cast(std::size(methodData_MergeApp)) }; @@ -138,3 +141,8 @@ void STDMETHODCALLTYPE MergeAppCOMClass::SaveOption(BSTR name, VARIANT varValue) } return; } + +void STDMETHODCALLTYPE MergeAppCOMClass::Log(int level, BSTR text) +{ + LogErrorString(text); +} diff --git a/Src/MergeAppCOMClass.h b/Src/MergeAppCOMClass.h index d8a5b8c4be3..cb611bfaa66 100644 --- a/Src/MergeAppCOMClass.h +++ b/Src/MergeAppCOMClass.h @@ -7,6 +7,7 @@ enum DISPID_Translate = 1, DISPID_GetOption = 2, DISPID_SaveOption = 3, + DISPID_Log = 4, }; @@ -87,6 +88,7 @@ struct IMergeApp : public IUnknown virtual BSTR STDMETHODCALLTYPE Translate(BSTR text) = 0; virtual VARIANT STDMETHODCALLTYPE GetOption(BSTR name, VARIANT varDefault) = 0; virtual void STDMETHODCALLTYPE SaveOption(BSTR name, VARIANT varValue) = 0; + virtual void STDMETHODCALLTYPE Log(int level, BSTR text) = 0; }; class MergeAppCOMClass : public MyDispatch @@ -100,5 +102,6 @@ class MergeAppCOMClass : public MyDispatch BSTR STDMETHODCALLTYPE Translate(BSTR text) override; VARIANT STDMETHODCALLTYPE GetOption(BSTR name, VARIANT varDefault) override; void STDMETHODCALLTYPE SaveOption(BSTR name, VARIANT varValue) override; + void STDMETHODCALLTYPE Log(int level, BSTR text) override; }; From 39444fe0dfd11aa0dbfdf3f46f94a7b53bdcaf3d Mon Sep 17 00:00:00 2001 From: Takashi Sawanaka Date: Thu, 18 Jan 2024 21:14:03 +0900 Subject: [PATCH 07/58] WIP --- Plugins/dlls/CompareMSExcelFiles.sct | 1495 +++++++++++++------------- Plugins/dlls/PrediffLineFilter.sct | 2 +- 2 files changed, 735 insertions(+), 762 deletions(-) diff --git a/Plugins/dlls/CompareMSExcelFiles.sct b/Plugins/dlls/CompareMSExcelFiles.sct index 7067ed201e7..01f1821dd6c 100644 --- a/Plugins/dlls/CompareMSExcelFiles.sct +++ b/Plugins/dlls/CompareMSExcelFiles.sct @@ -1,739 +1,712 @@ - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + - +function saveSheetAsImage(sht, basefilename) { + var rngUsed, rngImage, row, rowEnd, column, columnEnd, filename, numX, numY, imageWidth, imageHeight + imageWidth = regRead(REGKEY_PATH + "ImageWidth", 1000) + imageHeight = regRead(REGKEY_PATH + "ImageHeight", 3000) + rngUsed = getUsedRangeIncludingShapes(sht) + numX = 1 + column = rngUsed.Column + Do + columnEnd = findColumnByPosition(sht, column, rngUsed.Column + rngUsed.Columns.Count - 1, imageWidth) + numY = 1 + row = rngUsed.Row + Do + rowEnd = findRowByPosition(sht, row, rngUsed.Row + rngUsed.Rows.Count - 1, imageHeight) + rngImage = sht.Range(sht.Cells(row, column), sht.Cells(rowEnd, columnEnd)) + filename = basefilename + "(" + numX + "-" + numY + ").png" + if (Not saveRangeAsImage(sht, rngImage, filename)) { + var shtNew + shtNew = sht.Parent.Sheets.Add + shtNew.Range("A1") = getTimeStamp() + ": Error" + Err.Number + ": " + Err.Description + shtNew.Columns.AutoFit + saveRangeAsImage shtNew, shtNew.Range("A1"), filename + shtNew.Delete + } + row = rowEnd + 1 + numY = numY + 1 + Loop While row < rngUsed.row + rngUsed.Rows.Count - 1 + column = columnEnd + 1 + numX = numX + 1 + Loop While column < rngUsed.column + rngUsed.Columns.Count - 1 +} - @@ -913,66 +886,66 @@ function importSettingsFromXMLFile(filepath) -
-
    -
  • - - -
  • -
  • - - -
  • -
  • - - -
  • -
  • - - -
  • -
  • - - -
  • -
  • - - -
      -
    • - - - x - -
    • -
    -
  • -
  • - - -
  • -
  • - - -
  • -
  • - - -
  • -
  • - - -
  • -
  • - - -
  • -
-
- - -
-
+
+
    +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
  • + + +
      +
    • + + + x + +
    • +
    +
  • +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
+
+ + +
+
]]> diff --git a/Plugins/dlls/PrediffLineFilter.sct b/Plugins/dlls/PrediffLineFilter.sct index 0621939ee78..a7856427fa9 100644 --- a/Plugins/dlls/PrediffLineFilter.sct +++ b/Plugins/dlls/PrediffLineFilter.sct @@ -253,7 +253,7 @@ function importSettingsFromXMLFile(filepath) { ts.Close(); var nodes = doc.documentElement.childNodes; for (var i = 0; i < nodes.length; i++) { - regWrite(nodes[i].getAttribute("name"), nodes[i].text, (nodes[i].getAttribute("type") === "string") ? "REG_SZ" : "REG_DWORD"); + regWrite(nodes[i].getAttribute("name"), nodes[i].text, (nodes[i].getAttribute("type") === "string") ? "REG_SZ" : "REG_DWORD"); } return settings; } From c4709947b82026280c8683a580293f095f9b11f9 Mon Sep 17 00:00:00 2001 From: Takashi Sawanaka Date: Fri, 19 Jan 2024 08:56:05 +0900 Subject: [PATCH 08/58] WIP --- Plugins/dlls/CompareMSExcelFiles.sct | 133 +++++++++++++-------------- 1 file changed, 66 insertions(+), 67 deletions(-) diff --git a/Plugins/dlls/CompareMSExcelFiles.sct b/Plugins/dlls/CompareMSExcelFiles.sct index 01f1821dd6c..49d4e556960 100644 --- a/Plugins/dlls/CompareMSExcelFiles.sct +++ b/Plugins/dlls/CompareMSExcelFiles.sct @@ -60,11 +60,11 @@ var wsh = new ActiveXObject("WScript.Shell"); var mergeApp; function isAccessibleVBAProject(wbk) { - var count = -1; try { - count = wbk.VBProject.VBComponents.Count; - } catch (e) {} - return (count > 0); + return (wbk.VBProject.VBComponents.Count > 0); + } catch (e) { + return false; + } } function regRead(Key, DefaultValue) { @@ -87,67 +87,67 @@ function writeObjectProperties(fo, items) { } catch (e) {} } -/* -function QuoteIfNeeded(str) { +function quoteIfNeeded(str) { var fQuote; - if (InStr(str, vbTab) > 0) { + if (str.indexOf("\t") >= 0) { fQuote = true; - } else if (InStr(str, """") > 0) { + } else if (str.indexOf("\"") >= 0) { fQuote = true; - } else if (InStr(str, vbLf) > 0) { + } else if (str.indexOf("\n") >= 0) { fQuote = true; } if (fQuote) { - return """" + Replace(str, """", """""") + """"; - } else { { + return "\"" + str.replace(/\"/g, "\"\"") + "\""; + } else { return str; } } function writeCellValues(fo, sht) { - var varCells, row, col, ary() - varCells = sht.UsedRange.Value - if (TypeName(varCells) = "String") { - fo.WriteLine QuoteIfNeeded(varCells) - } else if ( (Not IsEmpty(varCells)) { - Revar ary(UBound(varCells, 2)) + var varCells = sht.UsedRange.Value; + if (typeof(varCells) === "string" || typeof(varCells) === "number" || typeof(varCells) === "date") { + fo.WriteLine(quoteIfNeeded(varCells)); + } else if (varCells !== undefined) { + var ary = new Array(varCells.ubound(2)); try { - For row = 1 To UBound(varCells, 1) - For col = 1 To UBound(varCells, 2) - ary(col - 1) = QuoteIfNeeded(CStr(varCells(row, col))) - if (Err.Number <> 0) { - ary(col - 1) = "Error" + Err.Number - Err.Clear + for (var row = 1; row <= varCells.ubound(1); row++) { + for (var col = 1; col <= varCells.ubound(2); col++) { + try { + var val = varCells.getItem(row, col); + ary[col - 1] = (val !== undefined) ? quoteIfNeeded(val.toString()) : ""; + } catch (e) { + ary[col - 1] = "Error" + e.number; + } } + fo.WriteLine(ary.join("\t")); } - fo.WriteLine Join(ary, vbTab) - } + } catch (e) {} } } -function GetAddr(row, col) { - var c - c = col - 1 - Do - GetAddr = Chr(65 + (c Mod 26)) + GetAddr - c = (c \ 26) - 1 - Loop While c >= 0 - GetAddr = GetAddr + row +function getAddr(row, col) { + var addr = ""; + var c = col - 1; + do { + addr = String.fromCharCode(65 + (c % 26)) + addr; + c = Math.floor(c / 26) - 1; + } while (c >= 0); + return addr + row; } function writeFormulas(fo, sht) { - var row, col, rowOffset, colOffset, varCells, formula - rowOffset = sht.UsedRange.Row - colOffset = sht.UsedRange.Column - varCells = sht.UsedRange.Formula - if (TypeName(varCells) = "String") { - fo.WriteLine GetAddr(rowOffset - 1, colOffset - 1) + ": " + varCells + var row, col, formula + var rowOffset = sht.UsedRange.Row; + var colOffset = sht.UsedRange.Column; + var varCells = sht.UsedRange.Formula; + if (typeof(varCells) === "string" || typeof(varCells) === "number" || typeof(varCells) === "date") { + fo.WriteLine(getAddr(rowOffset - 1, colOffset - 1) + ": " + varCells); } else { - For row = 1 To UBound(varCells, 1) - For col = 1 To UBound(varCells, 2) - formula = varCells(row, col) - if (Left(formula, 1) = "=") { - fo.WriteLine GetAddr(row + rowOffset - 1, col + colOffset - 1) + ": " + formula + for (var row = 1; row <= varCells.ubound(1); row++) { + for (var col = 1; col <= varCells.ubound(2); col++) { + var formula = varCells.getItem(row, col); + if (typeof(formula) === "string" && formula.charAt(0) === "=") { + fo.WriteLine(getAddr(row + rowOffset - 1, col + colOffset - 1) + ": " + formula); } } } @@ -155,21 +155,20 @@ function writeFormulas(fo, sht) { } function getUsedRangeIncludingShapes(sht) { - var shp, rng - var col_max, row_max - col_max = 0 - row_max = 0 - For Each shp In sht.Shapes - rng = shp.BottomRightCell - if (row_max < rng.Row + rng.Rows.Count - 1) { row_max = rng.Row + rng.Rows.Count - 1 - if (col_max < rng.Column + rng.Columns.Count - 1) { col_max = rng.Column + rng.Columns.Count - 1 + var col_max = 0; + var row_max = 0; + for (var shp = new Enumerator(sht.Shapes); !shp.atEnd(); shp.moveNext()) { + rng = shp.item().BottomRightCell; + if (row_max < rng.Row + rng.Rows.Count - 1) { row_max = rng.Row + rng.Rows.Count - 1 } + if (col_max < rng.Column + rng.Columns.Count - 1) { col_max = rng.Column + rng.Columns.Count - 1 } } - rng = sht.UsedRange - if (row_max < rng.Row + rng.Rows.Count - 1) { row_max = rng.Row + rng.Rows.Count - 1 - if (col_max < rng.Column + rng.Columns.Count - 1) { col_max = rng.Column + rng.Columns.Count - 1 - getUsedRangeIncludingShapes = sht.Range("A1", sht.Cells(row_max, col_max)) + var rng = sht.UsedRange; + if (row_max < rng.Row + rng.Rows.Count - 1) { row_max = rng.Row + rng.Rows.Count - 1; } + if (col_max < rng.Column + rng.Columns.Count - 1) { col_max = rng.Column + rng.Columns.Count - 1; } + return sht.Range("A1", sht.Cells(row_max, col_max)); } +/* Sub ungroupShapes(sht) { try { var cnt, shp @@ -192,12 +191,12 @@ function writeTextsInShapes(fo, sht) { function writeHeadersAndFooters(fo, sht) { try { - fo.WriteLine "LeftHeader: " + sht.PageSetup.LeftHeader - fo.WriteLine "CenterHeader: " + sht.PageSetup.CenterHeader - fo.WriteLine "RightHeader: " + sht.PageSetup.RightHeader - fo.WriteLine "LeftFooter: " + sht.PageSetup.LeftFooter - fo.WriteLine "CenterFooter: " + sht.PageSetup.CenterFooter - fo.WriteLine "RightFooter: " + sht.PageSetup.RightFooter + fo.WriteLine("LeftHeader: " + sht.PageSetup.LeftHeader); + fo.WriteLine("CenterHeader: " + sht.PageSetup.CenterHeader); + fo.WriteLine("RightHeader: " + sht.PageSetup.RightHeader); + fo.WriteLine("LeftFooter: " + sht.PageSetup.LeftFooter); + fo.WriteLine("CenterFooter: " + sht.PageSetup.CenterFooter); + fo.WriteLine("RightFooter: " + sht.PageSetup.RightFooter); } catch(e) {} } @@ -212,7 +211,7 @@ function getModuleExtension(cmp) { } } -function Sleep(sec) { +function sleep(sec) { if (sec == 0) return; wsh.Run("ping.exe localhost -n " + sec, 0, true); @@ -256,20 +255,20 @@ function saveRangeAsImage(sht, rng, filename) { if (sht.Application.Version < 14) { rng.CopyPicture 1, 2 ' xlScreen=1, xlBitmap=2 if (Err.Number == 0) { - Sleep i + sleep i obj.Paste obj.Export filename, "PNG" } else if ( (i == 0) { - Sleep 1 + sleep 1 } } else { rng.Copy if (Err.Number == 0) { - Sleep i + sleep i shtNew.Pictures.Paste obj.Export filename, "PNG" } else if ( (i == 0) { - Sleep 1 + sleep 1 } } From 18d11aebc63d4f49709377524ccebb4515cc4cbc Mon Sep 17 00:00:00 2001 From: Takashi Sawanaka Date: Fri, 19 Jan 2024 22:34:59 +0900 Subject: [PATCH 09/58] WIP --- Plugins/dlls/CompareMSExcelFiles.sct | 262 +++++++++++++-------------- 1 file changed, 131 insertions(+), 131 deletions(-) diff --git a/Plugins/dlls/CompareMSExcelFiles.sct b/Plugins/dlls/CompareMSExcelFiles.sct index 49d4e556960..0c8108bfaa8 100644 --- a/Plugins/dlls/CompareMSExcelFiles.sct +++ b/Plugins/dlls/CompareMSExcelFiles.sct @@ -32,7 +32,7 @@ /* This is a plugin for WinMerge. It will display the text content of MS Excel files. - Copyright (C) 2005-2023 Takashi Sawanaka + Copyright (C) 2005-2024 Takashi Sawanaka This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -81,8 +81,8 @@ function get_PluginEvent() { function writeObjectProperties(fo, items) { try { - for (var o = new Enumerator(items); !o.atEnd(); o.moveNext()) { - fo.WriteLine(o.item().Name + ": " + o.item().Value); + for (var it = new Enumerator(items), o = it.item(); !it.atEnd(); it.moveNext(), o = it.item()) { + fo.WriteLine(o.Name + ": " + o.Value); } } catch (e) {} } @@ -157,8 +157,8 @@ function writeFormulas(fo, sht) { function getUsedRangeIncludingShapes(sht) { var col_max = 0; var row_max = 0; - for (var shp = new Enumerator(sht.Shapes); !shp.atEnd(); shp.moveNext()) { - rng = shp.item().BottomRightCell; + for (var it = new Enumerator(sht.Shapes), shp = it.item(); !it.atEnd(); it.moveNext(), shp = it.item()) { + rng = shp.BottomRightCell; if (row_max < rng.Row + rng.Rows.Count - 1) { row_max = rng.Row + rng.Rows.Count - 1 } if (col_max < rng.Column + rng.Columns.Count - 1) { col_max = rng.Column + rng.Columns.Count - 1 } } @@ -168,25 +168,26 @@ function getUsedRangeIncludingShapes(sht) { return sht.Range("A1", sht.Cells(row_max, col_max)); } -/* -Sub ungroupShapes(sht) { +function ungroupShapes(sht) { try { - var cnt, shp - Do - cnt = sht.Shapes.Count - For Each shp In sht.Shapes - if (shp.Type == pbGroup) { shp.ungroup - } - Loop While cnt <> sht.Shapes.Count + var cnt; + do { + cnt = sht.Shapes.Count; + for (var it = new Enumerator(sht.Shapes), shp = it.item(); !itShp.atEnd(); itShp.moveNext(), shp = it.item()) { + if (shp.Type == pbGroup) { + shp.Ungroup(); + } + } + } while (cnt != sht.Shapes.Count); + } catch (e) {} } function writeTextsInShapes(fo, sht) { - var shp try { - For Each shp In sht.Shapes - fo.WriteLine shp.Name + ": " + shp.TextFrame.Characters.Text - } - On Error GoTo 0 + for (var it = new Enumerator(sht.Shapes), shp = it.item(); !it.atEnd(); it.moveNext(), shp = it.item()) { + fo.WriteLine(shp.Name + ": " + shp.TextFrame.Characters.Text); + } + } catch (e) {} } function writeHeadersAndFooters(fo, sht) { @@ -218,78 +219,73 @@ function sleep(sec) { } function saveRangeAsImage(sht, rng, filename) { - var obj - var shtNew - var wbkNew - var oldSheetsInNewWorkbook - var i - - saveRangeAsImage = true - + var result = true; try { - Err.Clear - - sht.Activate - With sht.Parent.Windows(1) - .DisplayGridlines = false - .View = 1 - End With - - oldSheetsInNewWorkbook = sht.Application.SheetsInNewWorkbook - sht.Application.SheetsInNewWorkbook = 1 - set wbkNew = sht.Application.Workbooks.Add - sht.Application.SheetsInNewWorkbook = oldSheetsInNewWorkbook - shtNew = wbkNew.Sheets(1) - obj = wbkNew.Charts.Add - obj = obj.Location(2, shtNew.Name) ' xlLocationAsObject=2 - - if (sht.Application.Version <= 11) { - obj.Parent.Width = rng.Width + 8 - obj.Parent.Height = rng.Height + 8 - } else { - obj.Parent.Width = rng.Width - obj.Parent.Height = rng.Height - } - - For i = 0 to 1 - if (sht.Application.Version < 14) { - rng.CopyPicture 1, 2 ' xlScreen=1, xlBitmap=2 - if (Err.Number == 0) { - sleep i - obj.Paste - obj.Export filename, "PNG" - } else if ( (i == 0) { - sleep 1 - } + sht.Activate(); + var win = sht.Parent.Windows(1); + win.DisplayGridlines = false; + win.View = 1 + + var oldSheetsInNewWorkbook = sht.Application.SheetsInNewWorkbook; + sht.Application.SheetsInNewWorkbook = 1; + var wbkNew = sht.Application.Workbooks.Add(); + sht.Application.SheetsInNewWorkbook = oldSheetsInNewWorkbook; + var shtNew = wbkNew.Sheets(1); + var obj = wbkNew.Charts.Add(); + obj = obj.Location(2, shtNew.Name); // xlLocationAsObject=2 + + if (sht.Application.Version <= 11) { + obj.Parent.Width = rng.Width + 8; + obj.Parent.Height = rng.Height + 8; } else { - rng.Copy - if (Err.Number == 0) { - sleep i - shtNew.Pictures.Paste - obj.Export filename, "PNG" - } else if ( (i == 0) { - sleep 1 + obj.Parent.Width = rng.Width; + obj.Parent.Height = rng.Height; + } + + for (var i = 0; i <= 1; i++) { + if (sht.Application.Version < 14) { + try { + rng.CopyPicture(1, 2); // xlScreen=1, xlBitmap=2 + sleep(i); + obj.Paste; + obj.Export(filename, "PNG"); + result = true; + break; + } catch (e) { + result = false; + if (i == 0) { + sleep(1); + } + } + } else { + try { + rng.Copy(); + sleep(i); + shtNew.Pictures.Paste(); + obj.Export(filename, "PNG"); + result = true; + break; + } catch (e) { + result = false; + if (i == 0) { + sleep(1); + } + } } } - - if (Err.Number == 0) { Exit For - if (i == 0) { Err.Clear + } catch (e) { + result = false; } - - wbkNew.Close false - - saveRangeAsImage = (Err.Number = 0) - + wbkNew.Close(false); + return result; } function getTimeStamp() { - var dt, tm, ms - tm = Timer - ms = Fix((tm - Fix(tm)) * 1000) - tm = Fix(tm) - getTimeStamp = (tm \ (60 * 60)) + ":" + ((tm \ 60) Mod 60) + ":" + (tm Mod 60) + "." + ms + var dt = new Date(); + return dt.toLocaleString().split(" ")[1] + "." + ("000" + dt.getMilliseconds()).slice(-3); } +/* function findRowByPosition(sht, rowBegin, rowEnd, pos) { var height, rowPrev, row, rowBeginOrg row = rowEnd @@ -363,32 +359,31 @@ function saveSheetAsImage(sht, basefilename) { Loop While column < rngUsed.column + rngUsed.Columns.Count - 1 } +*/ + function saveSheetAsHTML(sht, filename) { - var pobj - pobj = sht.Parent.PublishObjects.Add(1, filename, sht.Name, "", 0, "CompareMSExcelFilesPlugin", "") ' 1 = xlSourceSheet, 0 = xlHtmlStatic - pobj.Publish true - pobj.AutoRepublish = false + var pobj = sht.Parent.PublishObjects.Add(1, filename, sht.Name, "", 0, "CompareMSExcelFilesPlugin", ""); // 1 = xlSourceSheet, 0 = xlHtmlStatic + pobj.Publish(true); + pobj.AutoRepublish = false; } function escape(sheetName) { - escape = Replace(sheetName, "%", "%25") - escape = Replace(escape, "<", "%3C") - escape = Replace(escape, ">", "%3E") - escape = Replace(escape, "|", "%7C") - Select Case Left(UCase(escape), 3) - Case "CON", "AUX", "NUL" - if (Len(escape) == 3) { - escape = "%" + escape - } - Case "COM", "LPT" - if (Len(escape) == 4 And IsNumeric(Mid(escape, 4, 1))) { - escape = "%" + escape - } - End Select + var escape = sheetName.replace(/%/g, "%25").replace(//, "%3E").replace(/\|/, "%7C"); + switch (escape.toLowerCase().substr(0, 3)) { + case "CON", "AUX", "NUL": + if (escape.length == 3) { + escape = "%" + escape; + } + break; + case "COM", "LPT": + if (escape.length == 4 && !isNaN(escape.substr(3, 1))) { + escape = "%" + escape; + } + break; + } + return escape; } -*/ - function get_PluginEvent() { return "FILE_FOLDER_PACK_UNPACK"; } @@ -444,66 +439,71 @@ function UnpackFile(fileSrc, fileDst, pbChanged, pSubcode) { try { if (regRead(REGKEY_PATH + "CompareDocumentProperties", false)) { - fo.WriteLine "[Document Properties]" - writeObjectProperties fo, wbk.BuiltinDocumentProperties - fo.WriteLine "" + fo.WriteLine("[Document Properties]"); + writeObjectProperties(fo, wbk.BuiltinDocumentProperties); + fo.WriteLine(""); } if (regRead(REGKEY_PATH + "CompareNames", true)) { - fo.WriteLine "[Names]" - writeObjectProperties fo, wbk.Names - fo.WriteLine "" + fo.WriteLine("[Names]"); + writeObjectProperties(fo, wbk.Names); + fo.WriteLine(""); } For Each sht In wbk.Worksheets if (regRead(REGKEY_PATH + "CompareCellValues", true)) { - fo.WriteLine "[" + sht.Name + "]" - writeCellValues fo, sht - fo.WriteLine "" + fo.WriteLine("[" + sht.Name + "]"); + writeCellValues(fo, sht); + fo.WriteLine(""); } if (regRead(REGKEY_PATH + "CompareFormulas", false)) { - fo.WriteLine "[" + sht.Name + ".Formulas]" - writeFormulas fo, sht - fo.WriteLine "" + fo.WriteLine("[" + sht.Name + ".Formulas]"); + writeFormulas(fo, sht); + fo.WriteLine(""); } if (regRead(REGKEY_PATH + "CompareTextsInShapes", true)) { - fo.WriteLine "[" + sht.Name + ".Shapes]" - ungroupShapes sht - writeTextsInShapes fo, sht - fo.WriteLine "" + fo.WriteLine("[" + sht.Name + ".Shapes]"); + ungroupShapes(sht); + writeTextsInShapes(fo, sht); + fo.WriteLine(""); } if (regRead(REGKEY_PATH + "CompareHeadersAndFooters", true)) { - fo.WriteLine "[" + sht.Name + ".HeadersAndFooters]" - writeHeadersAndFooters fo, sht - fo.WriteLine "" + fo.WriteLine("[" + sht.Name + ".HeadersAndFooters]"); + writeHeadersAndFooters(fo, sht); + fo.WriteLine(""); } } if (regRead(REGKEY_PATH + "CompareVBAMacros", true)) { - if (Not isAccessibleVBAProject(wbk)) { - fo.WriteLine Translate(MsgCannotGetMacros) + if (!isAccessibleVBAProject(wbk)) { + fo.WriteLine(Translate(MsgCannotGetMacros)); } For Each cmp In wbk.VBProject.VBComponents - fo.WriteLine "[CodeModule." + cmp.Name + "]" + fo.WriteLine("[CodeModule." + cmp.Name + "]"); if (cmp.CodeModule.CountOfLines > 0) { - fo.WriteLine cmp.CodeModule.Lines(1, cmp.CodeModule.CountOfLines) + fo.WriteLine(cmp.CodeModule.Lines(1, cmp.CodeModule.CountOfLines)); } - fo.WriteLine "" + fo.WriteLine(""); } } sht = null; - wbk.Close + wbk.Close(); wbk = null; - xl.Quit + xl.Quit(); xl = null; fo.Close(); fo = null; - pbChanged = true - pSubcode = 0 - UnpackFile = true -*/ + pbChanged = true; + pSubcode = 0; + + var result = new ActiveXObject("Scripting.Dictionary"); + result.Add(0, true); + result.Add(1, pbChanged); + result.Add(2, pSubcode); + return result.Items(); + */ } function PackFile(fileSrc, fileDst, pbChanged, pSubcode) { From 5d71810986d375e44f8a7c39eeed38e426116ffb Mon Sep 17 00:00:00 2001 From: Takashi Sawanaka Date: Sat, 20 Jan 2024 11:17:08 +0900 Subject: [PATCH 10/58] WIP --- Plugins/dlls/CompareMSExcelFiles.sct | 423 +++++++++++++-------------- 1 file changed, 199 insertions(+), 224 deletions(-) diff --git a/Plugins/dlls/CompareMSExcelFiles.sct b/Plugins/dlls/CompareMSExcelFiles.sct index 0c8108bfaa8..cbd22e01d5f 100644 --- a/Plugins/dlls/CompareMSExcelFiles.sct +++ b/Plugins/dlls/CompareMSExcelFiles.sct @@ -49,7 +49,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -var REGKEY_PATH = "Plugins\CompareMSExcelFiles.sct/"; +var REGKEY_PATH = "Plugins\\CompareMSExcelFiles.sct/"; var pbGroup = 6; var MsgCannotGetMacros = "${Cannot get Macros.\n" + " To allow WinMerge to compare macros, use MS Office to alter the settings in the Macro Security for the current application.\n" + @@ -224,7 +224,7 @@ function saveRangeAsImage(sht, rng, filename) { sht.Activate(); var win = sht.Parent.Windows(1); win.DisplayGridlines = false; - win.View = 1 + win.View = 1; var oldSheetsInNewWorkbook = sht.Application.SheetsInNewWorkbook; sht.Application.SheetsInNewWorkbook = 1; @@ -285,82 +285,75 @@ function getTimeStamp() { return dt.toLocaleString().split(" ")[1] + "." + ("000" + dt.getMilliseconds()).slice(-3); } -/* function findRowByPosition(sht, rowBegin, rowEnd, pos) { - var height, rowPrev, row, rowBeginOrg - row = rowEnd - rowBeginOrg = rowBegin + var rowPrev, row, rowBeginOrg; + row = rowEnd; + rowBeginOrg = rowBegin; + rowPrev = row; + do { + var height = sht.Range("A" + rowBeginOrg + ":A" + row).height; + if (height < pos) { + rowBegin = row; + } else { + rowEnd = row; + } + row = Math.floor((rowEnd - rowBegin) / 2) + rowBegin; + if (row == rowPrev) { + return row; + } rowPrev = row - Do - height = sht.Range("A" + rowBeginOrg + ":A" + row).height - if (height < pos) { - rowBegin = row - } else { - rowEnd = row - } - row = (rowEnd - rowBegin) \ 2 + rowBegin - if (row == rowPrev) { - findRowByPosition = row - Exit Function - } - rowPrev = row - Loop + } while (true); } function findColumnByPosition(sht, columnBegin, columnEnd, pos) { - var width, columnPrev, column, columnBeginOrg - column = columnEnd - columnBeginOrg = columnBegin - columnPrev = column - Do - width = sht.Range(sht.Cells(1, columnBeginOrg), sht.Cells(1, column)).width - if (width < pos) { - columnBegin = column - } else { - columnEnd = column - } - column = (columnEnd - columnBegin) \ 2 + columnBegin - if (column == columnPrev) { - findColumnByPosition = column - Exit Function - } - columnPrev = column - Loop + var column = columnEnd; + var columnBeginOrg = columnBegin; + var columnPrev = column; + do { + var width = sht.Range(sht.Cells(1, columnBeginOrg), sht.Cells(1, column)).width; + if (width < pos) { + columnBegin = column; + } else { + columnEnd = column; + } + column = Math.floor((columnEnd - columnBegin) / 2) + columnBegin; + if (column == columnPrev) { + return column; + } + columnPrev = column; + } while (true); } + function saveSheetAsImage(sht, basefilename) { - var rngUsed, rngImage, row, rowEnd, column, columnEnd, filename, numX, numY, imageWidth, imageHeight - imageWidth = regRead(REGKEY_PATH + "ImageWidth", 1000) - imageHeight = regRead(REGKEY_PATH + "ImageHeight", 3000) - rngUsed = getUsedRangeIncludingShapes(sht) - numX = 1 - column = rngUsed.Column - Do - columnEnd = findColumnByPosition(sht, column, rngUsed.Column + rngUsed.Columns.Count - 1, imageWidth) - numY = 1 - row = rngUsed.Row - Do - rowEnd = findRowByPosition(sht, row, rngUsed.Row + rngUsed.Rows.Count - 1, imageHeight) - rngImage = sht.Range(sht.Cells(row, column), sht.Cells(rowEnd, columnEnd)) - filename = basefilename + "(" + numX + "-" + numY + ").png" - if (Not saveRangeAsImage(sht, rngImage, filename)) { - var shtNew - shtNew = sht.Parent.Sheets.Add - shtNew.Range("A1") = getTimeStamp() + ": Error" + Err.Number + ": " + Err.Description - shtNew.Columns.AutoFit - saveRangeAsImage shtNew, shtNew.Range("A1"), filename - shtNew.Delete + var imageWidth = regRead(REGKEY_PATH + "ImageWidth", 1000); + var imageHeight = regRead(REGKEY_PATH + "ImageHeight", 3000); + var rngUsed = getUsedRangeIncludingShapes(sht); + var numX = 1; + var column = rngUsed.Column; + do { + var columnEnd = findColumnByPosition(sht, column, rngUsed.Column + rngUsed.Columns.Count - 1, imageWidth); + var numY = 1 + var row = rngUsed.Row; + do { + var rowEnd = findRowByPosition(sht, row, rngUsed.Row + rngUsed.Rows.Count - 1, imageHeight); + var rngImage = sht.Range(sht.Cells(row, column), sht.Cells(rowEnd, columnEnd)); + var filename = basefilename + "(" + numX + "-" + numY + ").png"; + if (!saveRangeAsImage(sht, rngImage, filename)) { + var shtNew = sht.Parent.Sheets.Add(); + shtNew.Range("A1") = getTimeStamp() + ": Error" + Err.Number + ": " + Err.Description; + shtNew.Columns.AutoFit(); + saveRangeAsImage(shtNew, shtNew.Range("A1"), filename); + shtNew.Delete(); } - row = rowEnd + 1 - numY = numY + 1 - Loop While row < rngUsed.row + rngUsed.Rows.Count - 1 - column = columnEnd + 1 - numX = numX + 1 - Loop While column < rngUsed.column + rngUsed.Columns.Count - 1 + row = rowEnd + 1; + numY = numY + 1; + } while (row < rngUsed.row + rngUsed.Rows.Count - 1); + column = columnEnd + 1; + numX = numX + 1; + } while (column < rngUsed.column + rngUsed.Columns.Count - 1); } -*/ - function saveSheetAsHTML(sht, filename) { var pobj = sht.Parent.PublishObjects.Add(1, filename, sht.Name, "", 0, "CompareMSExcelFilesPlugin", ""); // 1 = xlSourceSheet, 0 = xlHtmlStatic pobj.Publish(true); @@ -413,81 +406,72 @@ function PluginOnEvent(eventType, obj) { } function UnpackFile(fileSrc, fileDst, pbChanged, pSubcode) { - /* - var fo - var xl - var wbk - var sht - var cmp - var fileSrc2 - - fo = fso.CreateTextFile(fileDst, true, true) + var fo = fso.CreateTextFile(fileDst, true, true); - xl = new ActiveXObject("Excel.Application") - xl.EnableEvents = false - xl.DisplayAlerts = false + var xl = new ActiveXObject("Excel.Application"); + xl.EnableEvents = false; + xl.DisplayAlerts = false; - fileSrc2 = fileSrc + var fileSrc2 = fileSrc; if (fso.GetExtensionName(fileSrc2) == "lnk") { - fileSrc2 = wsh.CreateShortcut(fileSrc2).TargetPath - if (Not fso.FileExists(fileSrc2)) { - Err.Raise 30001, "CompareMSExcelFiles.sct", fileSrc + ": Target file '" + fileSrc2 + "' not found" - } ( + fileSrc2 = wsh.CreateShortcut(fileSrc2).TargetPath; + if (!fso.FileExists(fileSrc2)) { + throw new Error(30001, "CompareMSExcelFiles.sct", fileSrc + ": Target file '" + fileSrc2 + "' not found"); + } } - wbk = xl.Workbooks.Open(fileSrc2, regRead(REGKEY_PATH + "UpdateLinks", 0),,,,,,,,,,,,true) - + var wbk = xl.Workbooks.Open(fileSrc2, regRead(REGKEY_PATH + "UpdateLinks", 0), null, null, null, null, null, null, null, null, null, null,null, true); try { - - if (regRead(REGKEY_PATH + "CompareDocumentProperties", false)) { - fo.WriteLine("[Document Properties]"); - writeObjectProperties(fo, wbk.BuiltinDocumentProperties); - fo.WriteLine(""); - } - - if (regRead(REGKEY_PATH + "CompareNames", true)) { - fo.WriteLine("[Names]"); - writeObjectProperties(fo, wbk.Names); - fo.WriteLine(""); - } - - For Each sht In wbk.Worksheets - if (regRead(REGKEY_PATH + "CompareCellValues", true)) { - fo.WriteLine("[" + sht.Name + "]"); - writeCellValues(fo, sht); - fo.WriteLine(""); - } - if (regRead(REGKEY_PATH + "CompareFormulas", false)) { - fo.WriteLine("[" + sht.Name + ".Formulas]"); - writeFormulas(fo, sht); - fo.WriteLine(""); - } - if (regRead(REGKEY_PATH + "CompareTextsInShapes", true)) { - fo.WriteLine("[" + sht.Name + ".Shapes]"); - ungroupShapes(sht); - writeTextsInShapes(fo, sht); + if (regRead(REGKEY_PATH + "CompareDocumentProperties", false)) { + fo.WriteLine("[Document Properties]"); + writeObjectProperties(fo, wbk.BuiltinDocumentProperties); fo.WriteLine(""); } - if (regRead(REGKEY_PATH + "CompareHeadersAndFooters", true)) { - fo.WriteLine("[" + sht.Name + ".HeadersAndFooters]"); - writeHeadersAndFooters(fo, sht); + + if (regRead(REGKEY_PATH + "CompareNames", true)) { + fo.WriteLine("[Names]"); + writeObjectProperties(fo, wbk.Names); fo.WriteLine(""); } - } - - if (regRead(REGKEY_PATH + "CompareVBAMacros", true)) { - if (!isAccessibleVBAProject(wbk)) { - fo.WriteLine(Translate(MsgCannotGetMacros)); + + for (var it = new Enumerator(wbk.Worksheets), sht = it.item(); !it.atEnd(); it.moveNext(), sht = it.item()) { + if (regRead(REGKEY_PATH + "CompareCellValues", true)) { + fo.WriteLine("[" + sht.Name + "]"); + writeCellValues(fo, sht); + fo.WriteLine(""); + } + if (regRead(REGKEY_PATH + "CompareFormulas", false)) { + fo.WriteLine("[" + sht.Name + ".Formulas]"); + writeFormulas(fo, sht); + fo.WriteLine(""); + } + if (regRead(REGKEY_PATH + "CompareTextsInShapes", true)) { + fo.WriteLine("[" + sht.Name + ".Shapes]"); + ungroupShapes(sht); + writeTextsInShapes(fo, sht); + fo.WriteLine(""); + } + if (regRead(REGKEY_PATH + "CompareHeadersAndFooters", true)) { + fo.WriteLine("[" + sht.Name + ".HeadersAndFooters]"); + writeHeadersAndFooters(fo, sht); + fo.WriteLine(""); + } } - For Each cmp In wbk.VBProject.VBComponents - fo.WriteLine("[CodeModule." + cmp.Name + "]"); - if (cmp.CodeModule.CountOfLines > 0) { - fo.WriteLine(cmp.CodeModule.Lines(1, cmp.CodeModule.CountOfLines)); + + if (regRead(REGKEY_PATH + "CompareVBAMacros", true)) { + if (!isAccessibleVBAProject(wbk)) { + fo.WriteLine(Translate(MsgCannotGetMacros)); + } + for (var it = new Enumerator(wbk.VBProject.VBComponents), cmp = it.item(); !it.atEnd(); it.moveNext(), cmp = it.item()) { + fo.WriteLine("[CodeModule." + cmp.Name + "]"); + if (cmp.CodeModule.CountOfLines > 0) { + fo.WriteLine(cmp.CodeModule.Lines(1, cmp.CodeModule.CountOfLines)); + } + fo.WriteLine(""); } - fo.WriteLine(""); } - } + sht = null; + } catch (e) { } - sht = null; wbk.Close(); wbk = null; xl.Quit(); @@ -503,7 +487,6 @@ function UnpackFile(fileSrc, fileDst, pbChanged, pSubcode) { result.Add(1, pbChanged); result.Add(2, pSubcode); return result.Items(); - */ } function PackFile(fileSrc, fileDst, pbChanged, pSubcode) { @@ -515,115 +498,107 @@ function IsFolder(file) { } function UnpackFolder(fileSrc, folderDst, pbChanged, pSubcode) { -/* - var fo - var xl - var wbk - var sht - var cmp - var digit - var zf - var No - var fileSrc2 - - if (Not fso.FolderExists(folderDst)) { fso.CreateFolder folderDst - - xl = new ActiveXObject("Excel.Application") - xl.EnableEvents = false - xl.DisplayAlerts = false - - var backgroundChecking - backgroundChecking = xl.ErrorCheckingOptions.BackgroundChecking - xl.ErrorCheckingOptions.BackgroundChecking = false - - fileSrc2 = fileSrc - if (fso.GetExtensionName(fileSrc2) == "lnk") { - fileSrc2 = wsh.CreateShortcut(fileSrc2).TargetPath - if (Not fso.FileExists(fileSrc2)) { - Err.Raise 30001, "CompareMSExcelFiles.sct", fileSrc + ": Target file '" + fileSrc2 + "' not found" - } ( - } - wbk = xl.Workbooks.Open(fileSrc2, regRead(REGKEY_PATH + "UpdateLinks", 0),,,,,,,,,,,,true) + if (!fso.FolderExists(folderDst)) { fso.CreateFolder(folderDst); } - try { + var xl = new ActiveXObject("Excel.Application"); + xl.EnableEvents = false; + xl.DisplayAlerts = false; - digit = Len(CStr(wbk.Worksheets.Count)) - if (digit <= 0) { digit = 1 - zf = String(digit, "0") + var backgroundChecking = xl.ErrorCheckingOptions.BackgroundChecking; + xl.ErrorCheckingOptions.BackgroundChecking = false; - if (regRead(REGKEY_PATH + "CompareDocumentProperties", false)) { - fo = fso.CreateTextFile(fso.BuildPath(folderDst, "(" + zf + ")DocumentProperties.txt"), true, true) - writeObjectProperties fo, wbk.BuiltinDocumentProperties - fo.Close(); - } - - if (regRead(REGKEY_PATH + "CompareNames", true)) { - fo = fso.CreateTextFile(fso.BuildPath(folderDst, "(" + zf + ")Names.txt"), true, true) - writeObjectProperties fo, wbk.Names - fo.Close(); - } - - No = 1 - For Each sht In wbk.Worksheets - No = Right(zf + CInt(No), digit) - if (regRead(REGKEY_PATH + "CompareCellValues", true)) { - fo = fso.CreateTextFile(fso.BuildPath(folderDst, "(" + No + ")" + escape(sht.Name) + ".tsv"), true, true) - writeCellValues fo, sht - fo.Close(); - } - - if (regRead(REGKEY_PATH + "CompareFormulas", false)) { - fo = fso.CreateTextFile(fso.BuildPath(folderDst, "(" + No + ")" + escape(sht.Name) + "_Formulas.txt"), true, true) - writeFormulas fo, sht - fo.Close(); + var fileSrc2 = fileSrc; + if (fso.GetExtensionName(fileSrc2) == "lnk") { + fileSrc2 = wsh.CreateShortcut(fileSrc2).TargetPath; + if (!fso.FileExists(fileSrc2)) { + throw Error(30001, "CompareMSExcelFiles.sct", fileSrc + ": Target file '" + fileSrc2 + "' not found"); } + } + var wbk = xl.Workbooks.Open(fileSrc2, regRead(REGKEY_PATH + "UpdateLinks", 0), null, null, null, null, null, null, null, null, null, null, null, true); - if (regRead(REGKEY_PATH + "CompareTextsInShapes", true)) { - fo = fso.CreateTextFile(fso.BuildPath(folderDst, "(" + No + ")" + escape(sht.Name) + "_Shapes.txt"), true, true) - ungroupShapes sht - writeTextsInShapes fo, sht + try { + digit = String(wbk.Worksheets.Count).length; + if (digit <= 0) { digit = 1; } + var zf = Array(digit + 1).join("0"); + + if (regRead(REGKEY_PATH + "CompareDocumentProperties", false)) { + fo = fso.CreateTextFile(fso.BuildPath(folderDst, "(" + zf + ")DocumentProperties.txt"), true, true); + writeObjectProperties(fo, wbk.BuiltinDocumentProperties); fo.Close(); } - - if (regRead(REGKEY_PATH + "CompareHeadersAndFooters", true)) { - fo = fso.CreateTextFile(fso.BuildPath(folderDst, "(" + No + ")" + escape(sht.Name) + "_HeadersAndFooters.txt"), true, true) - writeHeadersAndFooters fo, sht + + if (regRead(REGKEY_PATH + "CompareNames", true)) { + fo = fso.CreateTextFile(fso.BuildPath(folderDst, "(" + zf + ")Names.txt"), true, true); + writeObjectProperties(fo, wbk.Names); fo.Close(); } - - if (regRead(REGKEY_PATH + "CompareWorksheetsAsImage", true)) { - saveSheetAsImage sht, fso.BuildPath(folderDst, "(" + No + ")" + escape(sht.Name)) - } - - if (regRead(REGKEY_PATH + "CompareWorksheetsAsHTML", false)) { - saveSheetAsHTML sht, fso.BuildPath(folderDst, "(" + No + ")" + escape(sht.Name) + ".html") - } - No = CInt(No) + 1 - } - if (regRead(REGKEY_PATH + "CompareVBAMacros", true)) { - if (Not isAccessibleVBAProject(wbk)) { - fo = fso.CreateTextFile(fso.BuildPath(folderDst, "CannotGetMacros.bas"), true, true) - fo.WriteLine Translate(MsgCannotGetMacros) - fo.Close(); + + var No = 1; + for (var it = new Enumerator(wbk.Worksheets), sht = it.item(); !it.atEnd(); it.moveNext(), sht = it.item()) { + No = zf + No; + No = No.substr(No.length() - digit, digit); + if (regRead(REGKEY_PATH + "CompareCellValues", true)) { + fo = fso.CreateTextFile(fso.BuildPath(folderDst, "(" + No + ")" + escape(sht.Name) + ".tsv"), true, true); + writeCellValues(fo, sht); + fo.Close(); + } + + if (regRead(REGKEY_PATH + "CompareFormulas", false)) { + fo = fso.CreateTextFile(fso.BuildPath(folderDst, "(" + No + ")" + escape(sht.Name) + "_Formulas.txt"), true, true); + writeCellValues(fo, sht); + fo.Close(); + } + + if (regRead(REGKEY_PATH + "CompareTextsInShapes", true)) { + fo = fso.CreateTextFile(fso.BuildPath(folderDst, "(" + No + ")" + escape(sht.Name) + "_Shapes.txt"), true, true); + ungroupShapes(sht); + writeTextsInShapes(fo, sht); + fo.Close(); + } + + if (regRead(REGKEY_PATH + "CompareHeadersAndFooters", true)) { + fo = fso.CreateTextFile(fso.BuildPath(folderDst, "(" + No + ")" + escape(sht.Name) + "_HeadersAndFooters.txt"), true, true); + writeHeadersAndFooters(fo, sht); + fo.Close(); + } + + if (regRead(REGKEY_PATH + "CompareWorksheetsAsImage", true)) { + saveSheetAsImage(sht, fso.BuildPath(folderDst, "(" + No + ")" + escape(sht.Name))); + } + + if (regRead(REGKEY_PATH + "CompareWorksheetsAsHTML", false)) { + saveSheetAsHTML(sht, fso.BuildPath(folderDst, "(" + No + ")" + escape(sht.Name) + ".html")); + } + No = parseInt(No) + 1; } - - For Each cmp In wbk.VBProject.VBComponents - cmp.Export fso.BuildPath(folderDst, cmp.Name + getModuleExtension(cmp)) + if (regRead(REGKEY_PATH + "CompareVBAMacros", true)) { + if (!isAccessibleVBAProject(wbk)) { + fo = fso.CreateTextFile(fso.BuildPath(folderDst, "CannotGetMacros.bas"), true, true); + fo.WriteLine(Translate(MsgCannotGetMacros)); + fo.Close(); + } + + for (var it = new Enumerator(wbk.VBProject.VBComponents), cmp = it.item(); !it.atEnd(); it.moveNext(), cmp = it.item()) { + cmp.Export(fso.BuildPath(folderDst, cmp.Name + getModuleExtension(cmp))); + } } - } - - sht = null; - wbk.Close + sht = null; + } catch (e) { } + wbk.Close(); wbk = null; - xl.ErrorCheckingOptions.BackgroundChecking = backgroundChecking - xl.Quit + xl.ErrorCheckingOptions.BackgroundChecking = backgroundChecking; + xl.Quit(); xl = null; fo = null; - pbChanged = true - pSubcode = 0 - UnpackFolder = true - */ + pbChanged = true; + pSubcode = 0; + + var result = new ActiveXObject("Scripting.Dictionary"); + result.Add(0, true); + result.Add(1, pbChanged); + result.Add(2, pSubcode); + return result.Items(); } function PackFolder(fileSrc, folderDst, pbChanged, pSubcode) { From ca5ef85481002a943e9c8310a2fbf20f3a83c3ba Mon Sep 17 00:00:00 2001 From: Takashi Sawanaka Date: Sun, 21 Jan 2024 09:42:27 +0900 Subject: [PATCH 11/58] WIP --- Plugins/dlls/editor addin.sct | 1504 ++++++++++++++++----------------- 1 file changed, 732 insertions(+), 772 deletions(-) diff --git a/Plugins/dlls/editor addin.sct b/Plugins/dlls/editor addin.sct index 239aa04ef42..7cfaab71fe7 100644 --- a/Plugins/dlls/editor addin.sct +++ b/Plugins/dlls/editor addin.sct @@ -1,801 +1,761 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - +var REGKEY_PATH = "Plugins\\editor addin.sct/"; - From e570cac1c7cecc543cdb8455b57c503fee1ade14 Mon Sep 17 00:00:00 2001 From: Takashi Sawanaka Date: Sun, 21 Jan 2024 21:21:14 +0900 Subject: [PATCH 12/58] WIP --- Plugins/dlls/CompareMSExcelFiles.sct | 193 +++++++++++++-------------- Src/Merge.rc | 21 ++- Src/MergeApp.cpp | 5 + Src/MergeApp.h | 1 + Src/MergeAppCOMClass.cpp | 90 +++++++++++++ Src/MergeAppCOMClass.h | 11 ++ Src/resource.h | 12 +- Testing/FolderCompare/misc.cpp | 6 + 8 files changed, 233 insertions(+), 106 deletions(-) diff --git a/Plugins/dlls/CompareMSExcelFiles.sct b/Plugins/dlls/CompareMSExcelFiles.sct index cbd22e01d5f..952f85c8711 100644 --- a/Plugins/dlls/CompareMSExcelFiles.sct +++ b/Plugins/dlls/CompareMSExcelFiles.sct @@ -420,57 +420,55 @@ function UnpackFile(fileSrc, fileDst, pbChanged, pSubcode) { } } var wbk = xl.Workbooks.Open(fileSrc2, regRead(REGKEY_PATH + "UpdateLinks", 0), null, null, null, null, null, null, null, null, null, null,null, true); - try { - if (regRead(REGKEY_PATH + "CompareDocumentProperties", false)) { - fo.WriteLine("[Document Properties]"); - writeObjectProperties(fo, wbk.BuiltinDocumentProperties); + if (regRead(REGKEY_PATH + "CompareDocumentProperties", false)) { + fo.WriteLine("[Document Properties]"); + writeObjectProperties(fo, wbk.BuiltinDocumentProperties); + fo.WriteLine(""); + } + + if (regRead(REGKEY_PATH + "CompareNames", true)) { + fo.WriteLine("[Names]"); + writeObjectProperties(fo, wbk.Names); + fo.WriteLine(""); + } + + for (var it = new Enumerator(wbk.Worksheets), sht = it.item(); !it.atEnd(); it.moveNext(), sht = it.item()) { + if (regRead(REGKEY_PATH + "CompareCellValues", true)) { + fo.WriteLine("[" + sht.Name + "]"); + writeCellValues(fo, sht); fo.WriteLine(""); } - - if (regRead(REGKEY_PATH + "CompareNames", true)) { - fo.WriteLine("[Names]"); - writeObjectProperties(fo, wbk.Names); + if (regRead(REGKEY_PATH + "CompareFormulas", false)) { + fo.WriteLine("[" + sht.Name + ".Formulas]"); + writeFormulas(fo, sht); fo.WriteLine(""); } - - for (var it = new Enumerator(wbk.Worksheets), sht = it.item(); !it.atEnd(); it.moveNext(), sht = it.item()) { - if (regRead(REGKEY_PATH + "CompareCellValues", true)) { - fo.WriteLine("[" + sht.Name + "]"); - writeCellValues(fo, sht); - fo.WriteLine(""); - } - if (regRead(REGKEY_PATH + "CompareFormulas", false)) { - fo.WriteLine("[" + sht.Name + ".Formulas]"); - writeFormulas(fo, sht); - fo.WriteLine(""); - } - if (regRead(REGKEY_PATH + "CompareTextsInShapes", true)) { - fo.WriteLine("[" + sht.Name + ".Shapes]"); - ungroupShapes(sht); - writeTextsInShapes(fo, sht); - fo.WriteLine(""); - } - if (regRead(REGKEY_PATH + "CompareHeadersAndFooters", true)) { - fo.WriteLine("[" + sht.Name + ".HeadersAndFooters]"); - writeHeadersAndFooters(fo, sht); - fo.WriteLine(""); - } + if (regRead(REGKEY_PATH + "CompareTextsInShapes", true)) { + fo.WriteLine("[" + sht.Name + ".Shapes]"); + ungroupShapes(sht); + writeTextsInShapes(fo, sht); + fo.WriteLine(""); } + if (regRead(REGKEY_PATH + "CompareHeadersAndFooters", true)) { + fo.WriteLine("[" + sht.Name + ".HeadersAndFooters]"); + writeHeadersAndFooters(fo, sht); + fo.WriteLine(""); + } + } - if (regRead(REGKEY_PATH + "CompareVBAMacros", true)) { - if (!isAccessibleVBAProject(wbk)) { - fo.WriteLine(Translate(MsgCannotGetMacros)); - } - for (var it = new Enumerator(wbk.VBProject.VBComponents), cmp = it.item(); !it.atEnd(); it.moveNext(), cmp = it.item()) { - fo.WriteLine("[CodeModule." + cmp.Name + "]"); - if (cmp.CodeModule.CountOfLines > 0) { - fo.WriteLine(cmp.CodeModule.Lines(1, cmp.CodeModule.CountOfLines)); - } - fo.WriteLine(""); + if (regRead(REGKEY_PATH + "CompareVBAMacros", true)) { + if (!isAccessibleVBAProject(wbk)) { + fo.WriteLine(Translate(MsgCannotGetMacros)); + } + for (var it = new Enumerator(wbk.VBProject.VBComponents), cmp = it.item(); !it.atEnd(); it.moveNext(), cmp = it.item()) { + fo.WriteLine("[CodeModule." + cmp.Name + "]"); + if (cmp.CodeModule.CountOfLines > 0) { + fo.WriteLine(cmp.CodeModule.Lines(1, cmp.CodeModule.CountOfLines)); } + fo.WriteLine(""); } - sht = null; - } catch (e) { } + } + sht = null; wbk.Close(); wbk = null; @@ -516,74 +514,73 @@ function UnpackFolder(fileSrc, folderDst, pbChanged, pSubcode) { } var wbk = xl.Workbooks.Open(fileSrc2, regRead(REGKEY_PATH + "UpdateLinks", 0), null, null, null, null, null, null, null, null, null, null, null, true); - try { - digit = String(wbk.Worksheets.Count).length; - if (digit <= 0) { digit = 1; } - var zf = Array(digit + 1).join("0"); + digit = String(wbk.Worksheets.Count).length; + if (digit <= 0) { digit = 1; } + var zf = Array(digit + 1).join("0"); + + if (regRead(REGKEY_PATH + "CompareDocumentProperties", false)) { + fo = fso.CreateTextFile(fso.BuildPath(folderDst, "(" + zf + ")DocumentProperties.txt"), true, true); + writeObjectProperties(fo, wbk.BuiltinDocumentProperties); + fo.Close(); + } - if (regRead(REGKEY_PATH + "CompareDocumentProperties", false)) { - fo = fso.CreateTextFile(fso.BuildPath(folderDst, "(" + zf + ")DocumentProperties.txt"), true, true); - writeObjectProperties(fo, wbk.BuiltinDocumentProperties); + if (regRead(REGKEY_PATH + "CompareNames", true)) { + fo = fso.CreateTextFile(fso.BuildPath(folderDst, "(" + zf + ")Names.txt"), true, true); + writeObjectProperties(fo, wbk.Names); + fo.Close(); + } + + var No = 1; + for (var it = new Enumerator(wbk.Worksheets), sht = it.item(); !it.atEnd(); it.moveNext(), sht = it.item()) { + No = zf + No; + No = No.substr(No.length - digit, digit); + if (regRead(REGKEY_PATH + "CompareCellValues", true)) { + fo = fso.CreateTextFile(fso.BuildPath(folderDst, "(" + No + ")" + escape(sht.Name) + ".tsv"), true, true); + writeCellValues(fo, sht); fo.Close(); } - if (regRead(REGKEY_PATH + "CompareNames", true)) { - fo = fso.CreateTextFile(fso.BuildPath(folderDst, "(" + zf + ")Names.txt"), true, true); - writeObjectProperties(fo, wbk.Names); + if (regRead(REGKEY_PATH + "CompareFormulas", false)) { + fo = fso.CreateTextFile(fso.BuildPath(folderDst, "(" + No + ")" + escape(sht.Name) + "_Formulas.txt"), true, true); + writeFormulas(fo, sht); fo.Close(); } - var No = 1; - for (var it = new Enumerator(wbk.Worksheets), sht = it.item(); !it.atEnd(); it.moveNext(), sht = it.item()) { - No = zf + No; - No = No.substr(No.length() - digit, digit); - if (regRead(REGKEY_PATH + "CompareCellValues", true)) { - fo = fso.CreateTextFile(fso.BuildPath(folderDst, "(" + No + ")" + escape(sht.Name) + ".tsv"), true, true); - writeCellValues(fo, sht); - fo.Close(); - } - - if (regRead(REGKEY_PATH + "CompareFormulas", false)) { - fo = fso.CreateTextFile(fso.BuildPath(folderDst, "(" + No + ")" + escape(sht.Name) + "_Formulas.txt"), true, true); - writeCellValues(fo, sht); - fo.Close(); - } - - if (regRead(REGKEY_PATH + "CompareTextsInShapes", true)) { - fo = fso.CreateTextFile(fso.BuildPath(folderDst, "(" + No + ")" + escape(sht.Name) + "_Shapes.txt"), true, true); - ungroupShapes(sht); - writeTextsInShapes(fo, sht); - fo.Close(); - } + if (regRead(REGKEY_PATH + "CompareTextsInShapes", true)) { + fo = fso.CreateTextFile(fso.BuildPath(folderDst, "(" + No + ")" + escape(sht.Name) + "_Shapes.txt"), true, true); + ungroupShapes(sht); + writeTextsInShapes(fo, sht); + fo.Close(); + } - if (regRead(REGKEY_PATH + "CompareHeadersAndFooters", true)) { - fo = fso.CreateTextFile(fso.BuildPath(folderDst, "(" + No + ")" + escape(sht.Name) + "_HeadersAndFooters.txt"), true, true); - writeHeadersAndFooters(fo, sht); - fo.Close(); - } + if (regRead(REGKEY_PATH + "CompareHeadersAndFooters", true)) { + fo = fso.CreateTextFile(fso.BuildPath(folderDst, "(" + No + ")" + escape(sht.Name) + "_HeadersAndFooters.txt"), true, true); + writeHeadersAndFooters(fo, sht); + fo.Close(); + } - if (regRead(REGKEY_PATH + "CompareWorksheetsAsImage", true)) { - saveSheetAsImage(sht, fso.BuildPath(folderDst, "(" + No + ")" + escape(sht.Name))); - } + if (regRead(REGKEY_PATH + "CompareWorksheetsAsImage", true)) { + saveSheetAsImage(sht, fso.BuildPath(folderDst, "(" + No + ")" + escape(sht.Name))); + } - if (regRead(REGKEY_PATH + "CompareWorksheetsAsHTML", false)) { - saveSheetAsHTML(sht, fso.BuildPath(folderDst, "(" + No + ")" + escape(sht.Name) + ".html")); - } - No = parseInt(No) + 1; + if (regRead(REGKEY_PATH + "CompareWorksheetsAsHTML", false)) { + saveSheetAsHTML(sht, fso.BuildPath(folderDst, "(" + No + ")" + escape(sht.Name) + ".html")); + } + No = parseInt(No) + 1; + } + if (regRead(REGKEY_PATH + "CompareVBAMacros", true)) { + if (!isAccessibleVBAProject(wbk)) { + fo = fso.CreateTextFile(fso.BuildPath(folderDst, "CannotGetMacros.bas"), true, true); + fo.WriteLine(Translate(MsgCannotGetMacros)); + fo.Close(); } - if (regRead(REGKEY_PATH + "CompareVBAMacros", true)) { - if (!isAccessibleVBAProject(wbk)) { - fo = fso.CreateTextFile(fso.BuildPath(folderDst, "CannotGetMacros.bas"), true, true); - fo.WriteLine(Translate(MsgCannotGetMacros)); - fo.Close(); - } - for (var it = new Enumerator(wbk.VBProject.VBComponents), cmp = it.item(); !it.atEnd(); it.moveNext(), cmp = it.item()) { - cmp.Export(fso.BuildPath(folderDst, cmp.Name + getModuleExtension(cmp))); - } + for (var it = new Enumerator(wbk.VBProject.VBComponents), cmp = it.item(); !it.atEnd(); it.moveNext(), cmp = it.item()) { + cmp.Export(fso.BuildPath(folderDst, cmp.Name + getModuleExtension(cmp))); } - sht = null; - } catch (e) { } + } + sht = null; + wbk.Close(); wbk = null; xl.ErrorCheckingOptions.BackgroundChecking = backgroundChecking; diff --git a/Src/Merge.rc b/Src/Merge.rc index 6bbc7b25aeb..ec2899774ae 100644 --- a/Src/Merge.rc +++ b/Src/Merge.rc @@ -2342,6 +2342,17 @@ BEGIN CONTROL "",IDC_LIST_FILE,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_ALIGNLEFT | LVS_NOCOLUMNHEADER | WS_BORDER | WS_TABSTOP,0,0,309,176 END +IDD_INPUTBOX DIALOGEX 0, 0, 234, 68 +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Dialog" +FONT 8, "MS Shell Dlg", 400, 0, 0x1 +BEGIN + LTEXT "",IDC_INPUTBOX_PROMPT,6,6,162,40 + EDITTEXT IDC_INPUTBOX_EDIT,6,50,224,12,ES_AUTOHSCROLL + DEFPUSHBUTTON "OK",IDOK,170,6,60,14 + PUSHBUTTON "Cancel",IDCANCEL,170,22,60,14 +END + ///////////////////////////////////////////////////////////////////////////// // @@ -2479,9 +2490,8 @@ BEGIN BEGIN END - IDD_WEBPAGEDIFF_BAR, DIALOG + IDD_INPUTBOX, DIALOG BEGIN - RIGHTMARGIN, 237 END END #endif // APSTUDIO_INVOKED @@ -3049,6 +3059,11 @@ BEGIN 100, 100, 0, 0 END +IDD_INPUTBOX AFX_DIALOG_LAYOUT +BEGIN + 0 +END + ///////////////////////////////////////////////////////////////////////////// // @@ -3511,7 +3526,7 @@ BEGIN IDS_CONFIRM_MOVE_CAPTION "Confirm Move" IDS_CONFIRM_CLOSE_WINDOW_COMPARING "You are about to close the window that is comparing folders. Are you sure you want to close the window?" - IDS_CONFIRM_CLOSE_WINDOW_LONG_COMPARISON + IDS_CONFIRM_CLOSE_WINDOW_LONG_COMPARISON "You are about to close the folder comparison window that took a significant amount of time. Are you sure you want to close the window?" IDS_ERROR_INVALID_DIR_FILE_NAME "The file or folder name is invalid." diff --git a/Src/MergeApp.cpp b/Src/MergeApp.cpp index b0ec789f082..15095447f10 100644 --- a/Src/MergeApp.cpp +++ b/Src/MergeApp.cpp @@ -98,6 +98,11 @@ void AppErrorMessageBox(const String& msg) AppMsgBox::error(msg); } +void* AppGetMainHWND() +{ + return AfxGetMainWnd()->m_hWnd; +} + namespace AppMsgBox { diff --git a/Src/MergeApp.h b/Src/MergeApp.h index 96c05afc63b..d0a2a6fe455 100644 --- a/Src/MergeApp.h +++ b/Src/MergeApp.h @@ -25,6 +25,7 @@ COptionsMgr * GetOptionsMgr(); void LogErrorString(const String& sz); void LogErrorStringUTF8(const std::string& sz); void AppErrorMessageBox(const String& msg); +void* AppGetMainHWND(); namespace AppMsgBox { diff --git a/Src/MergeAppCOMClass.cpp b/Src/MergeAppCOMClass.cpp index 3513af99c0c..85b6e4a550c 100644 --- a/Src/MergeAppCOMClass.cpp +++ b/Src/MergeAppCOMClass.cpp @@ -4,6 +4,7 @@ #include "LanguageSelect.h" #include "OptionsMgr.h" #include "MergeApp.h" +#include "resource.h" static PARAMDATA paramData_Translate[] = { { L"text", VT_BSTR }, }; @@ -13,12 +14,18 @@ static PARAMDATA paramData_SaveOption[] = { { L"name", VT_BSTR }, { L"value", VT_VARIANT}, }; static PARAMDATA paramData_Log[] = { { L"level", VT_I4 }, { L"text", VT_BSTR }, }; +static PARAMDATA paramData_MsgBox[] = +{ { L"prompt", VT_BSTR }, { L"buttons", VT_VARIANT}, { L"title", VT_VARIANT}, }; +static PARAMDATA paramData_InputBox[] = +{ { L"prompt", VT_BSTR }, { L"title", VT_VARIANT}, { L"default", VT_VARIANT}, }; static METHODDATA methodData_MergeApp[] = { { L"Translate", paramData_Translate, DISPID_Translate, 3, CC_STDCALL, 1, DISPATCH_METHOD, VT_BSTR }, { L"GetOption", paramData_GetOption, DISPID_GetOption, 4, CC_STDCALL, 2, DISPATCH_METHOD, VT_VARIANT }, { L"SaveOption", paramData_SaveOption, DISPID_SaveOption, 5, CC_STDCALL, 2, DISPATCH_METHOD, VT_NULL }, { L"Log", paramData_Log, DISPID_Log, 6, CC_STDCALL, 2, DISPATCH_METHOD, VT_NULL }, + { L"MsgBox", paramData_MsgBox, DISPID_MsgBox, 7, CC_STDCALL, 3, DISPATCH_METHOD, VT_I4 }, + { L"InputBox", paramData_InputBox, DISPID_InputBox, 8, CC_STDCALL, 3, DISPATCH_METHOD, VT_BSTR }, }; static INTERFACEDATA idata_MergeApp = { methodData_MergeApp, static_cast(std::size(methodData_MergeApp)) }; @@ -146,3 +153,86 @@ void STDMETHODCALLTYPE MergeAppCOMClass::Log(int level, BSTR text) { LogErrorString(text); } + +int STDMETHODCALLTYPE MergeAppCOMClass::MsgBox(BSTR prompt, VARIANT varButtons, VARIANT varTitle) +{ + VARIANT varButtons2, varTitle2; + VariantInit(&varButtons2); + VariantInit(&varTitle2); + if (FAILED(VariantChangeType(&varButtons2, &varButtons, 0, VT_I4))) + { + varButtons2.vt = VT_I4; + varButtons2.intVal = 0; + } + if (FAILED(VariantChangeType(&varTitle2, &varTitle, 0, VT_BSTR))) + { + varTitle2.vt = VT_BSTR; + varTitle2.bstrVal = SysAllocString(L""); + } + int ans = MessageBox(reinterpret_cast(AppGetMainHWND()), prompt, varTitle2.bstrVal, varButtons2.intVal); + VariantClear(&varButtons2); + VariantClear(&varTitle2); + return ans; +} + +INT_PTR CALLBACK MergeAppCOMClass::InputBoxProc(HWND hWnd, UINT uiMsg, WPARAM wParam, LPARAM lParam) +{ + switch (uiMsg) + { + case WM_INITDIALOG: + { + SetWindowLongPtr(hWnd, GWLP_USERDATA, lParam); + auto* pThis = reinterpret_cast(lParam); + SetWindowText(hWnd, pThis->m_inputBoxTitle.c_str()); + SetDlgItemText(hWnd, IDC_INPUTBOX_PROMPT, pThis->m_inputBoxPrompt.c_str()); + SetDlgItemText(hWnd, IDC_INPUTBOX_EDIT, pThis->m_inputBoxText.c_str()); + return TRUE; + } + case WM_COMMAND: + if (LOWORD(wParam) == IDOK) + { + TCHAR value[2048]{}; + auto* pThis = reinterpret_cast(GetWindowLongPtr(hWnd, GWLP_USERDATA)); + GetDlgItemText(hWnd, IDC_INPUTBOX_EDIT, value, sizeof(value) / sizeof(value[0])); + pThis->m_inputBoxText = value; + EndDialog(hWnd, IDOK); + } + else if (LOWORD(wParam) == IDCANCEL) + { + EndDialog(hWnd, IDCANCEL); + } + return TRUE; + break; + + default: + break; + } + return FALSE; +} + +BSTR STDMETHODCALLTYPE MergeAppCOMClass::InputBox(BSTR prompt, VARIANT varTitle, VARIANT varDefault) +{ + VARIANT varTitle2, varDefault2; + VariantInit(&varTitle2); + VariantInit(&varDefault2); + if (FAILED(VariantChangeType(&varTitle2, &varTitle, 0, VT_BSTR))) + { + varTitle2.vt = VT_BSTR; + varTitle2.bstrVal = SysAllocString(L""); + } + if (FAILED(VariantChangeType(&varDefault2, &varDefault, 0, VT_BSTR))) + { + varDefault2.vt = VT_BSTR; + varDefault2.bstrVal = SysAllocString(L""); + } + m_inputBoxPrompt = prompt; + m_inputBoxTitle = varTitle2.bstrVal; + m_inputBoxText = varDefault2.bstrVal; + VariantClear(&varTitle2); + VariantClear(&varDefault2); + INT_PTR ans = DialogBoxParam(nullptr, MAKEINTRESOURCE(IDD_INPUTBOX), reinterpret_cast(AppGetMainHWND()), InputBoxProc, reinterpret_cast(this)); + if (ans == IDOK) + return SysAllocString(m_inputBoxText.c_str()); + return SysAllocString(L""); +} + diff --git a/Src/MergeAppCOMClass.h b/Src/MergeAppCOMClass.h index cb611bfaa66..912a8daa88b 100644 --- a/Src/MergeAppCOMClass.h +++ b/Src/MergeAppCOMClass.h @@ -8,6 +8,8 @@ enum DISPID_GetOption = 2, DISPID_SaveOption = 3, DISPID_Log = 4, + DISPID_MsgBox = 5, + DISPID_InputBox = 6, }; @@ -89,6 +91,8 @@ struct IMergeApp : public IUnknown virtual VARIANT STDMETHODCALLTYPE GetOption(BSTR name, VARIANT varDefault) = 0; virtual void STDMETHODCALLTYPE SaveOption(BSTR name, VARIANT varValue) = 0; virtual void STDMETHODCALLTYPE Log(int level, BSTR text) = 0; + virtual int STDMETHODCALLTYPE MsgBox(BSTR prompt, VARIANT varButtons, VARIANT varTitle) = 0; + virtual BSTR STDMETHODCALLTYPE InputBox(BSTR prompt, VARIANT varTitle, VARIANT varDefault) = 0; }; class MergeAppCOMClass : public MyDispatch @@ -103,5 +107,12 @@ class MergeAppCOMClass : public MyDispatch VARIANT STDMETHODCALLTYPE GetOption(BSTR name, VARIANT varDefault) override; void STDMETHODCALLTYPE SaveOption(BSTR name, VARIANT varValue) override; void STDMETHODCALLTYPE Log(int level, BSTR text) override; + int STDMETHODCALLTYPE MsgBox(BSTR prompt, VARIANT varButtons, VARIANT varTitle) override; + BSTR STDMETHODCALLTYPE InputBox(BSTR prompt, VARIANT varTitle, VARIANT varDefault) override; +private: + static INT_PTR CALLBACK InputBoxProc(HWND hWnd, UINT uiMsg, WPARAM wParam, LPARAM lParam); + std::wstring m_inputBoxTitle; + std::wstring m_inputBoxPrompt; + std::wstring m_inputBoxText; }; diff --git a/Src/resource.h b/Src/resource.h index 7a24fd448bc..05070915955 100644 --- a/Src/resource.h +++ b/Src/resource.h @@ -80,6 +80,7 @@ #define IDD_EDIT_FIND 282 #define IDD_EDIT_MARKER 283 #define IDD_EDIT_REPLACE 284 +#define IDD_INPUTBOX 285 #define IDI_ROTATE2 302 #define IDR_LOGO 307 #define IDR_SPLASH 308 @@ -282,7 +283,7 @@ #define IDC_PLUGIN_ADDPIPE 1095 #define IDC_PLUGIN_OPEN_IN_SAME_FRAME_TYPE 1096 #define IDC_UNPACKER_COMBO 1097 -#define IDC_PREDIFFER_COMBO 1098 +#define IDC_PREDIFFER_COMBO 1098 #define IDC_SELECT_UNPACKER 1099 #define IDC_SELECT_PREDIFFER 1100 #define IDC_EXT_EDITOR_BROWSE 1101 @@ -603,7 +604,7 @@ #define IDC_PATH0_READONLY 1606 #define IDC_PATH1_READONLY 1607 #define IDC_PATH2_READONLY 1608 -#define IDC_AUTO_RELOAD_MODIFIED_FILES 1609 +#define IDC_AUTO_RELOAD_MODIFIED_FILES 1609 #define IDC_MARKER0_COLOR_LABEL 1611 #define IDC_MARKER1_COLOR_LABEL 1612 #define IDC_MARKER2_COLOR_LABEL 1613 @@ -625,6 +626,8 @@ #define IDC_COMPARE 1630 #define IDC_SHOWDIFFERENCES 1631 #define IDC_SYNC_EVENTS 1632 +#define IDC_INPUTBOX_PROMPT 1633 +#define IDC_INPUTBOX_EDIT 1634 #define IDC_EDIT_WHOLE_WORD 8603 #define IDC_EDIT_MATCH_CASE 8604 #define IDC_EDIT_FINDTEXT 8605 @@ -1662,15 +1665,14 @@ #define IDS_WEBPAGE_COMPARING 44539 #define IDS_WEBPAGE_ZOOM 44540 - // Next default values for new objects // #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_3D_CONTROLS 1 -#define _APS_NEXT_RESOURCE_VALUE 258 +#define _APS_NEXT_RESOURCE_VALUE 287 #define _APS_NEXT_COMMAND_VALUE 34194 -#define _APS_NEXT_CONTROL_VALUE 1632 +#define _APS_NEXT_CONTROL_VALUE 1635 #define _APS_NEXT_SYMED_VALUE 118 #endif #endif diff --git a/Testing/FolderCompare/misc.cpp b/Testing/FolderCompare/misc.cpp index c7cdf3dc0c1..8e2672c124d 100644 --- a/Testing/FolderCompare/misc.cpp +++ b/Testing/FolderCompare/misc.cpp @@ -70,3 +70,9 @@ String tr(const std::wstring& str) void NTAPI LangTranslateDialog(HWND h) { } + +void* AppGetMainHWND() +{ + return nullptr; +} + From 823cb8b79770b4d6ec20346d0c5202ce23bf3802 Mon Sep 17 00:00:00 2001 From: Takashi Sawanaka Date: Mon, 22 Jan 2024 23:21:06 +0900 Subject: [PATCH 13/58] WIP --- .gitignore | 2 + Src/Merge.vcxproj | 10 +- Src/Merge.vcxproj.filters | 5 + Src/Merge2.rc | 6 + Src/MergeAppCOMClass.cpp | 80 ++++----- Src/MergeAppCOMClass.h | 38 ++--- Src/MergeAppLib.h | 335 ++++++++++++++++++++++++++++++++++++++ Src/MergeAppLib.idl | 34 ++++ 8 files changed, 437 insertions(+), 73 deletions(-) create mode 100644 Src/MergeAppLib.h create mode 100644 Src/MergeAppLib.idl diff --git a/.gitignore b/.gitignore index 8a1eece0da1..25d5c969526 100644 --- a/.gitignore +++ b/.gitignore @@ -122,3 +122,5 @@ Testing/Data/Symlink/Dir2/ss12_diff_s12.txt Testing/Data/Symlink/Dir2/ss12_diff_s21.txt Testing/Data/Symlink/Dir2/ss12_same_s00.txt Testing/Data/Symlink/Dir2/ss12_same_s11.txt +Src/MergeAppLib_i.c +Src/MergeAppLib_p.c diff --git a/Src/Merge.vcxproj b/Src/Merge.vcxproj index fdfa472f1ea..81d9c2f44c6 100644 --- a/Src/Merge.vcxproj +++ b/Src/Merge.vcxproj @@ -1684,7 +1684,9 @@ - + + $(INTDIR);%(AdditionalIncludeDirectories);$(_ZVcpkgCurrentInstalledDir)include + true @@ -1808,6 +1810,12 @@ + + + false + $(IntDir)$(ProjectName).tlb + + diff --git a/Src/Merge.vcxproj.filters b/Src/Merge.vcxproj.filters index 527b1cfb21b..8b423d23a4f 100644 --- a/Src/Merge.vcxproj.filters +++ b/Src/Merge.vcxproj.filters @@ -1817,4 +1817,9 @@ Resource Files + + + Source Files + + \ No newline at end of file diff --git a/Src/Merge2.rc b/Src/Merge2.rc index 47c8ece4696..4341f171801 100644 --- a/Src/Merge2.rc +++ b/Src/Merge2.rc @@ -207,6 +207,12 @@ IDB_FILE_NEW3_WEBPAGE BITMAP "res\\new3_webpage.bmp" IDR_MARGIN_CURSOR CURSOR "res\\mg_cur.cur" +///////////////////////////////////////////////////////////////////////////// +// +// TypeLib +// +1 TYPELIB "Merge.tlb" + #ifndef _MAC ///////////////////////////////////////////////////////////////////////////// // diff --git a/Src/MergeAppCOMClass.cpp b/Src/MergeAppCOMClass.cpp index 85b6e4a550c..5aa949cae5d 100644 --- a/Src/MergeAppCOMClass.cpp +++ b/Src/MergeAppCOMClass.cpp @@ -6,32 +6,8 @@ #include "MergeApp.h" #include "resource.h" -static PARAMDATA paramData_Translate[] = -{ { L"text", VT_BSTR }, }; -static PARAMDATA paramData_GetOption[] = -{ { L"name", VT_BSTR }, { L"defaultValue", VT_VARIANT}, }; -static PARAMDATA paramData_SaveOption[] = -{ { L"name", VT_BSTR }, { L"value", VT_VARIANT}, }; -static PARAMDATA paramData_Log[] = -{ { L"level", VT_I4 }, { L"text", VT_BSTR }, }; -static PARAMDATA paramData_MsgBox[] = -{ { L"prompt", VT_BSTR }, { L"buttons", VT_VARIANT}, { L"title", VT_VARIANT}, }; -static PARAMDATA paramData_InputBox[] = -{ { L"prompt", VT_BSTR }, { L"title", VT_VARIANT}, { L"default", VT_VARIANT}, }; -static METHODDATA methodData_MergeApp[] = -{ - { L"Translate", paramData_Translate, DISPID_Translate, 3, CC_STDCALL, 1, DISPATCH_METHOD, VT_BSTR }, - { L"GetOption", paramData_GetOption, DISPID_GetOption, 4, CC_STDCALL, 2, DISPATCH_METHOD, VT_VARIANT }, - { L"SaveOption", paramData_SaveOption, DISPID_SaveOption, 5, CC_STDCALL, 2, DISPATCH_METHOD, VT_NULL }, - { L"Log", paramData_Log, DISPID_Log, 6, CC_STDCALL, 2, DISPATCH_METHOD, VT_NULL }, - { L"MsgBox", paramData_MsgBox, DISPID_MsgBox, 7, CC_STDCALL, 3, DISPATCH_METHOD, VT_I4 }, - { L"InputBox", paramData_InputBox, DISPID_InputBox, 8, CC_STDCALL, 3, DISPATCH_METHOD, VT_BSTR }, -}; - -static INTERFACEDATA idata_MergeApp = { methodData_MergeApp, static_cast(std::size(methodData_MergeApp)) }; - MergeAppCOMClass::MergeAppCOMClass() - : MyDispatch(&idata_MergeApp, static_cast(this)) + : MyDispatch(static_cast(this)) { } @@ -39,12 +15,13 @@ MergeAppCOMClass::~MergeAppCOMClass() { } -BSTR STDMETHODCALLTYPE MergeAppCOMClass::Translate(BSTR text) +HRESULT STDMETHODCALLTYPE MergeAppCOMClass::Translate(BSTR text, BSTR* pRet) { - return SysAllocString(tr(text).c_str()); + *pRet = SysAllocString(tr(text).c_str()); + return S_OK; } -VARIANT STDMETHODCALLTYPE MergeAppCOMClass::GetOption(BSTR name, VARIANT varDefault) +HRESULT STDMETHODCALLTYPE MergeAppCOMClass::GetOption(BSTR name, VARIANT varDefault, VARIANT* pRet) { VARIANT varResult; VariantInit(&varResult); @@ -67,7 +44,8 @@ VARIANT STDMETHODCALLTYPE MergeAppCOMClass::GetOption(BSTR name, VARIANT varDefa GetOptionsMgr()->InitOption(name, pvar->bstrVal); break; default: - return varResult; + *pRet = varResult; + return S_OK;; } value = GetOptionsMgr()->Get(name); } @@ -92,10 +70,11 @@ VARIANT STDMETHODCALLTYPE MergeAppCOMClass::GetOption(BSTR name, VARIANT varDefa varResult.vt = VT_EMPTY; break; } - return varResult; + *pRet = varResult; + return S_OK;; } -void STDMETHODCALLTYPE MergeAppCOMClass::SaveOption(BSTR name, VARIANT varValue) +HRESULT STDMETHODCALLTYPE MergeAppCOMClass::SaveOption(BSTR name, VARIANT varValue) { auto value = GetOptionsMgr()->Get(name); const VARIANT* pvar = ((varValue.vt & VT_BYREF) != 0) ? varValue.pvarVal : &varValue; @@ -116,7 +95,7 @@ void STDMETHODCALLTYPE MergeAppCOMClass::SaveOption(BSTR name, VARIANT varValue) GetOptionsMgr()->InitOption(name, pvar->bstrVal); break; default: - return; + return S_OK; } value = GetOptionsMgr()->Get(name); } @@ -125,36 +104,28 @@ void STDMETHODCALLTYPE MergeAppCOMClass::SaveOption(BSTR name, VARIANT varValue) case varprop::VT_BOOL: if (pvar->vt == VT_BOOL) GetOptionsMgr()->SaveOption(name, pvar->boolVal); - return; + return S_OK; case varprop::VT_INT: if (pvar->vt == VT_I2) - { GetOptionsMgr()->SaveOption(name, pvar->iVal); - return; - } - if (pvar->vt == VT_I4) - { + else if (pvar->vt == VT_I4) GetOptionsMgr()->SaveOption(name, pvar->intVal); - return; - } - return; + return S_OK; case varprop::VT_STRING: if (pvar->vt == VT_BSTR) - { GetOptionsMgr()->SaveOption(name, pvar->bstrVal); - return; - } - return; + return S_OK; } - return; + return S_OK; } -void STDMETHODCALLTYPE MergeAppCOMClass::Log(int level, BSTR text) +HRESULT STDMETHODCALLTYPE MergeAppCOMClass::Log(int level, BSTR text) { LogErrorString(text); + return S_OK; } -int STDMETHODCALLTYPE MergeAppCOMClass::MsgBox(BSTR prompt, VARIANT varButtons, VARIANT varTitle) +HRESULT STDMETHODCALLTYPE MergeAppCOMClass::MsgBox(BSTR prompt, VARIANT varButtons, VARIANT varTitle, int* pRet) { VARIANT varButtons2, varTitle2; VariantInit(&varButtons2); @@ -172,7 +143,8 @@ int STDMETHODCALLTYPE MergeAppCOMClass::MsgBox(BSTR prompt, VARIANT varButtons, int ans = MessageBox(reinterpret_cast(AppGetMainHWND()), prompt, varTitle2.bstrVal, varButtons2.intVal); VariantClear(&varButtons2); VariantClear(&varTitle2); - return ans; + *pRet = ans; + return S_OK; } INT_PTR CALLBACK MergeAppCOMClass::InputBoxProc(HWND hWnd, UINT uiMsg, WPARAM wParam, LPARAM lParam) @@ -210,7 +182,7 @@ INT_PTR CALLBACK MergeAppCOMClass::InputBoxProc(HWND hWnd, UINT uiMsg, WPARAM wP return FALSE; } -BSTR STDMETHODCALLTYPE MergeAppCOMClass::InputBox(BSTR prompt, VARIANT varTitle, VARIANT varDefault) +HRESULT STDMETHODCALLTYPE MergeAppCOMClass::InputBox(BSTR prompt, VARIANT varTitle, VARIANT varDefault, BSTR* pRet) { VARIANT varTitle2, varDefault2; VariantInit(&varTitle2); @@ -232,7 +204,11 @@ BSTR STDMETHODCALLTYPE MergeAppCOMClass::InputBox(BSTR prompt, VARIANT varTitle, VariantClear(&varDefault2); INT_PTR ans = DialogBoxParam(nullptr, MAKEINTRESOURCE(IDD_INPUTBOX), reinterpret_cast(AppGetMainHWND()), InputBoxProc, reinterpret_cast(this)); if (ans == IDOK) - return SysAllocString(m_inputBoxText.c_str()); - return SysAllocString(L""); + { + *pRet = SysAllocString(m_inputBoxText.c_str()); + return S_OK; + } + *pRet = SysAllocString(L""); + return S_OK; } diff --git a/Src/MergeAppCOMClass.h b/Src/MergeAppCOMClass.h index 912a8daa88b..69cf38f0459 100644 --- a/Src/MergeAppCOMClass.h +++ b/Src/MergeAppCOMClass.h @@ -1,6 +1,7 @@ #pragma once #include +#include "MergeAppLib.h" enum { @@ -14,15 +15,21 @@ enum template -class MyDispatch : public T, public IDispatch +class MyDispatch : public T { public: - MyDispatch(INTERFACEDATA* idata, void* pThis) + MyDispatch(void* pThis) : m_cRef(0), m_pTypeInfo(nullptr) { + tchar_t path[MAX_PATH]; + ITypeLib* pTypeLib = nullptr; ITypeInfo* pTypeInfo = nullptr; - if (SUCCEEDED(CreateDispTypeInfo(idata, LOCALE_SYSTEM_DEFAULT, &pTypeInfo))) - m_pTypeInfo = pTypeInfo; + GetModuleFileName(nullptr, path, sizeof(path) / sizeof(path[0])); + if (SUCCEEDED(LoadTypeLib(path, &pTypeLib))) + { + pTypeLib->GetTypeInfoOfGuid(__uuidof(T), &m_pTypeInfo); + pTypeLib->Release(); + } } virtual ~MyDispatch() @@ -67,6 +74,7 @@ class MyDispatch : public T, public IDispatch HRESULT STDMETHODCALLTYPE GetTypeInfo(UINT iTInfo, LCID lcid, ITypeInfo** ppTInfo) override { + m_pTypeInfo->AddRef(); ppTInfo = &m_pTypeInfo; return S_OK; } @@ -85,16 +93,6 @@ class MyDispatch : public T, public IDispatch ITypeInfo* m_pTypeInfo; }; -struct IMergeApp : public IUnknown -{ - virtual BSTR STDMETHODCALLTYPE Translate(BSTR text) = 0; - virtual VARIANT STDMETHODCALLTYPE GetOption(BSTR name, VARIANT varDefault) = 0; - virtual void STDMETHODCALLTYPE SaveOption(BSTR name, VARIANT varValue) = 0; - virtual void STDMETHODCALLTYPE Log(int level, BSTR text) = 0; - virtual int STDMETHODCALLTYPE MsgBox(BSTR prompt, VARIANT varButtons, VARIANT varTitle) = 0; - virtual BSTR STDMETHODCALLTYPE InputBox(BSTR prompt, VARIANT varTitle, VARIANT varDefault) = 0; -}; - class MergeAppCOMClass : public MyDispatch { public: @@ -103,12 +101,12 @@ class MergeAppCOMClass : public MyDispatch virtual ~MergeAppCOMClass(); MergeAppCOMClass& operator=(const MergeAppCOMClass&) = delete; - BSTR STDMETHODCALLTYPE Translate(BSTR text) override; - VARIANT STDMETHODCALLTYPE GetOption(BSTR name, VARIANT varDefault) override; - void STDMETHODCALLTYPE SaveOption(BSTR name, VARIANT varValue) override; - void STDMETHODCALLTYPE Log(int level, BSTR text) override; - int STDMETHODCALLTYPE MsgBox(BSTR prompt, VARIANT varButtons, VARIANT varTitle) override; - BSTR STDMETHODCALLTYPE InputBox(BSTR prompt, VARIANT varTitle, VARIANT varDefault) override; + HRESULT STDMETHODCALLTYPE Translate(BSTR text, BSTR* pRet) override; + HRESULT STDMETHODCALLTYPE GetOption(BSTR name, VARIANT varDefault, VARIANT* pRet) override; + HRESULT STDMETHODCALLTYPE SaveOption(BSTR name, VARIANT varValue) override; + HRESULT STDMETHODCALLTYPE Log(int level, BSTR text) override; + HRESULT STDMETHODCALLTYPE MsgBox(BSTR prompt, VARIANT varButtons, VARIANT varTitle, int* pRet) override; + HRESULT STDMETHODCALLTYPE InputBox(BSTR prompt, VARIANT varTitle, VARIANT varDefault, BSTR* pRet) override; private: static INT_PTR CALLBACK InputBoxProc(HWND hWnd, UINT uiMsg, WPARAM wParam, LPARAM lParam); std::wstring m_inputBoxTitle; diff --git a/Src/MergeAppLib.h b/Src/MergeAppLib.h new file mode 100644 index 00000000000..c89c05a6ac5 --- /dev/null +++ b/Src/MergeAppLib.h @@ -0,0 +1,335 @@ + + +/* this ALWAYS GENERATED file contains the definitions for the interfaces */ + + + /* File created by MIDL compiler version 8.01.0628 */ +/* at Tue Jan 19 12:14:07 2038 + */ +/* Compiler settings for MergeAppLib.idl: + Oicf, W1, Zp8, env=Win64 (32b run), target_arch=AMD64 8.01.0628 + protocol : all , ms_ext, c_ext, robust + error checks: allocation ref bounds_check enum stub_data + VC __declspec() decoration level: + __declspec(uuid()), __declspec(selectany), __declspec(novtable) + DECLSPEC_UUID(), MIDL_INTERFACE() +*/ +/* @@MIDL_FILE_HEADING( ) */ + + + +/* verify that the version is high enough to compile this file*/ +#ifndef __REQUIRED_RPCNDR_H_VERSION__ +#define __REQUIRED_RPCNDR_H_VERSION__ 500 +#endif + +#include "rpc.h" +#include "rpcndr.h" + +#ifndef __RPCNDR_H_VERSION__ +#error this stub requires an updated version of +#endif /* __RPCNDR_H_VERSION__ */ + +#ifndef COM_NO_WINDOWS_H +#include "windows.h" +#include "ole2.h" +#endif /*COM_NO_WINDOWS_H*/ + +#ifndef __MergeAppLib_h__ +#define __MergeAppLib_h__ + +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#pragma once +#endif + +#ifndef DECLSPEC_XFGVIRT +#if defined(_CONTROL_FLOW_GUARD_XFG) +#define DECLSPEC_XFGVIRT(base, func) __declspec(xfg_virtual(base, func)) +#else +#define DECLSPEC_XFGVIRT(base, func) +#endif +#endif + +/* Forward Declarations */ + +#ifndef __IMergeApp_FWD_DEFINED__ +#define __IMergeApp_FWD_DEFINED__ +typedef interface IMergeApp IMergeApp; + +#endif /* __IMergeApp_FWD_DEFINED__ */ + + +#ifndef __IMergeApp_FWD_DEFINED__ +#define __IMergeApp_FWD_DEFINED__ +typedef interface IMergeApp IMergeApp; + +#endif /* __IMergeApp_FWD_DEFINED__ */ + + +/* header files for imported files */ +#include "oaidl.h" +#include "ocidl.h" + +#ifdef __cplusplus +extern "C"{ +#endif + + +#ifndef __IMergeApp_INTERFACE_DEFINED__ +#define __IMergeApp_INTERFACE_DEFINED__ + +/* interface IMergeApp */ +/* [unique][helpstring][uuid][object] */ + + +EXTERN_C const IID IID_IMergeApp; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("a719a330-c39a-4d8b-bf5a-8e52f4dd8da3") + IMergeApp : public IDispatch + { + public: + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE Translate( + /* [in] */ BSTR text, + /* [retval][out] */ BSTR *pRet) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE GetOption( + /* [in] */ BSTR name, + /* [in] */ VARIANT varDefault, + /* [retval][out] */ VARIANT *pRet) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE SaveOption( + /* [in] */ BSTR name, + /* [in] */ VARIANT varValue) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE Log( + /* [in] */ int level, + /* [in] */ BSTR text) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE MsgBox( + /* [in] */ BSTR prompt, + /* [optional][in] */ VARIANT varButtons, + /* [optional][in] */ VARIANT varTitle, + /* [retval][out] */ int *pRet) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE InputBox( + /* [in] */ BSTR prompt, + /* [optional][in] */ VARIANT varTitle, + /* [optional][in] */ VARIANT varDefault, + /* [retval][out] */ BSTR *pRet) = 0; + + }; + + +#else /* C style interface */ + + typedef struct IMergeAppVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IMergeApp * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + IMergeApp * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + IMergeApp * This); + + DECLSPEC_XFGVIRT(IDispatch, GetTypeInfoCount) + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + IMergeApp * This, + /* [out] */ UINT *pctinfo); + + DECLSPEC_XFGVIRT(IDispatch, GetTypeInfo) + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + IMergeApp * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + DECLSPEC_XFGVIRT(IDispatch, GetIDsOfNames) + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + IMergeApp * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [range][in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + DECLSPEC_XFGVIRT(IDispatch, Invoke) + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + IMergeApp * This, + /* [annotation][in] */ + _In_ DISPID dispIdMember, + /* [annotation][in] */ + _In_ REFIID riid, + /* [annotation][in] */ + _In_ LCID lcid, + /* [annotation][in] */ + _In_ WORD wFlags, + /* [annotation][out][in] */ + _In_ DISPPARAMS *pDispParams, + /* [annotation][out] */ + _Out_opt_ VARIANT *pVarResult, + /* [annotation][out] */ + _Out_opt_ EXCEPINFO *pExcepInfo, + /* [annotation][out] */ + _Out_opt_ UINT *puArgErr); + + DECLSPEC_XFGVIRT(IMergeApp, Translate) + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Translate )( + IMergeApp * This, + /* [in] */ BSTR text, + /* [retval][out] */ BSTR *pRet); + + DECLSPEC_XFGVIRT(IMergeApp, GetOption) + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *GetOption )( + IMergeApp * This, + /* [in] */ BSTR name, + /* [in] */ VARIANT varDefault, + /* [retval][out] */ VARIANT *pRet); + + DECLSPEC_XFGVIRT(IMergeApp, SaveOption) + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *SaveOption )( + IMergeApp * This, + /* [in] */ BSTR name, + /* [in] */ VARIANT varValue); + + DECLSPEC_XFGVIRT(IMergeApp, Log) + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Log )( + IMergeApp * This, + /* [in] */ int level, + /* [in] */ BSTR text); + + DECLSPEC_XFGVIRT(IMergeApp, MsgBox) + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *MsgBox )( + IMergeApp * This, + /* [in] */ BSTR prompt, + /* [optional][in] */ VARIANT varButtons, + /* [optional][in] */ VARIANT varTitle, + /* [retval][out] */ int *pRet); + + DECLSPEC_XFGVIRT(IMergeApp, InputBox) + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *InputBox )( + IMergeApp * This, + /* [in] */ BSTR prompt, + /* [optional][in] */ VARIANT varTitle, + /* [optional][in] */ VARIANT varDefault, + /* [retval][out] */ BSTR *pRet); + + END_INTERFACE + } IMergeAppVtbl; + + interface IMergeApp + { + CONST_VTBL struct IMergeAppVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IMergeApp_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define IMergeApp_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define IMergeApp_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define IMergeApp_GetTypeInfoCount(This,pctinfo) \ + ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) + +#define IMergeApp_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) + +#define IMergeApp_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) + +#define IMergeApp_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) + + +#define IMergeApp_Translate(This,text,pRet) \ + ( (This)->lpVtbl -> Translate(This,text,pRet) ) + +#define IMergeApp_GetOption(This,name,varDefault,pRet) \ + ( (This)->lpVtbl -> GetOption(This,name,varDefault,pRet) ) + +#define IMergeApp_SaveOption(This,name,varValue) \ + ( (This)->lpVtbl -> SaveOption(This,name,varValue) ) + +#define IMergeApp_Log(This,level,text) \ + ( (This)->lpVtbl -> Log(This,level,text) ) + +#define IMergeApp_MsgBox(This,prompt,varButtons,varTitle,pRet) \ + ( (This)->lpVtbl -> MsgBox(This,prompt,varButtons,varTitle,pRet) ) + +#define IMergeApp_InputBox(This,prompt,varTitle,varDefault,pRet) \ + ( (This)->lpVtbl -> InputBox(This,prompt,varTitle,varDefault,pRet) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __IMergeApp_INTERFACE_DEFINED__ */ + + + +#ifndef __MergeAppLib_LIBRARY_DEFINED__ +#define __MergeAppLib_LIBRARY_DEFINED__ + +/* library MergeAppLib */ +/* [helpstring][version][uuid] */ + + + +EXTERN_C const IID LIBID_MergeAppLib; +#endif /* __MergeAppLib_LIBRARY_DEFINED__ */ + +/* Additional Prototypes for ALL interfaces */ + +unsigned long __RPC_USER BSTR_UserSize( unsigned long *, unsigned long , BSTR * ); +unsigned char * __RPC_USER BSTR_UserMarshal( unsigned long *, unsigned char *, BSTR * ); +unsigned char * __RPC_USER BSTR_UserUnmarshal(unsigned long *, unsigned char *, BSTR * ); +void __RPC_USER BSTR_UserFree( unsigned long *, BSTR * ); + +unsigned long __RPC_USER VARIANT_UserSize( unsigned long *, unsigned long , VARIANT * ); +unsigned char * __RPC_USER VARIANT_UserMarshal( unsigned long *, unsigned char *, VARIANT * ); +unsigned char * __RPC_USER VARIANT_UserUnmarshal(unsigned long *, unsigned char *, VARIANT * ); +void __RPC_USER VARIANT_UserFree( unsigned long *, VARIANT * ); + +unsigned long __RPC_USER BSTR_UserSize64( unsigned long *, unsigned long , BSTR * ); +unsigned char * __RPC_USER BSTR_UserMarshal64( unsigned long *, unsigned char *, BSTR * ); +unsigned char * __RPC_USER BSTR_UserUnmarshal64(unsigned long *, unsigned char *, BSTR * ); +void __RPC_USER BSTR_UserFree64( unsigned long *, BSTR * ); + +unsigned long __RPC_USER VARIANT_UserSize64( unsigned long *, unsigned long , VARIANT * ); +unsigned char * __RPC_USER VARIANT_UserMarshal64( unsigned long *, unsigned char *, VARIANT * ); +unsigned char * __RPC_USER VARIANT_UserUnmarshal64(unsigned long *, unsigned char *, VARIANT * ); +void __RPC_USER VARIANT_UserFree64( unsigned long *, VARIANT * ); + +/* end of Additional Prototypes */ + +#ifdef __cplusplus +} +#endif + +#endif + + diff --git a/Src/MergeAppLib.idl b/Src/MergeAppLib.idl new file mode 100644 index 00000000000..7d3f1c8d3c0 --- /dev/null +++ b/Src/MergeAppLib.idl @@ -0,0 +1,34 @@ +// This file will be processed by the MIDL tool to +// produce the type library (MergeAppLib.tlb) and marshalling code. + +import "oaidl.idl"; +import "ocidl.idl"; + +[ + object, + uuid(a719a330-c39a-4d8b-bf5a-8e52f4dd8da3), + helpstring("IMergeApp Interface"), + pointer_default(unique) +] +interface IMergeApp : IDispatch +{ + [id(1), helpstring("method Translate")] HRESULT Translate([in] BSTR text, [out, retval] BSTR* pRet); + [id(2), helpstring("method GetOption")] HRESULT GetOption([in] BSTR name, [in] VARIANT varDefault, [out, retval] VARIANT* pRet); + [id(3), helpstring("method SaveOption")] HRESULT SaveOption([in] BSTR name, [in] VARIANT varValue); + [id(4), helpstring("method Log")] HRESULT Log([in] int level, [in] BSTR text); + [id(5), helpstring("method MsgBox")] HRESULT MsgBox([in] BSTR prompt, [in, optional] VARIANT varButtons, [in, optional] VARIANT varTitle, [out, retval] int* pRet); + [id(6), helpstring("method InputBox")] HRESULT InputBox([in] BSTR prompt, [in, optional] VARIANT varTitle, [in, optional] VARIANT varDefault, [out, retval] BSTR* pRet); +}; + +[ + uuid(3bc1ff50-9fb8-4796-a0c3-966eda88ab15), + version(1.0), + helpstring("MergeApp Type Library") +] +library MergeAppLib +{ + importlib("stdole32.tlb"); + importlib("stdole2.tlb"); + + interface IMergeApp; +}; From 88169dd533d90fe36e005bf426efe3b318dd1ef7 Mon Sep 17 00:00:00 2001 From: Takashi Sawanaka Date: Mon, 22 Jan 2024 23:22:31 +0900 Subject: [PATCH 14/58] WIP --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 25d5c969526..62a7602b1c7 100644 --- a/.gitignore +++ b/.gitignore @@ -124,3 +124,4 @@ Testing/Data/Symlink/Dir2/ss12_same_s00.txt Testing/Data/Symlink/Dir2/ss12_same_s11.txt Src/MergeAppLib_i.c Src/MergeAppLib_p.c +Src/dlldata.c From 1f113612f2828af6e1cd054b223143364ebfdf74 Mon Sep 17 00:00:00 2001 From: Takashi Sawanaka Date: Mon, 29 Jan 2024 07:35:48 +0900 Subject: [PATCH 15/58] WIP --- Plugins/dlls/editor addin.sct | 236 ++++++++++++++++------------------ 1 file changed, 111 insertions(+), 125 deletions(-) diff --git a/Plugins/dlls/editor addin.sct b/Plugins/dlls/editor addin.sct index 7cfaab71fe7..fe01f591398 100644 --- a/Plugins/dlls/editor addin.sct +++ b/Plugins/dlls/editor addin.sct @@ -177,131 +177,115 @@ function IsFirstArgumentEmpty() { } function ParseArguments(args) { - var ary() - var ch - var inQuotes - var token - var argsLen - var i, j - argsLen = Len(args) - For i = 1 To argsLen - ch = Mid(args, i, 1) - if (Not inQuotes) { - if (ch = " " Or ch = vbTab) { - if (len(token) > 0) { - ReDim Preserve ary(j) - ary(j) = token - j = j + 1 + var ary = new Array(); + var token = ""; + var argsLen = args.length; + var inQuotes = false; + for (var i = 0; i < argsLen; i++) { + var ch = args.charAt(i); + if (!inQuotes) { + if (ch === " " || ch === "\t") { + if (token.length > 0) { + ary.push(token); token = "" } - } else if ( ch = """") { - inQuotes = True + } else if (ch === "\"") { + inQuotes = true; } else { - token = token + ch + token += ch; } } else { - if (ch = """") { - if (i + 1 <= argsLen) { - if (Mid(args, i + 1, 1) = """") { - token = token + ch - End if + if (ch === "\"") { + if (i + 1 < argsLen) { + if (args.charAt(i) === "\"") { + token += ch; + } } - inQuotes = False + inQuotes = false; } else { - token = token + ch + token += ch; } } } if (Len(token) > 0) { - ReDim Preserve ary(j) - ary(j) = token - j = j + 1 + ary.push(token); token = "" } - ParseArguments = ary + return ary; } function ParseRanges(rangeText) { - var i, j - var ary, ary2, aryRanges() - var rangeFrom, rangeTo - ary = Split(rangeText, ",") - j = 0 - For i = 0 To SafeUBound(ary) - ary2 = Split(ary(i), "-") - rangeFrom = "" - if (SafeUBound(ary2) >= 0) { - rangeFrom = Trim(ary2(0)) + var aryRanges = new Array(); + var ary = rangeText.split(","); + for (var i = 0, j = 0; i < ary.length; i++) { + var ary2 = ary[i].split("-"); + var rangeFrom = "" + if (ary2.length > 0) { + rangeFrom = ary2[0].replace(/^\s+|\s+$/g, ""); } - rangeTo = rangeFrom - if (SafeUBound(ary2) > 0) { - rangeTo = Trim(ary2(1)) + var rangeTo = rangeFrom; + if (ary2 > 1) { + rangeTo = ary2[1].replace(/^\s+|\s+$/g, ""); } - if (IsNumeric(rangeFrom) Or IsNumeric(rangeTo)) { - if (Not IsNumeric(rangeFrom)) { rangeFrom = 1 - if (Not IsNumeric(rangeTo) ) { rangeTo = 1000000000 - if (CDbl(rangeFrom) < 1 Or CDbl(rangeFrom) > 1000000000) { rangeFrom = 1 - if (CDbl(rangeTo) < 1 Or CDbl(rangeTo) > 1000000000) { rangeTo = 1 - if (CDbl(rangeFrom) > CDbl(rangeTo)) { rangeTo = rangeFrom - Redim preserve aryRanges(j) - aryRanges(j) = Array(CLng(rangeFrom), CLng(rangeTo)) - j = j + 1 + if (!isNan(rangeFrom) || !isNan(rangeTo)) { + if (isNan(rangeFrom)) { rangeFrom = 1; } + if (isNan(rangeTo)) { rangeTo = 1000000000; } + if (parseFloat(rangeFrom) < 1 || parseFloat(rangeFrom) > 1000000000) { rangeFrom = 1; } + if (parseFloat(rangeTo) < 1 || parseFloat(rangeTo) > 1000000000) { rangeTo = 1; } + if (parseFloat(rangeFrom) > parseFloat(rangeTo)) { rangeTo = rangeFrom; } + aryRanges.push([parseInt(rangeFrom), parseInt(rangeTo)]); } } - ParseRanges = aryRanges -} - -function ParseSelectColumnsLinesArguments(args, invert) { - var rangesOrRegExps() - var argAry - var i, j - var re - var isOption - re = Nothing - argAry = ParseArguments(args) - invert = False - For i = 0 To SafeUBound(argAry) - isOption = False - if (Len(argAry(i)) >= 2) { - Select Case Left(argAry(i), 1) - Case "-", "/" - Select Case Mid(argAry(i), 2, 1) - Case "e", "i", "g" - isOption = True - if (re Is Nothing) { - re = New RegExp - Redim Preserve rangesOrRegExps(j) - rangesOrRegExps(j) = re - j = j + 1 + return aryRanges; +} + +function ParseSelectColumnsLinesArguments(args) { + var rangesOrRegExps = new Array(); + var re; + var argAry = ParseArguments(args); + var invert = false; + var flags = ""; + for (var i = 0; i < argAry.length; i++) { + var isOption = false; + if (argAry[i].length >= 2) { + switch (argAry[i].charAt[0]) { + case "-", "/": + switch (argAry[i].charAt[1]) { + case "e", "i", "g": + isOption = true; + if (!re) { + re = new RegExp(); + rangesOrRegExps.push(re) } - if (InStr(argAry(i), "i") > 0) { - re.IgnoreCase = True + flags = ""; + if (argAry[i].indexOf("g") >= 0) { + flags += "g"; } - if (InStr(argAry(i), "g") > 0) { - re.Global = True + if (argAry[i].indexOf("i") >= 0) { + flags += "i"; } - Case "v" - isOption = True - invert = True - End Select - End Select + break; + case "v": + isOption = true; + invert = true; + break; + } + } + break; } - if (Not isOption) { - if (Not (re Is Nothing)) { - re.Pattern = argAry(i) - re = Nothing + if (!isOption) { + if (!re) { + pattern = argAry(i) + re = null; } else { - Redim Preserve rangesOrRegExps(j) - rangesOrRegExps(j) = ParseRanges(argAry(i)) - if (SafeUBound(rangesOrRegExps(j)) < 0) { - rangesOrRegExps(j) = New RegExp - rangesOrRegExps(j).Pattern = argAry(i) + rangesOrRegExps.push(ParseRanges(argAry[i])) + if (rangesOrRegExps(j) == 0) { + rangesOrRegExps[rangesOrRegExps.length - 1] = new RegExp(argAry[i]); } - j = j + 1 } } } - ParseSelectColumnsLinesArguments = rangesOrRegExps + return { "rangesOrRegExps": rangesOrRegExps, "invert": invert }; } function ParseReplaceArguments(args, regex, ignoreCase) { @@ -312,22 +296,24 @@ function ParseReplaceArguments(args, regex, ignoreCase) { var isOption re = Nothing argAry = ParseArguments(args) - regex = False - ignoreCase = False + regex = false; + ignoreCase = false; For i = 0 To SafeUBound(argAry) - isOption = False + isOption = false; if (Len(argAry(i)) >= 2) { - Select Case Left(argAry(i), 1) - Case "-", "/" - Select Case Mid(argAry(i), 2, 1) - Case "e", "i" - isOption = True - regex = True + Select case Left(argAry(i), 1) + case "-", "/" + Select case Mid(argAry(i), 2, 1) + case "e", "i" + isOption = true; + regex = true; if (InStr(argAry(i), "i") > 0) { - ignoreCase = True + ignoreCase = true; } - End Select - End Select + break; + } + break; + } } if (Not isOption) { Redim Preserve patterns(j) @@ -347,37 +333,37 @@ function Unescape(text) { i = 1 Do While i <= textLen ch = Mid(text, i, 1) - Select Case ch - Case "\\" + Select case ch + case "\\" if (i <= textLen - 1) { i = i + 1 ch = Mid(text, i, 1) - Select Case ch - Case "a" + Select case ch + case "a" Unescape = Unescape + Chr(+H07) - Case "b" + case "b" Unescape = Unescape + Chr(+H08) - Case "t" + case "t" Unescape = Unescape + Chr(+H09) - Case "n" + case "n" Unescape = Unescape + Chr(+H0A) - Case "v" + case "v" Unescape = Unescape + Chr(+H0B) - Case "f" + case "f" Unescape = Unescape + Chr(+H0C) - Case "r" + case "r" Unescape = Unescape + Chr(+H0D) - Case "\\" + case "\\" Unescape = Unescape + "\\" - Case Else + default: Unescape = Unescape + "\\" + ch - End Select + } } else { Unescape = Unescape + ch } - Case Else + default: Unescape = Unescape + ch - End Select + } i = i + 1 Loop } @@ -385,8 +371,8 @@ function Unescape(text) { function SplitLines(text, eol) { var re, matches re = New RegExp - re.Global = False - re.IgnoreCase = False + re.Global = false; + re.IgnoreCase = false; re.Pattern = "\r\n|\n|\r" matches = re.Execute(text) if (matches.Count > 0) { From 199c21a52b5f5f6e99520208fff3507c511958a7 Mon Sep 17 00:00:00 2001 From: Takashi Sawanaka Date: Mon, 29 Jan 2024 09:13:17 +0900 Subject: [PATCH 16/58] WIP --- Plugins/dlls/editor addin.sct | 55 +++++++++++++---------------------- 1 file changed, 21 insertions(+), 34 deletions(-) diff --git a/Plugins/dlls/editor addin.sct b/Plugins/dlls/editor addin.sct index fe01f591398..77894a07b54 100644 --- a/Plugins/dlls/editor addin.sct +++ b/Plugins/dlls/editor addin.sct @@ -241,10 +241,10 @@ function ParseRanges(rangeText) { function ParseSelectColumnsLinesArguments(args) { var rangesOrRegExps = new Array(); - var re; var argAry = ParseArguments(args); var invert = false; var flags = ""; + var isRegExp = false; for (var i = 0; i < argAry.length; i++) { var isOption = false; if (argAry[i].length >= 2) { @@ -252,12 +252,8 @@ function ParseSelectColumnsLinesArguments(args) { case "-", "/": switch (argAry[i].charAt[1]) { case "e", "i", "g": + isRegExp = true; isOption = true; - if (!re) { - re = new RegExp(); - rangesOrRegExps.push(re) - } - flags = ""; if (argAry[i].indexOf("g") >= 0) { flags += "g"; } @@ -274,40 +270,33 @@ function ParseSelectColumnsLinesArguments(args) { break; } if (!isOption) { - if (!re) { - pattern = argAry(i) - re = null; + if (isRegExp) { + rangesOrRegExps.push(new RegExp(argAry(i), flags)); + isRegExp = false; } else { rangesOrRegExps.push(ParseRanges(argAry[i])) - if (rangesOrRegExps(j) == 0) { - rangesOrRegExps[rangesOrRegExps.length - 1] = new RegExp(argAry[i]); - } } } } return { "rangesOrRegExps": rangesOrRegExps, "invert": invert }; } -function ParseReplaceArguments(args, regex, ignoreCase) { - var patterns() - var argAry - var i, j - var re - var isOption - re = Nothing - argAry = ParseArguments(args) - regex = false; - ignoreCase = false; - For i = 0 To SafeUBound(argAry) +function ParseReplaceArguments(args) { + var patterns = new Array(); + var isOption = false; + var argAry = ParseArguments(args) + var regex = false; + var ignoreCase = false; + for (var i = 0; i < argAry.length; i++) { isOption = false; - if (Len(argAry(i)) >= 2) { - Select case Left(argAry(i), 1) - case "-", "/" - Select case Mid(argAry(i), 2, 1) - case "e", "i" + if (argAry[i].length >= 2) { + switch (argAry[i].charAt(0)) { + case "-", "/": + switch (argAry[i].charAt(1)) { + case "e", "i": isOption = true; regex = true; - if (InStr(argAry(i), "i") > 0) { + if (argAry[i].indexOf("i") >= 0) { ignoreCase = true; } break; @@ -315,13 +304,11 @@ function ParseReplaceArguments(args, regex, ignoreCase) { break; } } - if (Not isOption) { - Redim Preserve patterns(j) - patterns(j) = argAry(i) - j = j + 1 + if (!isOption) { + patterns.push(argAry[i]); } } - ParseReplaceArguments = patterns + return { "patterns": pattern, "regex": regex, "ignoreCase": ignoreCase }; } function Unescape(text) { From 023da4d5a5009f906d400f544449957f66873db1 Mon Sep 17 00:00:00 2001 From: Takashi Sawanaka Date: Tue, 30 Jan 2024 21:51:37 +0900 Subject: [PATCH 17/58] WIP --- ALL.vs2017.sln | 2 +- ALL.vs2019.sln | 2 +- ALL.vs2022.sln | 2 +- Plugins/dlls/editor addin.sct | 264 +++++++++++++--------------- Testing/PluginTests/PluginTests.js | 245 ++++++++++++++++++++++++++ Testing/PluginTests/PluginTests.vbs | 250 -------------------------- 6 files changed, 371 insertions(+), 394 deletions(-) create mode 100644 Testing/PluginTests/PluginTests.js delete mode 100644 Testing/PluginTests/PluginTests.vbs diff --git a/ALL.vs2017.sln b/ALL.vs2017.sln index 51f20bc5e6e..bd923095016 100644 --- a/ALL.vs2017.sln +++ b/ALL.vs2017.sln @@ -353,7 +353,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "q", "q", "{E4EF583F-653D-44 EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "PluginTests", "PluginTests", "{9738877F-0B01-4C37-855E-7465C5AB7B56}" ProjectSection(SolutionItems) = preProject - Testing\PluginTests\PluginTests.vbs = Testing\PluginTests\PluginTests.vbs + Testing\PluginTests\PluginTests.js = Testing\PluginTests\PluginTests.js EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "yq", "yq", "{9914C8A9-0DEA-4922-9065-57034EE5263D}" diff --git a/ALL.vs2019.sln b/ALL.vs2019.sln index a65ebf04f74..6aa82fd7133 100644 --- a/ALL.vs2019.sln +++ b/ALL.vs2019.sln @@ -353,7 +353,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "q", "q", "{E4EF583F-653D-44 EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "PluginTests", "PluginTests", "{9738877F-0B01-4C37-855E-7465C5AB7B56}" ProjectSection(SolutionItems) = preProject - Testing\PluginTests\PluginTests.vbs = Testing\PluginTests\PluginTests.vbs + Testing\PluginTests\PluginTests.js = Testing\PluginTests\PluginTests.js EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "yq", "yq", "{9914C8A9-0DEA-4922-9065-57034EE5263D}" diff --git a/ALL.vs2022.sln b/ALL.vs2022.sln index 001a1b9ab81..ef5dacbcc22 100644 --- a/ALL.vs2022.sln +++ b/ALL.vs2022.sln @@ -353,7 +353,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "q", "q", "{E4EF583F-653D-44 EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "PluginTests", "PluginTests", "{9738877F-0B01-4C37-855E-7465C5AB7B56}" ProjectSection(SolutionItems) = preProject - Testing\PluginTests\PluginTests.vbs = Testing\PluginTests\PluginTests.vbs + Testing\PluginTests\PluginTests.js = Testing\PluginTests\PluginTests.js EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "yq", "yq", "{9914C8A9-0DEA-4922-9065-57034EE5263D}" diff --git a/Plugins/dlls/editor addin.sct b/Plugins/dlls/editor addin.sct index 77894a07b54..cf3c09697cb 100644 --- a/Plugins/dlls/editor addin.sct +++ b/Plugins/dlls/editor addin.sct @@ -42,7 +42,7 @@ var REGKEY_PATH = "Plugins\\editor addin.sct/"; var wsh = new ActiveXObject("WScript.Shell") -var arguments = ""; +var pluginArguments = ""; var variables = new Array(); var mergeApp; @@ -121,11 +121,11 @@ function get_PluginExtendedProperties() { } function get_PluginArguments() { - return arguments; + return pluginArguments; } function put_PluginArguments(NewValue) { - arguments = NewValue; + pluginArguments = NewValue; } function get_PluginVariables() { @@ -173,7 +173,7 @@ function ReplaceVariables(str) { } function IsFirstArgumentEmpty() { - return (arguments.match(/^\s*$/) !== null); + return (pluginArguments.match(/^\s*$/) !== null); } function ParseArguments(args) { @@ -187,7 +187,7 @@ function ParseArguments(args) { if (ch === " " || ch === "\t") { if (token.length > 0) { ary.push(token); - token = "" + token = ""; } } else if (ch === "\"") { inQuotes = true; @@ -207,9 +207,9 @@ function ParseArguments(args) { } } } - if (Len(token) > 0) { + if (token.length > 0) { ary.push(token); - token = "" + token = ""; } return ary; } @@ -219,23 +219,23 @@ function ParseRanges(rangeText) { var ary = rangeText.split(","); for (var i = 0, j = 0; i < ary.length; i++) { var ary2 = ary[i].split("-"); - var rangeFrom = "" + var rangeFrom = ""; if (ary2.length > 0) { rangeFrom = ary2[0].replace(/^\s+|\s+$/g, ""); } var rangeTo = rangeFrom; - if (ary2 > 1) { + if (ary2.length > 1) { rangeTo = ary2[1].replace(/^\s+|\s+$/g, ""); } - if (!isNan(rangeFrom) || !isNan(rangeTo)) { - if (isNan(rangeFrom)) { rangeFrom = 1; } - if (isNan(rangeTo)) { rangeTo = 1000000000; } + if ((rangeFrom !== "" && !isNaN(rangeFrom)) || (rangeTo !== "" && !isNaN(rangeTo))) { + if (rangeFrom === "" || isNaN(rangeFrom)) { rangeFrom = 1; } + if (rangeTo === "" || isNaN(rangeTo)) { rangeTo = 1000000000; } if (parseFloat(rangeFrom) < 1 || parseFloat(rangeFrom) > 1000000000) { rangeFrom = 1; } if (parseFloat(rangeTo) < 1 || parseFloat(rangeTo) > 1000000000) { rangeTo = 1; } if (parseFloat(rangeFrom) > parseFloat(rangeTo)) { rangeTo = rangeFrom; } aryRanges.push([parseInt(rangeFrom), parseInt(rangeTo)]); } - } + } return aryRanges; } @@ -266,15 +266,15 @@ function ParseSelectColumnsLinesArguments(args) { invert = true; break; } + break; } - break; } if (!isOption) { if (isRegExp) { - rangesOrRegExps.push(new RegExp(argAry(i), flags)); + rangesOrRegExps.push(new RegExp(argAry[i], flags)); isRegExp = false; } else { - rangesOrRegExps.push(ParseRanges(argAry[i])) + rangesOrRegExps.push(ParseRanges(argAry[i])); } } } @@ -284,7 +284,7 @@ function ParseSelectColumnsLinesArguments(args) { function ParseReplaceArguments(args) { var patterns = new Array(); var isOption = false; - var argAry = ParseArguments(args) + var argAry = ParseArguments(args); var regex = false; var ignoreCase = false; for (var i = 0; i < argAry.length; i++) { @@ -312,60 +312,55 @@ function ParseReplaceArguments(args) { } function Unescape(text) { - var textLen - var i - var ch - - textLen = Len(text) - i = 1 - Do While i <= textLen - ch = Mid(text, i, 1) - Select case ch - case "\\" - if (i <= textLen - 1) { - i = i + 1 - ch = Mid(text, i, 1) - Select case ch - case "a" - Unescape = Unescape + Chr(+H07) - case "b" - Unescape = Unescape + Chr(+H08) - case "t" - Unescape = Unescape + Chr(+H09) - case "n" - Unescape = Unescape + Chr(+H0A) - case "v" - Unescape = Unescape + Chr(+H0B) - case "f" - Unescape = Unescape + Chr(+H0C) - case "r" - Unescape = Unescape + Chr(+H0D) - case "\\" - Unescape = Unescape + "\\" + var result = ""; + var textLen = text.length; + var i = 0; + while (i < textLen) { + var ch = text.charAt(i); + switch (ch) { + case "\\": + if (i < textLen - 1) { + i++; + ch = text.charAt(i); + switch (ch) { + case "a": + result += "\a"; + break; + case "b": + result += "\b"; + break; + case "t": + result += "\t"; + break; + case "n": + result += "\n"; + break; + case "v": + result += "\v"; + break; + case "f": + result += "\f"; + break; + case "r": + result += "\r"; + break; + case "\\": + result += "\\"; + break; default: - Unescape = Unescape + "\\" + ch + result += "\\" + ch; + break; } } else { - Unescape = Unescape + ch + result += ch; } + break; default: - Unescape = Unescape + ch + result += ch; + break; } - i = i + 1 - Loop -} - -function SplitLines(text, eol) { - var re, matches - re = New RegExp - re.Global = false; - re.IgnoreCase = false; - re.Pattern = "\r\n|\n|\r" - matches = re.Execute(text) - if (matches.Count > 0) { - eol = matches(0).Value + i++; } - SplitLines = Split(text, eol) } function PluginOnEvent(eventType, obj) { @@ -384,23 +379,23 @@ function MakeLower(Text) { function ExecFilterCommand(Text) { var cmd; if (IsFirstArgumentEmpty()) { - cmd = regRead(REGKEY_PATH + "ExecFilterCommand", "") - cmd = mergeApp.InputBox("Enter filter command", "ExecFilterCommand", cmd) + cmd = regRead(REGKEY_PATH + "ExecFilterCommand", ""); + cmd = mergeApp.InputBox("Enter filter command", "ExecFilterCommand", cmd); if (cmd !== "") { regWrite(REGKEY_PATH + "ExecFilterCommand", cmd, "REG_SZ"); } - cmd = ReplaceVariables(cmd) + cmd = ReplaceVariables(cmd); } else { - cmd = arguments + cmd = pluginArguments; } if (cmd === "") { throw new Error(30001, "Canceled"); } var path = wsh.ExpandEnvironmentStrings("%TEMP%\\_winmerge_addin_temp_.txt"); - var fso = new ActiveXObject("Scripting.FileSystemObject") + var fso = new ActiveXObject("Scripting.FileSystemObject"); try { - var ts = fso.CreateTextFile(path) + var ts = fso.CreateTextFile(path); ts.Write(Text); ts.Close(); } catch (e) { @@ -408,9 +403,9 @@ function ExecFilterCommand(Text) { } var result = ""; try { - var exe = wsh.Exec("cmd /c type \"" + path + "\" | " + cmd + " 2>&1") + var exe = wsh.Exec("cmd /c type \"" + path + "\" | " + cmd + " 2>&1"); while (!exe.StdOut.AtEndOfStream) { - result += exe.StdOut.ReadLine + "\r\n"; + result += exe.StdOut.ReadLine() + "\r\n"; } } catch (e) { throw new Error(30001, "Failed to execute the command '" + cmd + "':" + e.message); @@ -421,12 +416,7 @@ function ExecFilterCommand(Text) { } function SelectColumns(Text) { - var args, ranges, regexpStr - var matches, m - var lines, eol, line - var i, j, k - var rangesOrRegExps - var invert + var args; if (IsFirstArgumentEmpty()) { args = regRead(REGKEY_PATH + "SelectColumns", ""); args = mergeApp.InputBox("Enter the list of column ranges to select (e.g. -3,5-10,30-)\r\nor regular expression:", "SelectColumns", args); @@ -434,98 +424,92 @@ function SelectColumns(Text) { regWrite(REGKEY_PATH + "SelectColumns", args, "REG_SZ"); } } else { - args = arguments; + args = pluginArguments; } if (args === "") { throw new Error(30001, "Canceled"); } - lines = SplitLines(Text, eol) - rangesOrRegExps = ParseSelectColumnsLinesArguments(args, invert) - For i = 0 To SafeUBound(lines) - line = "" - For j = 0 To SafeUBound(rangesOrRegExps) - if (IsArray(rangesOrRegExps(j))) { - For k = 0 To SafeUBound(rangesOrRegExps(j)) - if (rangesOrRegExps(j)(k)(0) <= Len(lines(i))) { - line = line + Mid(lines(i), rangesOrRegExps(j)(k)(0), rangesOrRegExps(j)(k)(1) - rangesOrRegExps(j)(k)(0) + 1) + var eol = Text.match(/\r\n|\n|\r/); + var lines = Text.split(eol); + var parseResult = ParseSelectColumnsLinesArguments(args); + var rangesOrRegExps = parseResult.rangesOrRegExps; + var invert = parseResult.invert; + for (var i = 0; i < lines.length; i++) { + var line = ""; + for (var j = 0; j < rangesOrRegExps.length; j++) { + if (rangesOrRegExps[j] instanceof Array) { + for (var k = 0; k < rangesOrRegExps[j].length; k++) { + if (rangesOrRegExps[j][k][0] - 1 < lines[i].length) { + line += lines[i].substring(rangesOrRegExps[j][k][0] - 1, rangesOrRegExps[j][k][1]); } } } else { - if (Not invert) { - matches = rangesOrRegExps(j).Execute(lines(i)) - For Each m In matches - line = line + m.Value + if (!invert) { + var matches = lines[i].match(rangesOrRegExps[j]); + for (var k = 0; k < matches.length; k++) { + line += matches[k]; } } else { - line = line + rangesOrRegExps(j).Replace(lines(i), "") + line += replacei(rangesOrRegExps[j], lines[i], "", false); } } } - lines(i) = line + lines[i] = line; } - SelectColumns = Join(lines, eol) + return lines.join(eol); } function SelectLines(Text) { - var args, ranges - var matches, rangesOrRegExps - var lines, newlines(), eol - var i, j, k, l - var max - var matched - var invert + var args; + var newlines = new Array(); if (IsFirstArgumentEmpty()) { - args = regRead(REGKEY_PATH + "SelectLines", "") - args = mergeApp.InputBox("Enter the list of line ranges to select (e.g. -3,5-10,30-)\r\nor regular expression:", "SelectLines", args) + args = regRead(REGKEY_PATH + "SelectLines", ""); + args = mergeApp.InputBox("Enter the list of line ranges to select (e.g. -3,5-10,30-)\r\nor regular expression:", "SelectLines", args); if (args !== "") { regWrite(REGKEY_PATH + "SelectLines", args, "REG_SZ"); } } else { - args = arguments + args = pluginArguments; } if (args === "") { throw new Error(30001, "Canceled"); } - lines = SplitLines(Text, eol) - l = 0 - rangesOrRegExps = ParseSelectColumnsLinesArguments(args, invert) - For i = 0 To SafeUBound(rangesOrRegExps) - if (IsArray(rangesOrRegExps(i))) { - For j = 0 To SafeUBound(rangesOrRegExps(i)) - max =rangesOrRegExps(i)(j)(1) - 1 - if (max > SafeUBound(lines)) { max = SafeUBound(lines) - For k = rangesOrRegExps(i)(j)(0) - 1 To max - if (k <= SafeUBound(lines)) { - ReDim Preserve newlines(l) - newlines(l) = lines(k) - l = l + 1 + var eol = Text.match(/\r\n|\n|\r/); + var lines = Text.split(eol); + var parseResult = ParseSelectColumnsLinesArguments(args); + var invert = parseResult.invert; + var rangesOrRegExps = parseResult.rangesOrRegExps; + for (var i = 0; i < rangesOrRegExps.length; i++) { + if (rangesOrRegExps[i] instanceof Array) { + for (var j = 0; j < rangesOrRegExps[i].length; j++) { + var max = rangesOrRegExps[i][j][1]; + if (max > lines.length) { max = lines.length; } + for (var k = rangesOrRegExps[i][j][0] - 1; k < max; k++) { + if (k < lines.length) { + newlines.push(lines[k]); } } } } else { - For j = 0 To SafeUBound(lines) - matched = rangesOrRegExps(i).Test(lines(j)) - if (invert) { matched = Not matched + for (var j = 0; j < lines.length; j++) { + var matched = (rangesOrRegExps[i].match(lines[j]) !== null); + if (invert) { matched = !matched; } if (matched) { - ReDim Preserve newlines(l) - newlines(l) = lines(j) - l = l + 1 + newlines.push(lines[j]); } } } } - if (SafeUBound(lines) >= 0) { - if (lines(UBound(lines)) = "") { - if (SafeUBound(newlines) >= 0) { - if (newlines(UBound(newlines)) !== "") { - ReDim Preserve newlines(l) - newlines(l) = "" - l = l + 1 + if (lines.length > 0) { + if (lines[lines.length - 1] === "") { + if (newlines.length > 0) { + if (newlines[newlines.length - 1] !== "") { + newlines[l].push(""); } } } } - SelectLines = Join(newlines, eol) + return newlines.join(eol); } function replacei(text, find, replace, ignorecase) { @@ -545,13 +529,13 @@ function ReplaceText(Text) { var args; var result = Text; if (IsFirstArgumentEmpty()) { - args = regRead(REGKEY_PATH + "Replace", "") - args = mergeApp.InputBox("Enter the search text and replacement text:", "Replace", args) + args = regRead(REGKEY_PATH + "Replace", ""); + args = mergeApp.InputBox("Enter the search text and replacement text:", "Replace", args); if (args !== "") { regWrite(REGKEY_PATH + "Replace", args, "REG_SZ"); } } else { - args = arguments + args = pluginArguments; } if (args === "") { throw new Error(30001, "Canceled"); @@ -591,7 +575,7 @@ function Tokenize(Text) { regWrite(REGKEY_PATH + "Tokenize", pattern, "REG_SZ"); } } else { - pattern = arguments; + pattern = pluginArguments; } if (args === "") { throw new Error(30001, "Canceled"); @@ -615,8 +599,7 @@ function RemoveDuplicates(Text) { var line = lines[i]; if (typeof dic[line] === 'undefined') { dic[line] = 1; - newlines[j] = line; - j++; + newlines.push(line); } } if (lasteol) @@ -638,8 +621,7 @@ function CountDuplicates(Text) { var line = lines[i]; if (typeof dic[line] === 'undefined') { dic[line] = 1; - newlines[j] = line; - j++; + newlines.push(line); } else { dic[line]++; } @@ -685,7 +667,7 @@ function ReverseLines(Text) { var m = parseInt(lines.length / 2); for (var i = 0; i < m; i++) { var line = lines[i]; - lines[i] = lines[lines.length - i - 1] + lines[i] = lines[lines.length - i - 1]; lines[lines.length - i - 1] = line; } if (lasteol) diff --git a/Testing/PluginTests/PluginTests.js b/Testing/PluginTests/PluginTests.js new file mode 100644 index 00000000000..511a2acfcc3 --- /dev/null +++ b/Testing/PluginTests/PluginTests.js @@ -0,0 +1,245 @@ +var g_cnt; +var g_testname; + +var FileSys = new ActiveXObject("Scripting.FileSystemObject"); +var ScriptFolder = FileSys.GetParentFolderName(WScript.ScriptFullName); + +function setTestName(testname) { + g_cnt = 0; + g_testname = testname; +} + +function getCurrentTestName() { + return g_testname + g_cnt; +} + +function assertTrue(value) { + g_cnt++; + if (!value) { + throw new Error(30001, getCurrentTestName()); + } +} + +function assertEquals(expected, actual) { + WScript.Echo(": " + g_testname); + g_cnt++; + if (expected !== actual) { + throw new Error(30001, getCurrentTestName() + "\r\nexpected: \"" + expected + "\"\r\nactual: \"" + actual + "\""); + } +} + +function CompareMSExcelFilesTest() { + var p = GetObject("script: " + ScriptFolder + "\\..\\..\\Plugins\\dlls\\CompareMSExcelFiles.sct"); + WScript.Echo("PluginDescription: " + p.PluginDescription); + WScript.Echo("PluginEvent : " + p.PluginEvent); + WScript.Echo("PluginFileFilters: " + p.PluginFileFilters); + WScript.Echo("PluginIsAutomatic: " + p.PluginIsAutomatic); + try { + WScript.Echo("PluginUnpackedFileExtension: " + p.PluginUnpackedFileExtension); + } catch (e) { + } + + var changed = false; + var subcode = 0; + p.UnpackFile(ScriptFolder + "\\..\\Data\\Office\\excel.xls", ScriptFolder + "\\result.txt", changed, subcode); +} + +function EditorAddinTest() { + var asciiChars = ""; + var p = GetObject("script: " + ScriptFolder + "\\..\\..\\Plugins\\dlls\\editor addin.sct"); + + for (var i = 0; i < 128; i++) { + asciiChars += String.fromCharCode(i); + } + + // MakeUpper + setTestName("MakeUpper"); + assertEquals("", p.MakeUpper("")); + assertEquals(" ~0129ABCZABCZ", p.MakeUpper(" ~0129abczABCZ")); + var expected = asciiChars.replace("abcdefghijklmnopqrstuvwxyz", "ABCDEFGHIJKLMNOPQRSTUVWXYZ"); + assertEquals(expected, p.MakeUpper(asciiChars)); + + // MakeLower + setTestName("MakeLower"); + assertEquals("", p.MakeLower("")); + assertEquals(" ~0129abczabcz", p.MakeLower(" ~0129abczABCZ")); + expected = asciiChars.replace("ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz"); + assertEquals(expected, p.MakeLower(asciiChars)); + + // ExecFilterCommand + setTestName("ExecFilterCommand"); + p.PluginArguments = "sort"; + assertEquals("1\r\n2\r\n", p.ExecFilterCommand("2\r\n1\r\n")); + p.PluginArguments = "echo a"; + assertEquals("a \r\n", p.ExecFilterCommand("")); + + // SelectColumns + setTestName("SelectColumns"); + p.PluginArguments = "1"; + assertEquals("a", p.SelectColumns("abc")); + assertEquals("a\r\nd", p.SelectColumns("abc\r\ndef")); + assertEquals("a\r\nd\r\n", p.SelectColumns("abc\r\ndef\r\n")); + p.PluginArguments = "3"; + assertEquals("c\r\nf", p.SelectColumns("abc\r\ndef")); + p.PluginArguments = "1,3"; + assertEquals("ac\r\nd", p.SelectColumns("abc\r\nde")); + p.PluginArguments = "1-3"; + assertEquals("abc\r\ndef", p.SelectColumns("abc\r\ndef")); + p.PluginArguments = "-3"; + assertEquals("abc\r\ndef", p.SelectColumns("abc\r\ndef")); + p.PluginArguments = "1-"; + assertEquals("abc\r\ndef", p.SelectColumns("abc\r\ndef")); + p.PluginArguments = "2-"; + assertEquals("bc\r\nef", p.SelectColumns("abc\r\ndef")); + p.PluginArguments = "3-"; + assertEquals("c\r\nf", p.SelectColumns("abc\r\ndef")); + p.PluginArguments = "4-"; + assertEquals("\r\n", p.SelectColumns("abc\r\ndef")); + + p.PluginArguments = "-e ab"; + assertEquals("", p.SelectColumns("")); + assertEquals("ab\r\n", p.SelectColumns("abc\r\ndef")); + p.PluginArguments = "-e \"ab|de\""; + assertEquals("ab\r\nde", p.SelectColumns("abc\r\ndef")); + p.PluginArguments = "-e ^."; + assertEquals("a\r\nd", p.SelectColumns("abc\r\ndef")); + p.PluginArguments = "-e .*"; + assertEquals("abc\r\ndef", p.SelectColumns("abc\r\ndef")); + p.PluginArguments = "-e -i \"Ab|dE\""; + assertEquals("ab\r\nde", p.SelectColumns("abc\r\ndef")); + p.PluginArguments = "-e -i -g ab"; + assertEquals("abAB\r\n", p.SelectColumns("abcABC\r\ndef")); + p.PluginArguments = "-v -e \"ab|de\""; + assertEquals("c\r\nf", p.SelectColumns("abc\r\ndef")); + + p.PluginArguments = "1-3 -e ab 2-3"; + assertEquals("abcabbc\r\ndefef", p.SelectColumns("abc\r\ndef")); + + // SelectLines + setTestName("SelectLines"); + p.PluginArguments = "1"; + assertEquals("", p.SelectLines("")); + assertEquals("aaa", p.SelectLines("aaa")); + p.PluginArguments = "2"; + assertEquals("bbb", p.SelectLines("aaa\r\nbbb")); + p.PluginArguments = "1,2"; + assertEquals("aaa\r\nbbb", p.SelectLines("aaa\r\nbbb")); + p.PluginArguments = "1-2"; + assertEquals("aaa\r\nbbb", p.SelectLines("aaa\r\nbbb")); + assertEquals("aaa\r\nbbb\r\n", p.SelectLines("aaa\r\nbbb\r\n")); + p.PluginArguments = "1-"; + assertEquals("aaa\r\nbbb", p.SelectLines("aaa\r\nbbb")); + assertEquals("aaa\r\nbbb\r\n", p.SelectLines("aaa\r\nbbb\r\n")); + assertEquals("aaa\r\n" + vbCrLf + vbCrLf, p.SelectLines("aaa\r\n" + vbCrLf + vbCrLf)); + p.PluginArguments = "-2"; + assertEquals("aaa\r\nbbb", p.SelectLines("aaa\r\nbbb")); + assertEquals("aaa\r\nbbb\r\n", p.SelectLines("aaa\r\nbbb\r\n")); + p.PluginArguments = "4-5"; + assertEquals("", p.SelectLines("aaa\r\nbbb")); + assertEquals("", p.SelectLines("aaa\r\nbbb\r\n")); + + p.PluginArguments = "-e aa"; + assertEquals("", p.SelectLines("")); + assertEquals("aaa", p.SelectLines("aaa\r\nbbb")); + assertEquals("aaa\r\n", p.SelectLines("aaa\r\nbbb\r\n")); + p.PluginArguments = "-e -i AA"; + assertEquals("aaa", p.SelectLines("aaa\r\nbbb")); + assertEquals("aaa\r\n", p.SelectLines("aaa\r\nbbb\r\n")); + p.PluginArguments = "-e .*"; + assertEquals("aaa\r\nbbb", p.SelectLines("aaa\r\nbbb")); + assertEquals("aaa\r\nbbb\r\n", p.SelectLines("aaa\r\nbbb\r\n")); + p.PluginArguments = "^a"; + assertEquals("aaa", p.SelectLines("aaa\r\nbbb")); + assertEquals("aaa\r\n", p.SelectLines("aaa\r\nbbb\r\n")); + p.PluginArguments = "a$"; + assertEquals("aaa", p.SelectLines("aaa\r\nbbb")); + assertEquals("aaa\r\n", p.SelectLines("aaa\r\nbbb\r\n")); + p.PluginArguments = "-v a$"; + assertEquals("bbb", p.SelectLines("aaa\r\nbbb")); + assertEquals("bbb\r\n", p.SelectLines("aaa\r\nbbb\r\n")); + + p.PluginArguments = "1 -e c$"; + assertEquals("aaa\r\nccc", p.SelectLines("aaa\r\nbbb\r\nccc")); + + // Replace + setTestName("Replace"); + p.PluginArguments = "abc def"; + assertEquals("", p.Replace("")); + assertEquals("def def def def", p.Replace("abc def abc def")); + p.PluginArguments = "-e a.c XXX"; + assertEquals("", p.Replace("")); + assertEquals("XXX def XXX def", p.Replace("abc def abc def")); + p.PluginArguments = "-e -i A.C XXX"; + assertEquals("XXX def XXX def", p.Replace("abc def abc def")); + p.PluginArguments = "-e ^\\d+ XXX"; + assertEquals("XXX abc\r\nXXX def", p.Replace("1000 abc\r\n1001 def")); + p.PluginArguments = "-e (.{3}) $1\\r\\n"; + assertEquals("012\r\n345\r\n678\r\n9", p.Replace("0123456789")); + p.PluginArguments = "-e (\\d+) \\a\\b\\t\\n\\v\\f\\r\\\\$1\\1\\0"; + assertEquals(String.fromCharCode(0x07) + String.fromCharCode(0x08) + String.fromCharCode(0x09) + String.fromCharCode(0x0A) + String.fromCharCode(0x0B) + String.fromCharCode(0x0C) + String.fromCharCode(0x0D) + "\\0123456789\\1\\0", p.Replace("0123456789")); + + // ReverseColumns + setTestName("ReverseColumns"); + assertEquals("", p.ReverseColumns("")); + assertEquals("a", p.ReverseColumns("a")); + assertEquals("a\r\nb", p.ReverseColumns("a\r\nb")); + assertEquals("ba", p.ReverseColumns("ab")); + assertEquals("ba\r\ndc", p.ReverseColumns("ab\r\ncd")); + assertEquals("cba", p.ReverseColumns("abc")); + assertEquals("cba\r\nfed", p.ReverseColumns("abc\r\ndef")); + assertEquals("dcba", p.ReverseColumns("abcd")); + assertEquals("dcba\r\nhgfe", p.ReverseColumns("abcd\r\nefgh")); + + // ReverseLines + setTestName("ReverseLines"); + assertEquals("", p.ReverseLines("")); + assertEquals("a", p.ReverseLines("a")); + assertEquals("a\r\n", p.ReverseLines("a\r\n")); + assertEquals("b\r\na", p.ReverseLines("a\r\nb")); + assertEquals("b\r\na\r\n", p.ReverseLines("a\r\nb\r\n")); + assertEquals("c\r\nb\r\na", p.ReverseLines("a\r\nb\r\nc")); + assertEquals("c\r\nb\r\na\r\n", p.ReverseLines("a\r\nb\r\nc\r\n")); + assertEquals("d\r\nc\r\nb\r\na", p.ReverseLines("a\r\nb\r\nc\r\nd")); + + // Tokenize + setTestName("Tokenize"); + p.PluginArguments = "[^\\w]+"; + assertEquals("", p.Tokenize("")); + assertEquals("aaa", p.Tokenize("aaa")); + assertEquals("aaa\r\nabcd", p.Tokenize("aaa abcd")); + + // RemoveDuplicates + setTestName("RemoveDuplicates"); + assertEquals("", p.RemoveDuplicates("")); + assertEquals("aaa", p.RemoveDuplicates("aaa")); + assertEquals("aaa", p.RemoveDuplicates("aaa\r\naaa")); + assertEquals("aaa\r\n", p.RemoveDuplicates("aaa\r\naaa\r\n")); + assertEquals("aaa\r\nbbb", p.RemoveDuplicates("aaa\r\nbbb")); + assertEquals("aaa\r\nbbb\r\n", p.RemoveDuplicates("aaa\r\nbbb\r\n")); + + // CountDuplicates + setTestName("CountDuplicates"); + assertEquals("", p.CountDuplicates("")); + assertEquals("aaa\t1", p.CountDuplicates("aaa")); + assertEquals("aaa\t2\r\n", p.CountDuplicates("aaa\r\naaa")); + assertEquals("aaa\t2\r\n", p.CountDuplicates("aaa\r\naaa\r\n")); + assertEquals("aaa\t1\r\nbbb\t1\r\n", p.CountDuplicates("aaa\r\nbbb")); + assertEquals("aaa\t1\r\nbbb\t1\r\n", p.CountDuplicates("aaa\r\nbbb\r\n")); + + // Trim + setTestName("Trim"); + assertEquals("", p.Trim("")); + assertEquals("", p.Trim(" ")); + assertEquals("aaa", p.Trim("aaa")); + assertEquals("aaa", p.Trim(" aaa")); + assertEquals("aaa", p.Trim("aaa ")); + assertEquals("aaa", p.Trim(" aaa ")); + assertEquals("aaa", p.Trim("\t aaa \t")); + assertEquals("aaa\r\nbbb", p.Trim(" aaa \r\n bbb ")); + assertEquals("aaa\r\nbbb\r\n", p.Trim(" aaa \r\n bbb \r\n")); + +} + +EditorAddinTest(); +//CompareMSExcelFilesTest + diff --git a/Testing/PluginTests/PluginTests.vbs b/Testing/PluginTests/PluginTests.vbs deleted file mode 100644 index d63e1877ca2..00000000000 --- a/Testing/PluginTests/PluginTests.vbs +++ /dev/null @@ -1,250 +0,0 @@ -Option Explicit - -Dim FileSys -Dim ScriptFolder -Dim g_cnt -Dim g_testname - -Set FileSys = CreateObject("Scripting.FileSystemObject") -ScriptFolder = FileSys.getParentFolderName(WScript.ScriptFullName) - -Sub SetTestName(testname) - g_cnt = 0 - g_testname = testname -End Sub - -Function GetCurrentTestName() - GetCurrentTestName = g_testname & g_cnt -End Function - -Sub AssertTrue(value) - g_cnt = g_cnt + 1 - If Not value Then - Err.Raise 30001, , GetCurrentTestName() - End If -End Sub - -Sub AssertEquals(expected, actual) - g_cnt = g_cnt + 1 - If expected <> actual Then - Err.Raise 30001, , GetCurrentTestName() & vbCrLf & "expected: """ & expected & """" & vbCrLf & "actual: """ & actual & """" - End If -End Sub - -Sub CompareMSExcelFilesTest - Dim p, changed, subcode - Set p = GetObject("script: " & ScriptFolder & "\..\..\Plugins\dlls\CompareMSExcelFiles.sct") - WScript.Echo "PluginDescription: " & p.PluginDescription - WScript.Echo "PluginEvent : " & p.PluginEvent - WScript.Echo "PluginFileFilters: " & p.PluginFileFilters - WScript.Echo "PluginIsAutomatic: " & p.PluginIsAutomatic - On Error Resume Next - WScript.Echo "PluginUnpackedFileExtension: " & p.PluginUnpackedFileExtension - On Error GoTo 0 - - changed = false - subcode = 0 - p.UnpackFile ScriptFolder & "\..\Data\Office\excel.xls", ScriptFolder & "\result.txt", changed, subcode - -End Sub - -Sub EditorAddinTest - Dim p - Dim i - Dim asciiChars - Dim chars - Set p = GetObject("script: " & ScriptFolder & "\..\..\Plugins\dlls\editor addin.sct") - - For i = 0 To 127 - asciiChars = asciiChars & Chr(i) - Next - - ' MakeUpper - SetTestName "MakeUpper" - AssertEquals "", p.MakeUpper("") - AssertEquals " ~0129ABCZABCZ", p.MakeUpper(" ~0129abczABCZ") - AssertEquals Replace(asciiChars, "abcdefghijklmnopqrstuvwxyz", "ABCDEFGHIJKLMNOPQRSTUVWXYZ"), p.MakeUpper(asciiChars) - - ' MakeLower - SetTestName "MakeLower" - AssertEquals "", p.MakeLower("") - AssertEquals " ~0129abczabcz", p.MakeLower(" ~0129abczABCZ") - AssertEquals Replace(asciiChars, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz"), p.MakeLower(asciiChars) - - ' ExecFilterCommand - SetTestName "ExecFilterCommand" - p.PluginArguments = "sort" - AssertEquals "1" & vbCrLf & "2" & vbCrLf, p.ExecFilterCommand("2" & vbCrLf & "1" & vbCrLf) - p.PluginArguments = "echo a" - AssertEquals "a " & vbCrLf, p.ExecFilterCommand("") - - ' SelectColumns - SetTestName "SelectColumns" - p.PluginArguments = "1" - AssertEquals "a", p.SelectColumns("abc") - AssertEquals "a" & vbCrLf & "d", p.SelectColumns("abc" & vbCrLf & "def") - AssertEquals "a" & vbCrLf & "d" & vbCrLf, p.SelectColumns("abc" & vbCrLf & "def" & vbCrLf) - p.PluginArguments = "3" - AssertEquals "c" & vbCrLf & "f", p.SelectColumns("abc" & vbCrLf & "def") - p.PluginArguments = "1,3" - AssertEquals "ac" & vbCrLf & "d", p.SelectColumns("abc" & vbCrLf & "de") - p.PluginArguments = "1-3" - AssertEquals "abc" & vbCrLf & "def", p.SelectColumns("abc" & vbCrLf & "def") - p.PluginArguments = "-3" - AssertEquals "abc" & vbCrLf & "def", p.SelectColumns("abc" & vbCrLf & "def") - p.PluginArguments = "1-" - AssertEquals "abc" & vbCrLf & "def", p.SelectColumns("abc" & vbCrLf & "def") - p.PluginArguments = "2-" - AssertEquals "bc" & vbCrLf & "ef", p.SelectColumns("abc" & vbCrLf & "def") - p.PluginArguments = "3-" - AssertEquals "c" & vbCrLf & "f", p.SelectColumns("abc" & vbCrLf & "def") - p.PluginArguments = "4-" - AssertEquals "" & vbCrLf & "", p.SelectColumns("abc" & vbCrLf & "def") - - p.PluginArguments = "-e ab" - AssertEquals "", p.SelectColumns("") - AssertEquals "ab" & vbCrLf & "", p.SelectColumns("abc" & vbCrLf & "def") - p.PluginArguments = "-e ""ab|de""" - AssertEquals "ab" & vbCrLf & "de", p.SelectColumns("abc" & vbCrLf & "def") - p.PluginArguments = "-e ^." - AssertEquals "a" & vbCrLf & "d", p.SelectColumns("abc" & vbCrLf & "def") - p.PluginArguments = "-e .*" - AssertEquals "abc" & vbCrLf & "def", p.SelectColumns("abc" & vbCrLf & "def") - p.PluginArguments = "-e -i ""Ab|dE""" - AssertEquals "ab" & vbCrLf & "de", p.SelectColumns("abc" & vbCrLf & "def") - p.PluginArguments = "-e -i -g ab" - AssertEquals "abAB" & vbCrLf & "", p.SelectColumns("abcABC" & vbCrLf & "def") - p.PluginArguments = "-v -e ""ab|de""" - AssertEquals "c" & vbCrLf & "f", p.SelectColumns("abc" & vbCrLf & "def") - - p.PluginArguments = "1-3 -e ab 2-3" - AssertEquals "abcabbc" & vbCrLf & "defef", p.SelectColumns("abc" & vbCrLf & "def") - - ' SelectLines - SetTestName "SelectLines" - p.PluginArguments = "1" - AssertEquals "", p.SelectLines("") - AssertEquals "aaa", p.SelectLines("aaa") - p.PluginArguments = "2" - AssertEquals "bbb", p.SelectLines("aaa" & vbCrLf & "bbb") - p.PluginArguments = "1,2" - AssertEquals "aaa" & vbCrLf & "bbb", p.SelectLines("aaa" & vbCrLf & "bbb") - p.PluginArguments = "1-2" - AssertEquals "aaa" & vbCrLf & "bbb", p.SelectLines("aaa" & vbCrLf & "bbb") - AssertEquals "aaa" & vbCrLf & "bbb" & vbCrLf, p.SelectLines("aaa" & vbCrLf & "bbb" & vbCrLf) - p.PluginArguments = "1-" - AssertEquals "aaa" & vbCrLf & "bbb", p.SelectLines("aaa" & vbCrLf & "bbb") - AssertEquals "aaa" & vbCrLf & "bbb" & vbCrLf, p.SelectLines("aaa" & vbCrLf & "bbb" & vbCrLf) - AssertEquals "aaa" & vbCrLf & vbCrLf & vbCrLf, p.SelectLines("aaa" & vbCrLf & vbCrLf & vbCrLf) - p.PluginArguments = "-2" - AssertEquals "aaa" & vbCrLf & "bbb", p.SelectLines("aaa" & vbCrLf & "bbb") - AssertEquals "aaa" & vbCrLf & "bbb" & vbCrLf, p.SelectLines("aaa" & vbCrLf & "bbb" & vbCrLf) - p.PluginArguments = "4-5" - AssertEquals "", p.SelectLines("aaa" & vbCrLf & "bbb") - AssertEquals "", p.SelectLines("aaa" & vbCrLf & "bbb" & vbCrLf) - - p.PluginArguments = "-e aa" - AssertEquals "", p.SelectLines("") - AssertEquals "aaa", p.SelectLines("aaa" & vbCrLf & "bbb") - AssertEquals "aaa" & vbCrLf, p.SelectLines("aaa" & vbCrLf & "bbb" & vbCrLf) - p.PluginArguments = "-e -i AA" - AssertEquals "aaa", p.SelectLines("aaa" & vbCrLf & "bbb") - AssertEquals "aaa" & vbCrLf, p.SelectLines("aaa" & vbCrLf & "bbb" & vbCrLf) - p.PluginArguments = "-e .*" - AssertEquals "aaa" & vbCrLf & "bbb", p.SelectLines("aaa" & vbCrLf & "bbb") - AssertEquals "aaa" & vbCrLf & "bbb" & vbCrLf, p.SelectLines("aaa" & vbCrLf & "bbb" & vbCrLf) - p.PluginArguments = "^a" - AssertEquals "aaa", p.SelectLines("aaa" & vbCrLf & "bbb") - AssertEquals "aaa" & vbCrLf, p.SelectLines("aaa" & vbCrLf & "bbb" & vbCrLf) - p.PluginArguments = "a$" - AssertEquals "aaa", p.SelectLines("aaa" & vbCrLf & "bbb") - AssertEquals "aaa" & vbCrLf, p.SelectLines("aaa" & vbCrLf & "bbb" & vbCrLf) - p.PluginArguments = "-v a$" - AssertEquals "bbb", p.SelectLines("aaa" & vbCrLf & "bbb") - AssertEquals "bbb" & vbCrLf, p.SelectLines("aaa" & vbCrLf & "bbb" & vbCrLf) - - p.PluginArguments = "1 -e c$" - AssertEquals "aaa" & vbCrLf & "ccc", p.SelectLines("aaa" & vbCrLf & "bbb" & vbCrLf & "ccc") - - ' Replace - SetTestName "Replace" - p.PluginArguments = "abc def" - AssertEquals "", p.Replace("") - AssertEquals "def def def def", p.Replace("abc def abc def") - p.PluginArguments = "-e a.c XXX" - AssertEquals "", p.Replace("") - AssertEquals "XXX def XXX def", p.Replace("abc def abc def") - p.PluginArguments = "-e -i A.C XXX" - AssertEquals "XXX def XXX def", p.Replace("abc def abc def") - p.PluginArguments = "-e ^\d+ XXX" - AssertEquals "XXX abc" & vbCrLf & "XXX def", p.Replace("1000 abc" & vbCrLf & "1001 def") - p.PluginArguments = "-e (.{3}) $1\r\n" - AssertEquals "012" & vbCrLf & "345" & vbCrLf & "678" & vbCrLf & "9", p.Replace("0123456789") - p.PluginArguments = "-e (\d+) \a\b\t\n\v\f\r\\$1\1\0" - AssertEquals Chr(&H07) & Chr(&H08) & Chr(&H09) & Chr(&H0A) & Chr(&H0B) & Chr(&H0C) & Chr(&H0D) & "\0123456789\1\0", p.Replace("0123456789") - - ' ReverseColumns - SetTestName "ReverseColumns" - AssertEquals "", p.ReverseColumns("") - AssertEquals "a", p.ReverseColumns("a") - AssertEquals "a" & vbCrLf & "b", p.ReverseColumns("a" & vbCrLf & "b") - AssertEquals "ba", p.ReverseColumns("ab") - AssertEquals "ba" & vbCrLf & "dc", p.ReverseColumns("ab" & vbCrLf & "cd") - AssertEquals "cba", p.ReverseColumns("abc") - AssertEquals "cba" & vbCrLf & "fed", p.ReverseColumns("abc" & vbCrLf & "def") - AssertEquals "dcba", p.ReverseColumns("abcd") - AssertEquals "dcba" & vbCrLf & "hgfe", p.ReverseColumns("abcd" & vbCrLf & "efgh") - - ' ReverseLines - SetTestName "ReverseLines" - AssertEquals "", p.ReverseLines("") - AssertEquals "a", p.ReverseLines("a") - AssertEquals "a" & vbCrLf, p.ReverseLines("a" & vbCrLf) - AssertEquals "b" & vbCrLf & "a", p.ReverseLines("a" & vbCrLf & "b") - AssertEquals "b" & vbCrLf & "a" & vbCrLf, p.ReverseLines("a" & vbCrLf & "b" & vbCrLf) - AssertEquals "c" & vbCrLf & "b" & vbCrLf & "a", p.ReverseLines("a" & vbCrLf & "b" & vbCrLf & "c") - AssertEquals "c" & vbCrLf & "b" & vbCrLf & "a" & vbCrLf, p.ReverseLines("a" & vbCrLf & "b" & vbCrLf & "c" & vbCrLf) - AssertEquals "d" & vbCrLf & "c" & vbCrLf & "b" & vbCrLf & "a", p.ReverseLines("a" & vbCrLf & "b" & vbCrLf & "c" & vbCrLf & "d") - - ' Tokenize - SetTestName "Tokenize" - p.PluginArguments = "[^\w]+" - AssertEquals "", p.Tokenize("") - AssertEquals "aaa", p.Tokenize("aaa") - AssertEquals "aaa" & vbCrLf & "abcd", p.Tokenize("aaa abcd") - - ' RemoveDuplicates - SetTestName "RemoveDuplicates" - AssertEquals "", p.RemoveDuplicates("") - AssertEquals "aaa", p.RemoveDuplicates("aaa") - AssertEquals "aaa", p.RemoveDuplicates("aaa" & vbCrLf & "aaa") - AssertEquals "aaa" & vbCrLf, p.RemoveDuplicates("aaa" & vbCrLf & "aaa" & vbCrLf) - AssertEquals "aaa" & vbCrLf & "bbb", p.RemoveDuplicates("aaa" & vbCrLf & "bbb") - AssertEquals "aaa" & vbCrLf & "bbb" & vbCrLf, p.RemoveDuplicates("aaa" & vbCrLf & "bbb" & vbCrLf) - - ' CountDuplicates - SetTestName "CountDuplicates" - AssertEquals "", p.CountDuplicates("") - AssertEquals "aaa" & vbTab & "1", p.CountDuplicates("aaa") - AssertEquals "aaa" & vbTab & "2" & vbCrLf, p.CountDuplicates("aaa" & vbCrLf & "aaa") - AssertEquals "aaa" & vbTab & "2" & vbCrLf, p.CountDuplicates("aaa" & vbCrLf & "aaa" & vbCrLf) - AssertEquals "aaa" & vbTab & "1" & vbCrLf & "bbb" & vbTab & "1" & vbCrLf, p.CountDuplicates("aaa" & vbCrLf & "bbb") - AssertEquals "aaa" & vbTab & "1" & vbCrLf & "bbb" & vbTab & "1" & vbCrLf, p.CountDuplicates("aaa" & vbCrLf & "bbb" & vbCrLf) - - ' Trim - SetTestName "Trim" - AssertEquals "", p.Trim("") - AssertEquals "", p.Trim(" ") - AssertEquals "aaa", p.Trim("aaa") - AssertEquals "aaa", p.Trim(" aaa") - AssertEquals "aaa", p.Trim("aaa ") - AssertEquals "aaa", p.Trim(" aaa ") - AssertEquals "aaa", p.Trim(vbTab & " aaa " & vbTab) - AssertEquals "aaa" & vbCrLf & "bbb", p.Trim(" aaa " & vbCrLf & " bbb ") - AssertEquals "aaa" & vbCrLf & "bbb" & vbCrLf, p.Trim(" aaa " & vbCrLf & " bbb " & vbCrLf) - -End Sub - -EditorAddinTest -'CompareMSExcelFilesTest - From 9c04c14481cba1312c7e393ef82a9873b94f38ec Mon Sep 17 00:00:00 2001 From: Takashi Sawanaka Date: Wed, 31 Jan 2024 08:28:20 +0900 Subject: [PATCH 18/58] WIP --- Plugins/dlls/editor addin.sct | 48 +++++++++++++++++------------- Testing/PluginTests/PluginTests.js | 15 ++++++---- 2 files changed, 38 insertions(+), 25 deletions(-) diff --git a/Plugins/dlls/editor addin.sct b/Plugins/dlls/editor addin.sct index cf3c09697cb..0b229c8ece2 100644 --- a/Plugins/dlls/editor addin.sct +++ b/Plugins/dlls/editor addin.sct @@ -248,10 +248,13 @@ function ParseSelectColumnsLinesArguments(args) { for (var i = 0; i < argAry.length; i++) { var isOption = false; if (argAry[i].length >= 2) { - switch (argAry[i].charAt[0]) { - case "-", "/": - switch (argAry[i].charAt[1]) { - case "e", "i", "g": + switch (argAry[i].charAt(0)) { + case "-": + case "/": + switch (argAry[i].charAt(1)) { + case "e": + case "i": + case "g": isRegExp = true; isOption = true; if (argAry[i].indexOf("g") >= 0) { @@ -291,9 +294,11 @@ function ParseReplaceArguments(args) { isOption = false; if (argAry[i].length >= 2) { switch (argAry[i].charAt(0)) { - case "-", "/": + case "-": + case "/": switch (argAry[i].charAt(1)) { - case "e", "i": + case "e": + case "i": isOption = true; regex = true; if (argAry[i].indexOf("i") >= 0) { @@ -308,7 +313,7 @@ function ParseReplaceArguments(args) { patterns.push(argAry[i]); } } - return { "patterns": pattern, "regex": regex, "ignoreCase": ignoreCase }; + return { "patterns": patterns, "regex": regex, "ignoreCase": ignoreCase }; } function Unescape(text) { @@ -324,7 +329,7 @@ function Unescape(text) { ch = text.charAt(i); switch (ch) { case "a": - result += "\a"; + result += String.fromCharCode(0x07); break; case "b": result += "\b"; @@ -336,7 +341,7 @@ function Unescape(text) { result += "\n"; break; case "v": - result += "\v"; + result += String.fromCharCode(0x0b); break; case "f": result += "\f"; @@ -361,6 +366,7 @@ function Unescape(text) { } i++; } + return result; } function PluginOnEvent(eventType, obj) { @@ -446,11 +452,13 @@ function SelectColumns(Text) { } else { if (!invert) { var matches = lines[i].match(rangesOrRegExps[j]); - for (var k = 0; k < matches.length; k++) { - line += matches[k]; + if (matches) { + for (var k = 0; k < matches.length; k++) { + line += matches[k]; + } } } else { - line += replacei(rangesOrRegExps[j], lines[i], "", false); + line += lines[i].replace(rangesOrRegExps[j], ""); } } } @@ -492,7 +500,7 @@ function SelectLines(Text) { } } else { for (var j = 0; j < lines.length; j++) { - var matched = (rangesOrRegExps[i].match(lines[j]) !== null); + var matched = (lines[j].match(rangesOrRegExps[i]) !== null); if (invert) { matched = !matched; } if (matched) { newlines.push(lines[j]); @@ -504,7 +512,7 @@ function SelectLines(Text) { if (lines[lines.length - 1] === "") { if (newlines.length > 0) { if (newlines[newlines.length - 1] !== "") { - newlines[l].push(""); + newlines.push(""); } } } @@ -546,19 +554,19 @@ function ReplaceText(Text) { var ignoreCase = parseResult.ignoreCase; if (regex) { for (var i = 0; i < patterns.length; i += 2) { - var re = new RegExp(patterns[i],ignoreCase ? "gmi" : "gm"); + var re = new RegExp(patterns[i], ignoreCase ? "gmi" : "gm"); if (i + 1 < patterns.length) { - result = result.replace(re, Unescape(patterns(i + 1))); + result = result.replace(re, Unescape(patterns[i + 1])); } else { - result = result.relace(re, result, ""); + result = result.replace(re, result, ""); } } } else { for (var i = 0; i < patterns.length; i += 2) { if (i + 1 < patterns.length) { - result = replacei(patterns(i), patterns(i + 1)); + result = replacei(result, patterns[i], patterns[i + 1]); } else { - result = replacei(patterns(i), ""); + result = replacei(result, patterns[i], ""); } } } @@ -577,7 +585,7 @@ function Tokenize(Text) { } else { pattern = pluginArguments; } - if (args === "") { + if (pattern === "") { throw new Error(30001, "Canceled"); } var re = new RegExp(pattern, "gi"); diff --git a/Testing/PluginTests/PluginTests.js b/Testing/PluginTests/PluginTests.js index 511a2acfcc3..52a40b34913 100644 --- a/Testing/PluginTests/PluginTests.js +++ b/Testing/PluginTests/PluginTests.js @@ -4,6 +4,9 @@ var g_testname; var FileSys = new ActiveXObject("Scripting.FileSystemObject"); var ScriptFolder = FileSys.GetParentFolderName(WScript.ScriptFullName); +var MergeApp = { + "Log": function (level, text) { WScript.Echo(text); } +}; function setTestName(testname) { g_cnt = 0; g_testname = testname; @@ -21,7 +24,6 @@ function assertTrue(value) { } function assertEquals(expected, actual) { - WScript.Echo(": " + g_testname); g_cnt++; if (expected !== actual) { throw new Error(30001, getCurrentTestName() + "\r\nexpected: \"" + expected + "\"\r\nactual: \"" + actual + "\""); @@ -52,6 +54,8 @@ function EditorAddinTest() { asciiChars += String.fromCharCode(i); } + p.PluginOnEvent(0, MergeApp); + // MakeUpper setTestName("MakeUpper"); assertEquals("", p.MakeUpper("")); @@ -130,7 +134,7 @@ function EditorAddinTest() { p.PluginArguments = "1-"; assertEquals("aaa\r\nbbb", p.SelectLines("aaa\r\nbbb")); assertEquals("aaa\r\nbbb\r\n", p.SelectLines("aaa\r\nbbb\r\n")); - assertEquals("aaa\r\n" + vbCrLf + vbCrLf, p.SelectLines("aaa\r\n" + vbCrLf + vbCrLf)); + assertEquals("aaa\r\n\r\n\r\n", p.SelectLines("aaa\r\n\r\n\r\n")); p.PluginArguments = "-2"; assertEquals("aaa\r\nbbb", p.SelectLines("aaa\r\nbbb")); assertEquals("aaa\r\nbbb\r\n", p.SelectLines("aaa\r\nbbb\r\n")); @@ -148,13 +152,13 @@ function EditorAddinTest() { p.PluginArguments = "-e .*"; assertEquals("aaa\r\nbbb", p.SelectLines("aaa\r\nbbb")); assertEquals("aaa\r\nbbb\r\n", p.SelectLines("aaa\r\nbbb\r\n")); - p.PluginArguments = "^a"; + p.PluginArguments = "-e ^a"; assertEquals("aaa", p.SelectLines("aaa\r\nbbb")); assertEquals("aaa\r\n", p.SelectLines("aaa\r\nbbb\r\n")); - p.PluginArguments = "a$"; + p.PluginArguments = "-e a$"; assertEquals("aaa", p.SelectLines("aaa\r\nbbb")); assertEquals("aaa\r\n", p.SelectLines("aaa\r\nbbb\r\n")); - p.PluginArguments = "-v a$"; + p.PluginArguments = "-v -e a$"; assertEquals("bbb", p.SelectLines("aaa\r\nbbb")); assertEquals("bbb\r\n", p.SelectLines("aaa\r\nbbb\r\n")); @@ -238,6 +242,7 @@ function EditorAddinTest() { assertEquals("aaa\r\nbbb", p.Trim(" aaa \r\n bbb ")); assertEquals("aaa\r\nbbb\r\n", p.Trim(" aaa \r\n bbb \r\n")); + p.PluginOnEvent(1, MergeApp); } EditorAddinTest(); From db21cb4c053f912c892dffa5ee1cf611a1ae9d2e Mon Sep 17 00:00:00 2001 From: Takashi Sawanaka Date: Thu, 1 Feb 2024 07:48:48 +0900 Subject: [PATCH 19/58] WIP --- Plugins/dlls/CompareMSExcelFiles.sct | 33 +- Plugins/dlls/CompareMSPowerPointFiles.sct | 760 ++++++++++------------ Plugins/dlls/CompareMSWordFiles.sct | 760 ++++++++++------------ 3 files changed, 727 insertions(+), 826 deletions(-) diff --git a/Plugins/dlls/CompareMSExcelFiles.sct b/Plugins/dlls/CompareMSExcelFiles.sct index 920a41f253c..914a81bd855 100644 --- a/Plugins/dlls/CompareMSExcelFiles.sct +++ b/Plugins/dlls/CompareMSExcelFiles.sct @@ -50,10 +50,10 @@ */ var REGKEY_PATH = "Plugins\\CompareMSExcelFiles.sct/"; +var MsgCannotGetMacros = "${Cannot get Macros.\r\n" + + " To allow WinMerge to compare macros, use MS Office to alter the settings in the Macro Security for the current application.\r\n" + + " The Trust access to Visual Basic Project feature should be turned on to use this feature in WinMerge.\r\n}"; var pbGroup = 6; -var MsgCannotGetMacros = "${Cannot get Macros.\n" + - " To allow WinMerge to compare macros, use MS Office to alter the settings in the Macro Security for the current application.\n" + - " The Trust access to Visual Basic Project feature should be turned on to use this feature in WinMerge.\n}"; var fso = new ActiveXObject("Scripting.FileSystemObject"); var wsh = new ActiveXObject("WScript.Shell"); @@ -75,10 +75,6 @@ function regWrite(Key, Value, TypeNm) { mergeApp.SaveOption(Key, (TypeNm === "REG_DWORD") ? parseInt(Value) : String(Value)); } -function get_PluginEvent() { - return "BUFFER_PREDIFF"; -} - function writeObjectProperties(fo, items) { try { for (var it = new Enumerator(items), o = it.item(); !it.atEnd(); it.moveNext(), o = it.item()) { @@ -215,7 +211,7 @@ function getModuleExtension(cmp) { function sleep(sec) { if (sec == 0) return; - wsh.Run("ping.exe localhost -n " + sec, 0, true); + wsh.run("ping.exe localhost -n " + sec, 0, true); } function saveRangeAsImage(sht, rng, filename) { @@ -416,7 +412,7 @@ function UnpackFile(fileSrc, fileDst, pbChanged, pSubcode) { if (fso.GetExtensionName(fileSrc2) == "lnk") { fileSrc2 = wsh.CreateShortcut(fileSrc2).TargetPath; if (!fso.FileExists(fileSrc2)) { - throw new Error(30001, "CompareMSExcelFiles.sct", fileSrc + ": Target file '" + fileSrc2 + "' not found"); + throw new Error(30001, "CompareMSExcelFiles.sct: " + fileSrc + ": Target file '" + fileSrc2 + "' not found"); } } var wbk = xl.Workbooks.Open(fileSrc2, regRead(REGKEY_PATH + "UpdateLinks", 0), null, null, null, null, null, null, null, null, null, null,null, true); @@ -458,7 +454,7 @@ function UnpackFile(fileSrc, fileDst, pbChanged, pSubcode) { if (regRead(REGKEY_PATH + "CompareVBAMacros", true)) { if (!isAccessibleVBAProject(wbk)) { - fo.WriteLine(Translate(MsgCannotGetMacros)); + fo.WriteLine(translate(MsgCannotGetMacros)); } for (var it = new Enumerator(wbk.VBProject.VBComponents), cmp = it.item(); !it.atEnd(); it.moveNext(), cmp = it.item()) { fo.WriteLine("[CodeModule." + cmp.Name + "]"); @@ -506,10 +502,10 @@ function UnpackFolder(fileSrc, folderDst, pbChanged, pSubcode) { xl.ErrorCheckingOptions.BackgroundChecking = false; var fileSrc2 = fileSrc; - if (fso.GetExtensionName(fileSrc2) == "lnk") { + if (fso.GetExtensionName(fileSrc2) === "lnk") { fileSrc2 = wsh.CreateShortcut(fileSrc2).TargetPath; if (!fso.FileExists(fileSrc2)) { - throw Error(30001, "CompareMSExcelFiles.sct", fileSrc + ": Target file '" + fileSrc2 + "' not found"); + throw new Error(30001, "CompareMSExcelFiles.sct: " + fileSrc + ": Target file '" + fileSrc2 + "' not found"); } } var wbk = xl.Workbooks.Open(fileSrc2, regRead(REGKEY_PATH + "UpdateLinks", 0), null, null, null, null, null, null, null, null, null, null, null, true); @@ -571,10 +567,9 @@ function UnpackFolder(fileSrc, folderDst, pbChanged, pSubcode) { if (regRead(REGKEY_PATH + "CompareVBAMacros", true)) { if (!isAccessibleVBAProject(wbk)) { fo = fso.CreateTextFile(fso.BuildPath(folderDst, "CannotGetMacros.bas"), true, true); - fo.WriteLine(Translate(MsgCannotGetMacros)); + fo.WriteLine(translate(MsgCannotGetMacros)); fo.Close(); } - for (var it = new Enumerator(wbk.VBProject.VBComponents), cmp = it.item(); !it.atEnd(); it.moveNext(), cmp = it.item()) { cmp.Export(fso.BuildPath(folderDst, cmp.Name + getModuleExtension(cmp))); } @@ -599,10 +594,10 @@ function UnpackFolder(fileSrc, folderDst, pbChanged, pSubcode) { } function PackFolder(fileSrc, folderDst, pbChanged, pSubcode) { - return false + return false; } -function Translate(text) { +function translate(text) { var re = /\${([^}]+)}/g; var matches; while ((matches = re.exec(text)) != null) { @@ -615,20 +610,20 @@ function ShowSettingsDialog() { var tname = fso.BuildPath(fso.GetSpecialFolder(2), fso.GetTempName() + ".hta"); var xmlfile = fso.BuildPath(fso.GetSpecialFolder(2), fso.GetTempName() + ".xml"); var tfile = fso.CreateTextFile(tname, true, true); - tfile.Write(Translate(getResource("dialog1"))); + tfile.Write(translate(getResource("dialog1"))); tfile.Close(); exportSettingsToXMLFile(xmlfile); var mshta = wsh.ExpandEnvironmentStrings("%SystemRoot%\\System32\\mshta.exe"); if (!fso.FileExists(mshta)) { mshta = wsh.ExpandEnvironmentStrings("%SystemRoot%\\SysWOW64\\mshta.exe"); } - Run(wsh, "\"" + mshta + "\" \"" + tname + "\" \"" + xmlfile + "\""); + run(wsh, "\"" + mshta + "\" \"" + tname + "\" \"" + xmlfile + "\""); importSettingsFromXMLFile(xmlfile); fso.DeleteFile(tname); fso.DeleteFile(xmlfile); } -function Run(sh, cmd) { +function run(sh, cmd) { sh.Run(cmd, 1, true); } diff --git a/Plugins/dlls/CompareMSPowerPointFiles.sct b/Plugins/dlls/CompareMSPowerPointFiles.sct index b2009d16191..07a51188490 100644 --- a/Plugins/dlls/CompareMSPowerPointFiles.sct +++ b/Plugins/dlls/CompareMSPowerPointFiles.sct @@ -1,418 +1,370 @@ - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + - +/* + This is a plugin for WinMerge. + It will display the text content of MS PowerPoint files. + Copyright (C) 2016-2024 Takashi Sawanaka - diff --git a/Plugins/dlls/CompareMSWordFiles.sct b/Plugins/dlls/CompareMSWordFiles.sct index c48ed02ad06..e8776e206a6 100644 --- a/Plugins/dlls/CompareMSWordFiles.sct +++ b/Plugins/dlls/CompareMSWordFiles.sct @@ -1,416 +1,370 @@ - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + - +/* + This is a plugin for WinMerge. + It will display the text content of MS Word files. + Copyright (C) 2008-2024 Takashi Sawanaka + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ - @@ -458,7 +412,7 @@ function importSettingsFromXMLFile(filepath) ts.Close(); var nodes = doc.documentElement.childNodes; for (var i = 0; i < nodes.length; i++) { - regWrite(nodes[i].getAttribute("name"), nodes[i].text, (nodes[i].getAttribute("type") === "string") ? "REG_SZ" : "REG_DWORD"); + regWrite(nodes[i].getAttribute("name"), nodes[i].text, (nodes[i].getAttribute("type") === "string") ? "REG_SZ" : "REG_DWORD"); } return settings; } From 719bb5e9f02ddef2385bc8a8f410a9e4c9f7a8cd Mon Sep 17 00:00:00 2001 From: Takashi Sawanaka Date: Thu, 1 Feb 2024 21:02:48 +0900 Subject: [PATCH 20/58] WIP --- Plugins/dlls/ApplyPatch.sct | 981 +++++++++++++---------------- Plugins/dlls/PrediffLineFilter.sct | 8 +- 2 files changed, 458 insertions(+), 531 deletions(-) diff --git a/Plugins/dlls/ApplyPatch.sct b/Plugins/dlls/ApplyPatch.sct index edbecff5d1d..eb0d29a7c80 100644 --- a/Plugins/dlls/ApplyPatch.sct +++ b/Plugins/dlls/ApplyPatch.sct @@ -1,537 +1,464 @@ - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + - +/* + This is a plugin for WinMerge. + It will apply selected patch to specified file or folder using GNU patch. + Copyright (C) 2015-2024 Takashi Sawanaka - diff --git a/Plugins/dlls/PrediffLineFilter.sct b/Plugins/dlls/PrediffLineFilter.sct index a7856427fa9..fbb14073f73 100644 --- a/Plugins/dlls/PrediffLineFilter.sct +++ b/Plugins/dlls/PrediffLineFilter.sct @@ -132,7 +132,7 @@ function replacei(text, find, replace, ignorecase) { return text; } -function Translate(text) { +function translate(text) { var re = /\${([^}]+)}/g; var matches; while ((matches = re.exec(text)) != null) { @@ -145,20 +145,20 @@ function ShowSettingsDialog() { var tname = fso.BuildPath(fso.GetSpecialFolder(2), fso.GetTempName() + ".hta"); var xmlfile = fso.BuildPath(fso.GetSpecialFolder(2), fso.GetTempName() + ".xml"); var tfile = fso.CreateTextFile(tname, true, true); - tfile.Write(Translate(getResource("dialog1"))); + tfile.Write(translate(getResource("dialog1"))); tfile.Close(); exportSettingsToXMLFile(xmlfile); var mshta = wsh.ExpandEnvironmentStrings("%SystemRoot%\\System32\\mshta.exe"); if (!fso.FileExists(mshta)) { mshta = wsh.ExpandEnvironmentStrings("%SystemRoot%\\SysWOW64\\mshta.exe"); } - Run(wsh, "\"" + mshta + "\" \"" + tname + "\" \"" + xmlfile + "\""); + run(wsh, "\"" + mshta + "\" \"" + tname + "\" \"" + xmlfile + "\""); importSettingsFromXMLFile(xmlfile); fso.DeleteFile(tname); fso.DeleteFile(xmlfile); } -function Run(sh, cmd) { +function run(sh, cmd) { sh.Run(cmd, 1, true); } From 29f7a80bc60f767db2fc7bb2b5dc8abf9acd07cd Mon Sep 17 00:00:00 2001 From: Takashi Sawanaka Date: Thu, 1 Feb 2024 22:05:48 +0900 Subject: [PATCH 21/58] WIP --- Plugins/dlls/CompareMSExcelFiles.sct | 15 ++++++++------- Plugins/dlls/CompareMSPowerPointFiles.sct | 4 ++-- Plugins/dlls/CompareMSWordFiles.sct | 19 ++++++++++--------- 3 files changed, 20 insertions(+), 18 deletions(-) diff --git a/Plugins/dlls/CompareMSExcelFiles.sct b/Plugins/dlls/CompareMSExcelFiles.sct index 914a81bd855..28e76a40125 100644 --- a/Plugins/dlls/CompareMSExcelFiles.sct +++ b/Plugins/dlls/CompareMSExcelFiles.sct @@ -49,6 +49,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ + var REGKEY_PATH = "Plugins\\CompareMSExcelFiles.sct/"; var MsgCannotGetMacros = "${Cannot get Macros.\r\n" + " To allow WinMerge to compare macros, use MS Office to alter the settings in the Macro Security for the current application.\r\n" + @@ -515,13 +516,13 @@ function UnpackFolder(fileSrc, folderDst, pbChanged, pSubcode) { var zf = Array(digit + 1).join("0"); if (regRead(REGKEY_PATH + "CompareDocumentProperties", false)) { - fo = fso.CreateTextFile(fso.BuildPath(folderDst, "(" + zf + ")DocumentProperties.txt"), true, true); + var fo = fso.CreateTextFile(fso.BuildPath(folderDst, "(" + zf + ")DocumentProperties.txt"), true, true); writeObjectProperties(fo, wbk.BuiltinDocumentProperties); fo.Close(); } if (regRead(REGKEY_PATH + "CompareNames", true)) { - fo = fso.CreateTextFile(fso.BuildPath(folderDst, "(" + zf + ")Names.txt"), true, true); + var fo = fso.CreateTextFile(fso.BuildPath(folderDst, "(" + zf + ")Names.txt"), true, true); writeObjectProperties(fo, wbk.Names); fo.Close(); } @@ -531,26 +532,26 @@ function UnpackFolder(fileSrc, folderDst, pbChanged, pSubcode) { No = zf + No; No = No.substr(No.length - digit, digit); if (regRead(REGKEY_PATH + "CompareCellValues", true)) { - fo = fso.CreateTextFile(fso.BuildPath(folderDst, "(" + No + ")" + escape(sht.Name) + ".tsv"), true, true); + var fo = fso.CreateTextFile(fso.BuildPath(folderDst, "(" + No + ")" + escape(sht.Name) + ".tsv"), true, true); writeCellValues(fo, sht); fo.Close(); } if (regRead(REGKEY_PATH + "CompareFormulas", false)) { - fo = fso.CreateTextFile(fso.BuildPath(folderDst, "(" + No + ")" + escape(sht.Name) + "_Formulas.txt"), true, true); + var fo = fso.CreateTextFile(fso.BuildPath(folderDst, "(" + No + ")" + escape(sht.Name) + "_Formulas.txt"), true, true); writeFormulas(fo, sht); fo.Close(); } if (regRead(REGKEY_PATH + "CompareTextsInShapes", true)) { - fo = fso.CreateTextFile(fso.BuildPath(folderDst, "(" + No + ")" + escape(sht.Name) + "_Shapes.txt"), true, true); + var fo = fso.CreateTextFile(fso.BuildPath(folderDst, "(" + No + ")" + escape(sht.Name) + "_Shapes.txt"), true, true); ungroupShapes(sht); writeTextsInShapes(fo, sht); fo.Close(); } if (regRead(REGKEY_PATH + "CompareHeadersAndFooters", true)) { - fo = fso.CreateTextFile(fso.BuildPath(folderDst, "(" + No + ")" + escape(sht.Name) + "_HeadersAndFooters.txt"), true, true); + var fo = fso.CreateTextFile(fso.BuildPath(folderDst, "(" + No + ")" + escape(sht.Name) + "_HeadersAndFooters.txt"), true, true); writeHeadersAndFooters(fo, sht); fo.Close(); } @@ -566,7 +567,7 @@ function UnpackFolder(fileSrc, folderDst, pbChanged, pSubcode) { } if (regRead(REGKEY_PATH + "CompareVBAMacros", true)) { if (!isAccessibleVBAProject(wbk)) { - fo = fso.CreateTextFile(fso.BuildPath(folderDst, "CannotGetMacros.bas"), true, true); + var fo = fso.CreateTextFile(fso.BuildPath(folderDst, "CannotGetMacros.bas"), true, true); fo.WriteLine(translate(MsgCannotGetMacros)); fo.Close(); } diff --git a/Plugins/dlls/CompareMSPowerPointFiles.sct b/Plugins/dlls/CompareMSPowerPointFiles.sct index 07a51188490..1dce58e49a6 100644 --- a/Plugins/dlls/CompareMSPowerPointFiles.sct +++ b/Plugins/dlls/CompareMSPowerPointFiles.sct @@ -46,6 +46,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ + var REGKEY_PATH = "Plugins\\CompareMSPowerPointFiles.sct/"; var MsgCannotGetMacros = "${Cannot get Macros.\r\n" + " To allow WinMerge to compare macros, use MS Office to alter the settings in the Macro Security for the current application.\r\n" + @@ -269,7 +270,6 @@ function UnpackFolder(fileSrc, folderDst, pbChanged, pSubcode) { fo.WriteLine(translate(MsgCannotGetMacros)); fo.Close(); } - for (var it = new Enumerator(prs.VBProject.VBComponents), cmp = it.item(); !it.atEnd(); it.moveNext(), cmp = it.item()) { cmp.Export(fso.BuildPath(folderDst, cmp.Name + getModuleExtension(cmp))); } @@ -277,7 +277,7 @@ function UnpackFolder(fileSrc, folderDst, pbChanged, pSubcode) { sld = null; prs.Close(); - prs = null + prs = null; pp.Quit(); pp = null; fo = null; diff --git a/Plugins/dlls/CompareMSWordFiles.sct b/Plugins/dlls/CompareMSWordFiles.sct index e8776e206a6..e2362f3a98a 100644 --- a/Plugins/dlls/CompareMSWordFiles.sct +++ b/Plugins/dlls/CompareMSWordFiles.sct @@ -48,9 +48,10 @@ var REGKEY_PATH = "Plugins\\CompareMSWordFiles.sct/"; -var MsgCannotGetMacros = "${Cannot get Macros.\r\n" + _ - " To allow WinMerge to compare macros, use MS Office to alter the settings in the Macro Security for the current application.\r\n" + _ +var MsgCannotGetMacros = "${Cannot get Macros.\r\n" + + " To allow WinMerge to compare macros, use MS Office to alter the settings in the Macro Security for the current application.\r\n" + " The Trust access to Visual Basic Project feature should be turned on to use this feature in WinMerge.\r\n}"; +var wdFormatFilteredHTML = 10; var fso = new ActiveXObject("Scripting.FileSystemObject"); var wsh = new ActiveXObject("WScript.Shell"); @@ -149,7 +150,7 @@ function UnpackFile(fileSrc, fileDst, pbChanged, pSubcode) { var fo = fso.CreateTextFile(fileDst, true, true); var wd = new ActiveXObject("Word.Application"); - wd.DisplayAlerts = false + wd.DisplayAlerts = false; fileSrc2 = fileSrc; if (fso.GetExtensionName(fileSrc2) = "lnk") { @@ -201,7 +202,7 @@ function UnpackFile(fileSrc, fileDst, pbChanged, pSubcode) { wd = null; fo.Close(); - fo = null + fo = null; pbChanged = true; pSubcode = 0; @@ -224,7 +225,7 @@ function IsFolder(file) { function UnpackFolder(fileSrc, folderDst, pbChanged, pSubcode) { if (!fso.FolderExists(folderDst)) { fso.CreateFolder(folderDst); } - var wd = new ActiveXObject("Word.Application") + var wd = new ActiveXObject("Word.Application"); wd.DisplayAlerts = false; var fileSrc2 = fileSrc; @@ -255,14 +256,14 @@ function UnpackFolder(fileSrc, folderDst, pbChanged, pSubcode) { } if (regRead(REGKEY_PATH + "CompareTextsInShapes", true)) { - var fo = fso.CreateTextFile(fso.BuildPath(folderDst, "Shapes.txt"), true, true) + var fo = fso.CreateTextFile(fso.BuildPath(folderDst, "Shapes.txt"), true, true); ungroupShapes(doc); writeTextsInShapes(fo, doc); fo.Close(); } if (regRead(REGKEY_PATH + "CompareDocumentsAsHTML", true)) { - doc.SaveAs(fso.BuildPath(folderDst, "Document.htm"), 10/*wdFormatFilteredHTML*/); + doc.SaveAs(fso.BuildPath(folderDst, "Document.htm"), wdFormatFilteredHTML); } if (regRead(REGKEY_PATH + "CompareVBAMacros", true)) { if (!isAccessibleVBAProject(doc)) { @@ -281,8 +282,8 @@ function UnpackFolder(fileSrc, folderDst, pbChanged, pSubcode) { wd = null; fo = null; - pbChanged = true - pSubcode = 0 + pbChanged = true; + pSubcode = 0; var result = new ActiveXObject("Scripting.Dictionary"); result.Add(0, true); From d31cac720c4fd2271741aa484e00551053daeba1 Mon Sep 17 00:00:00 2001 From: Takashi Sawanaka Date: Fri, 2 Feb 2024 09:00:43 +0900 Subject: [PATCH 22/58] WIP --- Plugins/dlls/ApplyPatch.sct | 48 +- Plugins/dlls/CompareMSExcelFiles.sct | 14 +- Plugins/dlls/CompareMSPowerPointFiles.sct | 4 +- Plugins/dlls/CompareMSVisioFiles.sct | 684 ++++++++++------------ Plugins/dlls/CompareMSWordFiles.sct | 16 +- Plugins/dlls/PrediffLineFilter.sct | 4 +- Plugins/dlls/editor addin.sct | 2 +- 7 files changed, 369 insertions(+), 403 deletions(-) diff --git a/Plugins/dlls/ApplyPatch.sct b/Plugins/dlls/ApplyPatch.sct index eb0d29a7c80..41a0ac881e6 100644 --- a/Plugins/dlls/ApplyPatch.sct +++ b/Plugins/dlls/ApplyPatch.sct @@ -47,7 +47,7 @@ */ -var REGKEY_PATH = "HKEY_CURRENT_USER\\Software\\Thingamahoochie\\WinMerge"; +var REGKEY_PATH = "Plugins\\CompareMSExcelFiles.sct/"; var PLUGIN_NAME = "ApplyPatch.sct WinMerge Plugin"; var fso = new ActiveXObject("Scripting.FileSystemObject"); @@ -109,14 +109,14 @@ function UnpackFile(fileSrc, fileDst, pbChanged, pSubcode) { return result.Items(); } - var filePatched = (PrevFileName !== "") ? PrevFileName : regRead("Files\\Left/Item_0", ""); + var filePatched = (PrevFileName !== "") ? PrevFileName : regRead(REGKEY_PATH + "Files\\Left/Item_0", ""); if (isPatchFile(filePatched)) { - filePatched = regRead("Files\\Right/Item_0", ""); + filePatched = regRead(REGKEY_PATH + "Files\\Right/Item_0", ""); } var msg = fmt(translate("${Enter the name of the file to which the patch '%1' will be applied}"), [ fso.GetFileName(fileSrc) ]); while (true) { - filePatched = InputBox(msg, PLUGIN_NAME, filePatched) + filePatched = mergeApp.InputBox(msg, PLUGIN_NAME, filePatched); if (filePatched === "") { return false; } @@ -124,15 +124,15 @@ function UnpackFile(fileSrc, fileDst, pbChanged, pSubcode) { mergeApp.MsgBox(fmt(translate("${File '%1' does not exist}"), [ filePatched ]), 48/*vbExclamation*/); } - var cmdLine = "type \"" + fileSrc + "\" | patch --binary $FILE" - msg = translate("${Enter the command line arguments for patch command}") + var cmdLine = "type \"" + fileSrc + "\" | patch --binary $FILE"; + msg = translate("${Enter the command line arguments for patch command}"); cmdLine = mergeApp.InputBox(msg, PLUGIN_NAME, cmdLine); if (cmdLine === "") { return false; } - cmdLine = Replace(cmdLine, "$FILE", fileDst); + cmdLine = cmdLine.replace("$FILE", fileDst); fso.CopyFile(filePatched, fileDst); - run(wsh, "cmd.exe /s /c \"set PATH=" + GetPatchExeFolder() + ";%PATH% + " + cmdLine + " + pause\""); + run(wsh, "cmd.exe /s /c \"set PATH=" + getPatchExeFolder() + ";%PATH% & " + cmdLine + " & pause\""); pbChanged = true; pSubcode = 0; @@ -154,7 +154,7 @@ function PackFile(fileSrc, fileDst, pbChanged, pSubcode) { result.Add(2, pSubcode); return result.Items(); } - return false + return false; } function IsFolder(file) { @@ -164,9 +164,9 @@ function IsFolder(file) { function UnpackFolder(fileSrc, folderDst, pbChanged, pSubcode) { if (!fso.FolderExists(folderDst)) { fso.CreateFolder(folderDst); } - var dirPatched = regRead("Files\\Left/Item_0", "") + var dirPatched = regRead(REGKEY_PATH + "Files\\Left/Item_0", ""); if (!fso.FolderExists(dirPatched)) { - dirPatched = regRead("Files\\Right/Item_0", "") + dirPatched = regRead(REGKEY_PATH + "Files\\Right/Item_0", ""); } var msg = fmt(translate("${Enter the name of the folder to which the patch '%1' will be applied}"), [ fso.GetFileName(fileSrc) ]); @@ -194,7 +194,7 @@ function UnpackFolder(fileSrc, folderDst, pbChanged, pSubcode) { stripCount = getStripCountFromCmdLine(cmdLine); if (stripCount === 0) { if (hasAbsolutePathInList(files)) { - msg = translate("${Should not specify the '-p0' command line option for the patch file which includes absolute paths}") + msg = translate("${Should not specify the '-p0' command line option for the patch file which includes absolute paths}"); mergeApp.MsgBox(msg, 48/*vbExclamation*/); return false; } @@ -202,7 +202,7 @@ function UnpackFolder(fileSrc, folderDst, pbChanged, pSubcode) { copyOriginalFiles(dirPatched, folderDst, files, stripCount); - run(wsh, "cmd.exe /s /c \"set PATH=" + GetPatchExeFolder() + ";%PATH% + cd /d " + folderDst + " + " + cmdLine + " + pause\""); + run(wsh, "cmd.exe /s /c \"set PATH=" + getPatchExeFolder() + ";%PATH% & cd /d " + folderDst + " + " + cmdLine + " & pause\""); pbChanged = true; pSubcode = 0; @@ -247,7 +247,7 @@ function run(sh, cmd) { sh.Run(cmd, 1, true); } -function GetPatchExeFolder() { +function getPatchExeFolder() { var winMergeExePath = "C:\\Program Files\\WinMerge\\WinMergeU.exe"; try { winMergeExePath = wsh.RegRead(REGKEY_PATH + "\\Executable"); @@ -258,8 +258,8 @@ function GetPatchExeFolder() { function isPatchFile(path) { var patterns = get_PluginFileFilters().split(";"); for (var i = 0; i < patterns.length; i++) { - var re = new RegExp(pattern, "gi"); - if (re.match(path)) { + var re = new RegExp(patterns[i], "gi"); + if (re.test(path)) { return true; } } @@ -290,7 +290,7 @@ function isNullDevice(path) { function stripDir(fileName, stripCount) { if (stripCount === -1) { return fso.GetFileName(fileName); - } else if ( stripCount = 0) { + } else if ( stripCount === 0) { return fileName; } var pos = 0; @@ -314,8 +314,8 @@ function stripDir(fileName, stripCount) { function makePatchedFileName(destDir, fileName, stripCount) { if (!isNullDevice(fileName)) { - var strippedFileName = stripDir(fileName, stripCount) - if (strippedFileName = "") { + var strippedFileName = stripDir(fileName, stripCount); + if (strippedFileName === "") { return ""; } if (!isAbsolutePath(strippedFileName)) { @@ -332,7 +332,7 @@ function guessStripCount(fileNamesInPatch, destDir) { var maxMatchCount = 0; if (fileNamesInPatch.length === 0) { return guessedStripCount; } while (true) { - var matchCount = 0 + var matchCount = 0; for (var i = 0; i < fileNamesInPatch.length; i++) { for (var j = 0; j < 2; j++) { if (!isNullDevice(fileNamesInPatch[i][j])) { @@ -367,8 +367,8 @@ function createFolderEx(dirName) { function copyOriginalFiles(srcDir, destDir, fileNamesInPatch, stripCount) { for (var i = 0; i < fileNamesInPath.length; i++) { if (!isNullDevice(fileNamesInPatch(i)(0))) { - var fileNameSrc = makePatchedFileName(srcDir, fileNamesInPatch(i)(0), stripCount) - var fileNameDest = makePatchedFileName(destDir, fileNamesInPatch(i)(0), stripCount) + var fileNameSrc = makePatchedFileName(srcDir, fileNamesInPatch(i)(0), stripCount); + var fileNameDest = makePatchedFileName(destDir, fileNamesInPatch(i)(0), stripCount); if (fso.FileExists(fileNameSrc)) { if (!fso.FolderExists(fso.GetParentFolderName(fileNameDest))) { createFolderEx(fso.GetParentFolderName(fileNameDest)); @@ -452,7 +452,7 @@ function importSettingsFromXMLFile(filepath) { var ts = fso.OpenTextFile(filepath, 1, true, -1); var xml = ts.ReadAll(); var doc = new ActiveXObject("MSXML2.DOMDocument"); - doc.async = false + doc.async = false; doc.loadXML(xml); ts.Close(); var nodes = doc.documentElement.childNodes; @@ -501,7 +501,7 @@ function importSettingsFromXMLFile(filepath) { var ts = fso.OpenTextFile(filepath, 1, true, -1); var xml = ts.ReadAll(); var doc = new ActiveXObject("MSXML2.DOMDocument"); - doc.async = false + doc.async = false; doc.loadXML(xml); ts.Close(); var nodes = doc.documentElement.childNodes; diff --git a/Plugins/dlls/CompareMSExcelFiles.sct b/Plugins/dlls/CompareMSExcelFiles.sct index 28e76a40125..41c7b9e7040 100644 --- a/Plugins/dlls/CompareMSExcelFiles.sct +++ b/Plugins/dlls/CompareMSExcelFiles.sct @@ -175,7 +175,7 @@ function ungroupShapes(sht) { shp.Ungroup(); } } - } while (cnt != sht.Shapes.Count); + } while (cnt !== sht.Shapes.Count); } catch (e) {} } @@ -244,7 +244,7 @@ function saveRangeAsImage(sht, rng, filename) { try { rng.CopyPicture(1, 2); // xlScreen=1, xlBitmap=2 sleep(i); - obj.Paste; + obj.Paste(); obj.Export(filename, "PNG"); result = true; break; @@ -298,7 +298,7 @@ function findRowByPosition(sht, rowBegin, rowEnd, pos) { if (row == rowPrev) { return row; } - rowPrev = row + rowPrev = row; } while (true); } @@ -330,7 +330,7 @@ function saveSheetAsImage(sht, basefilename) { var column = rngUsed.Column; do { var columnEnd = findColumnByPosition(sht, column, rngUsed.Column + rngUsed.Columns.Count - 1, imageWidth); - var numY = 1 + var numY = 1; var row = rngUsed.Row; do { var rowEnd = findRowByPosition(sht, row, rngUsed.Row + rngUsed.Rows.Count - 1, imageHeight); @@ -383,7 +383,7 @@ function get_PluginDescription() { } function get_PluginFileFilters() { - return "\.xls(\..*)?$;\.xlsx(\..*)?$;\.xlsm(\..*)?$;\.xlsb(\..*)?;\.xla(\..*)?$;\.xlax(\..*)?$;\.xltx(\..*)?$;\.xltm(\..*)?$"; + return "\\.xls(\\..*)?$;\\.xlsx(\\..*)?$;\\.xlsm(\\..*)?$;\\.xlsb(\\..*)?;\\.xla(\\..*)?$;\\.xlax(\\..*)?$;\\.xltx(\\..*)?$;\\.xltm(\\..*)?$"; } function get_PluginIsAutomatic() { @@ -667,7 +667,7 @@ function importSettingsFromXMLFile(filepath) { var ts = fso.OpenTextFile(filepath, 1, true, -1); var xml = ts.ReadAll(); var doc = new ActiveXObject("MSXML2.DOMDocument"); - doc.async = false + doc.async = false; doc.loadXML(xml); ts.Close(); var nodes = doc.documentElement.childNodes; @@ -716,7 +716,7 @@ function importSettingsFromXMLFile(filepath) { var ts = fso.OpenTextFile(filepath, 1, true, -1); var xml = ts.ReadAll(); var doc = new ActiveXObject("MSXML2.DOMDocument"); - doc.async = false + doc.async = false; doc.loadXML(xml); ts.Close(); var nodes = doc.documentElement.childNodes; diff --git a/Plugins/dlls/CompareMSPowerPointFiles.sct b/Plugins/dlls/CompareMSPowerPointFiles.sct index 1dce58e49a6..2cdbf83a49e 100644 --- a/Plugins/dlls/CompareMSPowerPointFiles.sct +++ b/Plugins/dlls/CompareMSPowerPointFiles.sct @@ -358,7 +358,7 @@ function importSettingsFromXMLFile(filepath) { var ts = fso.OpenTextFile(filepath, 1, true, -1); var xml = ts.ReadAll(); var doc = new ActiveXObject("MSXML2.DOMDocument"); - doc.async = false + doc.async = false; doc.loadXML(xml); ts.Close(); var nodes = doc.documentElement.childNodes; @@ -407,7 +407,7 @@ function importSettingsFromXMLFile(filepath) { var ts = fso.OpenTextFile(filepath, 1, true, -1); var xml = ts.ReadAll(); var doc = new ActiveXObject("MSXML2.DOMDocument"); - doc.async = false + doc.async = false; doc.loadXML(xml); ts.Close(); var nodes = doc.documentElement.childNodes; diff --git a/Plugins/dlls/CompareMSVisioFiles.sct b/Plugins/dlls/CompareMSVisioFiles.sct index 9afcceaf0bb..3d4c008a081 100644 --- a/Plugins/dlls/CompareMSVisioFiles.sct +++ b/Plugins/dlls/CompareMSVisioFiles.sct @@ -1,374 +1,336 @@ - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + - +/* + This is a plugin for WinMerge. + It will display the text content of MS Visio files. + Copyright (C) 2020 dedicatus + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ - @@ -411,7 +373,7 @@ function importSettingsFromXMLFile(filepath) var ts = fso.OpenTextFile(filepath, 1, true, -1); var xml = ts.ReadAll(); var doc = new ActiveXObject("MSXML2.DOMDocument"); - doc.async = false + doc.async = false; doc.loadXML(xml); ts.Close(); var nodes = doc.documentElement.childNodes; diff --git a/Plugins/dlls/CompareMSWordFiles.sct b/Plugins/dlls/CompareMSWordFiles.sct index e2362f3a98a..c8716f41b92 100644 --- a/Plugins/dlls/CompareMSWordFiles.sct +++ b/Plugins/dlls/CompareMSWordFiles.sct @@ -99,7 +99,7 @@ function ungroupShapes(sht) { shp.Ungroup(); } } - } while (cnt != doc.Shapes.Count); + } while (cnt !== doc.Shapes.Count); } catch (e) {} } @@ -152,8 +152,8 @@ function UnpackFile(fileSrc, fileDst, pbChanged, pSubcode) { var wd = new ActiveXObject("Word.Application"); wd.DisplayAlerts = false; - fileSrc2 = fileSrc; - if (fso.GetExtensionName(fileSrc2) = "lnk") { + var fileSrc2 = fileSrc; + if (fso.GetExtensionName(fileSrc2) === "lnk") { fileSrc2 = wsh.CreateShortcut(fileSrc2).TargetPath; if (!fso.FileExists(fileSrc2)) { throw new Error(30001, "CompareMSWordFiles.sct: " + fileSrc + ": Target file '" + fileSrc2 + "' not found"); @@ -191,7 +191,11 @@ function UnpackFile(fileSrc, fileDst, pbChanged, pSubcode) { fo.WriteLine(translate(MsgCannotGetMacros)); } for (var it = new Enumerator(doc.VBProject.VBComponents), cmp = it.item(); !it.atEnd(); it.moveNext(), cmp = it.item()) { - cmp.Export(fso.BuildPath(folderDst, cmp.Name + getModuleExtension(cmp))); + fo.WriteLine("[CodeModule." + cmp.Name + "]"); + if (cmp.CodeModule.CountOfLines > 0) { + fo.WriteLine(cmp.CodeModule.Lines(1, cmp.CodeModule.CountOfLines)); + } + fo.WriteLine(""); } } @@ -359,7 +363,7 @@ function importSettingsFromXMLFile(filepath) { var ts = fso.OpenTextFile(filepath, 1, true, -1); var xml = ts.ReadAll(); var doc = new ActiveXObject("MSXML2.DOMDocument"); - doc.async = false + doc.async = false; doc.loadXML(xml); ts.Close(); var nodes = doc.documentElement.childNodes; @@ -408,7 +412,7 @@ function importSettingsFromXMLFile(filepath) { var ts = fso.OpenTextFile(filepath, 1, true, -1); var xml = ts.ReadAll(); var doc = new ActiveXObject("MSXML2.DOMDocument"); - doc.async = false + doc.async = false; doc.loadXML(xml); ts.Close(); var nodes = doc.documentElement.childNodes; diff --git a/Plugins/dlls/PrediffLineFilter.sct b/Plugins/dlls/PrediffLineFilter.sct index fbb14073f73..0f393432b12 100644 --- a/Plugins/dlls/PrediffLineFilter.sct +++ b/Plugins/dlls/PrediffLineFilter.sct @@ -195,7 +195,7 @@ function importSettingsFromXMLFile(filepath) { var ts = fso.OpenTextFile(filepath, 1, true, -1); var xml = ts.ReadAll(); var doc = new ActiveXObject("MSXML2.DOMDocument"); - doc.async = false + doc.async = false; doc.loadXML(xml); ts.Close(); var nodes = doc.documentElement.childNodes; @@ -248,7 +248,7 @@ function importSettingsFromXMLFile(filepath) { var ts = fso.OpenTextFile(filepath, 1, true, -1); var xml = ts.ReadAll(); var doc = new ActiveXObject("MSXML2.DOMDocument"); - doc.async = false + doc.async = false; doc.loadXML(xml); ts.Close(); var nodes = doc.documentElement.childNodes; diff --git a/Plugins/dlls/editor addin.sct b/Plugins/dlls/editor addin.sct index 0b229c8ece2..6b02d258e5d 100644 --- a/Plugins/dlls/editor addin.sct +++ b/Plugins/dlls/editor addin.sct @@ -41,7 +41,7 @@ var REGKEY_PATH = "Plugins\\editor addin.sct/"; -var wsh = new ActiveXObject("WScript.Shell") +var wsh = new ActiveXObject("WScript.Shell"); var pluginArguments = ""; var variables = new Array(); var mergeApp; From 99f69018048c4aae507cf63fe69078e7667eafdc Mon Sep 17 00:00:00 2001 From: Takashi Sawanaka Date: Fri, 2 Feb 2024 09:14:52 +0900 Subject: [PATCH 23/58] WIP --- Src/MergeApp.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Src/MergeApp.cpp b/Src/MergeApp.cpp index 15095447f10..3e9e33b93df 100644 --- a/Src/MergeApp.cpp +++ b/Src/MergeApp.cpp @@ -100,7 +100,7 @@ void AppErrorMessageBox(const String& msg) void* AppGetMainHWND() { - return AfxGetMainWnd()->m_hWnd; + return AfxGetMainWnd()->GetSafeHwnd(); } namespace AppMsgBox From 9c07d2b002683dfbee514ef2564e0facd92e9ede Mon Sep 17 00:00:00 2001 From: Takashi Sawanaka Date: Mon, 5 Feb 2024 21:29:05 +0900 Subject: [PATCH 24/58] WIP --- Plugins/dlls/CompareMSExcelFiles.sct | 82 ++++++++------ Plugins/dlls/CompareMSPowerPointFiles.sct | 25 ++--- Plugins/dlls/CompareMSVisioFiles.sct | 32 +++--- Plugins/dlls/CompareMSWordFiles.sct | 38 ++++--- Src/7zcommon.patch | 102 ++++++++++++++++++ Src/MergeAppLib.h | 4 +- Testing/Data/Office/excel.xls | Bin 47616 -> 49664 bytes Testing/Data/Office/powerpnt.ppt | Bin 89088 -> 86016 bytes Testing/Data/Office/~$word.doc | Bin 0 -> 162 bytes Testing/PluginTests/PluginTests.js | 69 ++++++++++-- Testing/PluginTests/result/excel.xls.txt | Bin 0 -> 2740 bytes Testing/PluginTests/result/excel/(0)Names.txt | 1 + .../result/excel/(1)Sheet1(1-1).png | Bin 0 -> 31086 bytes .../PluginTests/result/excel/(1)Sheet1.tsv | Bin 0 -> 130 bytes .../excel/(1)Sheet1_HeadersAndFooters.txt | Bin 0 -> 242 bytes .../result/excel/(1)Sheet1_Shapes.txt | Bin 0 -> 180 bytes .../result/excel/(2)Sheet2(1-1).png | Bin 0 -> 282 bytes .../PluginTests/result/excel/(2)Sheet2.tsv | Bin 0 -> 8 bytes .../excel/(2)Sheet2_HeadersAndFooters.txt | Bin 0 -> 182 bytes .../result/excel/(2)Sheet2_Shapes.txt | 1 + .../result/excel/(3)Sheet3(1-1).png | Bin 0 -> 430 bytes .../PluginTests/result/excel/(3)Sheet3.tsv | Bin 0 -> 8 bytes .../excel/(3)Sheet3_HeadersAndFooters.txt | Bin 0 -> 182 bytes .../result/excel/(3)Sheet3_Shapes.txt | 1 + .../result/excel/(4)Sheet4(1-1).png | Bin 0 -> 1151 bytes .../PluginTests/result/excel/(4)Sheet4.tsv | Bin 0 -> 70 bytes .../excel/(4)Sheet4_HeadersAndFooters.txt | Bin 0 -> 182 bytes .../result/excel/(4)Sheet4_Shapes.txt | 1 + .../result/excel/(5)Sheet5(1-1).png | Bin 0 -> 704 bytes .../PluginTests/result/excel/(5)Sheet5.tsv | Bin 0 -> 12 bytes .../excel/(5)Sheet5_HeadersAndFooters.txt | Bin 0 -> 182 bytes .../result/excel/(5)Sheet5_Shapes.txt | 1 + .../result/excel/(6)Sheet6(1-1).png | Bin 0 -> 1154 bytes .../PluginTests/result/excel/(6)Sheet6.tsv | Bin 0 -> 38 bytes .../excel/(6)Sheet6_HeadersAndFooters.txt | Bin 0 -> 182 bytes .../result/excel/(6)Sheet6_Shapes.txt | 1 + Testing/PluginTests/result/excel/Sheet1.bas | 12 +++ Testing/PluginTests/result/excel/Sheet2.bas | 9 ++ Testing/PluginTests/result/excel/Sheet3.bas | 9 ++ Testing/PluginTests/result/excel/Sheet4.bas | 9 ++ Testing/PluginTests/result/excel/Sheet5.bas | 9 ++ Testing/PluginTests/result/excel/Sheet6.bas | 9 ++ .../PluginTests/result/excel/ThisWorkbook.bas | 9 ++ Testing/PluginTests/result/powerpnt.ppt.txt | Bin 0 -> 298 bytes .../result/powerpnt/CannotGetMacros.bas | Bin 0 -> 514 bytes .../PluginTests/result/powerpnt/Slide1.png | Bin 0 -> 2895 bytes .../PluginTests/result/powerpnt/Slide1.txt | Bin 0 -> 64 bytes .../result/powerpnt/Slide1_NotesPage.txt | Bin 0 -> 168 bytes Testing/PluginTests/result/word.doc.txt | Bin 0 -> 154 bytes .../PluginTests/result/word/(0)Bookmarks.txt | 1 + .../result/word/CannotGetMacros.bas | Bin 0 -> 514 bytes Testing/PluginTests/result/word/Document.htm | 46 ++++++++ Testing/PluginTests/result/word/Document.txt | Bin 0 -> 4 bytes Testing/PluginTests/result/word/Shapes.txt | 1 + .../PluginTests/result/word/ThisDocument.bas | 9 ++ Testing/SingleInstanceTest.cmd | 12 +++ crowdin.yml | 54 ++++++++++ 57 files changed, 466 insertions(+), 81 deletions(-) create mode 100644 Src/7zcommon.patch create mode 100644 Testing/Data/Office/~$word.doc create mode 100644 Testing/PluginTests/result/excel.xls.txt create mode 100644 Testing/PluginTests/result/excel/(0)Names.txt create mode 100644 Testing/PluginTests/result/excel/(1)Sheet1(1-1).png create mode 100644 Testing/PluginTests/result/excel/(1)Sheet1.tsv create mode 100644 Testing/PluginTests/result/excel/(1)Sheet1_HeadersAndFooters.txt create mode 100644 Testing/PluginTests/result/excel/(1)Sheet1_Shapes.txt create mode 100644 Testing/PluginTests/result/excel/(2)Sheet2(1-1).png create mode 100644 Testing/PluginTests/result/excel/(2)Sheet2.tsv create mode 100644 Testing/PluginTests/result/excel/(2)Sheet2_HeadersAndFooters.txt create mode 100644 Testing/PluginTests/result/excel/(2)Sheet2_Shapes.txt create mode 100644 Testing/PluginTests/result/excel/(3)Sheet3(1-1).png create mode 100644 Testing/PluginTests/result/excel/(3)Sheet3.tsv create mode 100644 Testing/PluginTests/result/excel/(3)Sheet3_HeadersAndFooters.txt create mode 100644 Testing/PluginTests/result/excel/(3)Sheet3_Shapes.txt create mode 100644 Testing/PluginTests/result/excel/(4)Sheet4(1-1).png create mode 100644 Testing/PluginTests/result/excel/(4)Sheet4.tsv create mode 100644 Testing/PluginTests/result/excel/(4)Sheet4_HeadersAndFooters.txt create mode 100644 Testing/PluginTests/result/excel/(4)Sheet4_Shapes.txt create mode 100644 Testing/PluginTests/result/excel/(5)Sheet5(1-1).png create mode 100644 Testing/PluginTests/result/excel/(5)Sheet5.tsv create mode 100644 Testing/PluginTests/result/excel/(5)Sheet5_HeadersAndFooters.txt create mode 100644 Testing/PluginTests/result/excel/(5)Sheet5_Shapes.txt create mode 100644 Testing/PluginTests/result/excel/(6)Sheet6(1-1).png create mode 100644 Testing/PluginTests/result/excel/(6)Sheet6.tsv create mode 100644 Testing/PluginTests/result/excel/(6)Sheet6_HeadersAndFooters.txt create mode 100644 Testing/PluginTests/result/excel/(6)Sheet6_Shapes.txt create mode 100644 Testing/PluginTests/result/excel/Sheet1.bas create mode 100644 Testing/PluginTests/result/excel/Sheet2.bas create mode 100644 Testing/PluginTests/result/excel/Sheet3.bas create mode 100644 Testing/PluginTests/result/excel/Sheet4.bas create mode 100644 Testing/PluginTests/result/excel/Sheet5.bas create mode 100644 Testing/PluginTests/result/excel/Sheet6.bas create mode 100644 Testing/PluginTests/result/excel/ThisWorkbook.bas create mode 100644 Testing/PluginTests/result/powerpnt.ppt.txt create mode 100644 Testing/PluginTests/result/powerpnt/CannotGetMacros.bas create mode 100644 Testing/PluginTests/result/powerpnt/Slide1.png create mode 100644 Testing/PluginTests/result/powerpnt/Slide1.txt create mode 100644 Testing/PluginTests/result/powerpnt/Slide1_NotesPage.txt create mode 100644 Testing/PluginTests/result/word.doc.txt create mode 100644 Testing/PluginTests/result/word/(0)Bookmarks.txt create mode 100644 Testing/PluginTests/result/word/CannotGetMacros.bas create mode 100644 Testing/PluginTests/result/word/Document.htm create mode 100644 Testing/PluginTests/result/word/Document.txt create mode 100644 Testing/PluginTests/result/word/Shapes.txt create mode 100644 Testing/PluginTests/result/word/ThisDocument.bas create mode 100644 Testing/SingleInstanceTest.cmd create mode 100644 crowdin.yml diff --git a/Plugins/dlls/CompareMSExcelFiles.sct b/Plugins/dlls/CompareMSExcelFiles.sct index 41c7b9e7040..5ea80586e48 100644 --- a/Plugins/dlls/CompareMSExcelFiles.sct +++ b/Plugins/dlls/CompareMSExcelFiles.sct @@ -62,7 +62,7 @@ var mergeApp; function isAccessibleVBAProject(wbk) { try { - return (wbk.VBProject.VBComponents.Count > 0); + return (wbk.VBProject.VBComponents.Count >= 0); } catch (e) { return false; } @@ -103,10 +103,10 @@ function quoteIfNeeded(str) { function writeCellValues(fo, sht) { var varCells = sht.UsedRange.Value; if (typeof(varCells) === "string" || typeof(varCells) === "number" || typeof(varCells) === "date") { - fo.WriteLine(quoteIfNeeded(varCells)); + fo.WriteLine(quoteIfNeeded(String(varCells))); } else if (varCells !== undefined) { - var ary = new Array(varCells.ubound(2)); try { + var ary = new Array(varCells.ubound(2)); for (var row = 1; row <= varCells.ubound(1); row++) { for (var col = 1; col <= varCells.ubound(2); col++) { try { @@ -118,7 +118,9 @@ function writeCellValues(fo, sht) { } fo.WriteLine(ary.join("\t")); } - } catch (e) {} + } catch (e) { + fo.WriteLine("Error" + e.number); + } } } @@ -140,13 +142,21 @@ function writeFormulas(fo, sht) { if (typeof(varCells) === "string" || typeof(varCells) === "number" || typeof(varCells) === "date") { fo.WriteLine(getAddr(rowOffset - 1, colOffset - 1) + ": " + varCells); } else { - for (var row = 1; row <= varCells.ubound(1); row++) { - for (var col = 1; col <= varCells.ubound(2); col++) { - var formula = varCells.getItem(row, col); - if (typeof(formula) === "string" && formula.charAt(0) === "=") { - fo.WriteLine(getAddr(row + rowOffset - 1, col + colOffset - 1) + ": " + formula); + try { + for (var row = 1; row <= varCells.ubound(1); row++) { + for (var col = 1; col <= varCells.ubound(2); col++) { + try { + var formula = varCells.getItem(row, col); + if (typeof(formula) === "string" && formula.charAt(0) === "=") { + fo.WriteLine(getAddr(row + rowOffset - 1, col + colOffset - 1) + ": " + formula); + } + } catch (e) { + fo.WriteLine(getAddr(row + rowOffset - 1, col + colOffset - 1) + ": " + "Error" + e.number); + } } } + } catch (e) { + fo.WriteLine(getAddr(rowOffset - 1, colOffset - 1) + ": " + "Error" + e.number); } } } @@ -170,10 +180,12 @@ function ungroupShapes(sht) { var cnt; do { cnt = sht.Shapes.Count; - for (var it = new Enumerator(sht.Shapes), shp = it.item(); !itShp.atEnd(); itShp.moveNext(), shp = it.item()) { - if (shp.Type == pbGroup) { - shp.Ungroup(); - } + for (var it = new Enumerator(sht.Shapes), shp = it.item(); !it.atEnd(); it.moveNext(), shp = it.item()) { + try { + if (shp.Type == pbGroup) { + shp.Ungroup(); + } + } catch (e) {} } } while (cnt !== sht.Shapes.Count); } catch (e) {} @@ -182,7 +194,9 @@ function ungroupShapes(sht) { function writeTextsInShapes(fo, sht) { try { for (var it = new Enumerator(sht.Shapes), shp = it.item(); !it.atEnd(); it.moveNext(), shp = it.item()) { - fo.WriteLine(shp.Name + ": " + shp.TextFrame.Characters.Text); + try { + fo.WriteLine(shp.Name + ": " + shp.TextFrame.Characters().Text); + } catch (e) {} } } catch (e) {} } @@ -456,13 +470,14 @@ function UnpackFile(fileSrc, fileDst, pbChanged, pSubcode) { if (regRead(REGKEY_PATH + "CompareVBAMacros", true)) { if (!isAccessibleVBAProject(wbk)) { fo.WriteLine(translate(MsgCannotGetMacros)); - } - for (var it = new Enumerator(wbk.VBProject.VBComponents), cmp = it.item(); !it.atEnd(); it.moveNext(), cmp = it.item()) { - fo.WriteLine("[CodeModule." + cmp.Name + "]"); - if (cmp.CodeModule.CountOfLines > 0) { - fo.WriteLine(cmp.CodeModule.Lines(1, cmp.CodeModule.CountOfLines)); + } else { + for (var it = new Enumerator(wbk.VBProject.VBComponents), cmp = it.item(); !it.atEnd(); it.moveNext(), cmp = it.item()) { + fo.WriteLine("[CodeModule." + cmp.Name + "]"); + if (cmp.CodeModule.CountOfLines > 0) { + fo.WriteLine(cmp.CodeModule.Lines(1, cmp.CodeModule.CountOfLines)); + } + fo.WriteLine(""); } - fo.WriteLine(""); } } sht = null; @@ -570,9 +585,10 @@ function UnpackFolder(fileSrc, folderDst, pbChanged, pSubcode) { var fo = fso.CreateTextFile(fso.BuildPath(folderDst, "CannotGetMacros.bas"), true, true); fo.WriteLine(translate(MsgCannotGetMacros)); fo.Close(); - } - for (var it = new Enumerator(wbk.VBProject.VBComponents), cmp = it.item(); !it.atEnd(); it.moveNext(), cmp = it.item()) { - cmp.Export(fso.BuildPath(folderDst, cmp.Name + getModuleExtension(cmp))); + } else { + for (var it = new Enumerator(wbk.VBProject.VBComponents), cmp = it.item(); !it.atEnd(); it.moveNext(), cmp = it.item()) { + cmp.Export(fso.BuildPath(folderDst, cmp.Name + getModuleExtension(cmp))); + } } } sht = null; @@ -828,33 +844,35 @@ function importSettingsFromXMLFile(filepath) { } function onlyNumeric() { - var k = event.keyCode; + var ev = event; + var k = ev.keyCode; - if (event.shiftKey) { + if (ev.shiftKey) { if (k == 37 || k == 39) { return true; } - } else if (event.altKey) { + } else if (ev.altKey) { return true; - } else if (event.ctrlKey) { + } else if (ev.ctrlKey) { return true; } else if (k == 8 || k == 9 || k == 37 || k == 39 || k == 46 /* || k == 144 */ || (48 <= k && k <= 57) || (96 <= k && k <= 105)) { return true; } - event.returnValue = false; + ev.returnValue = false; return false; } function onPaste() { - var paste = (event.clipboardData || window.clipboardData).getData("text"); + var ev = event; + var paste = (ev.clipboardData || window.clipboardData).getData("text"); if (!paste.match(/^[0-9]{0,4}$/)) { paste = ""; - if (event.preventDefault) { - event.preventDefault(); + if (ev.preventDefault) { + ev.preventDefault(); } - event.returnValue = false; + ev.returnValue = false; return false; } else { return true; diff --git a/Plugins/dlls/CompareMSPowerPointFiles.sct b/Plugins/dlls/CompareMSPowerPointFiles.sct index 2cdbf83a49e..adb57ce7195 100644 --- a/Plugins/dlls/CompareMSPowerPointFiles.sct +++ b/Plugins/dlls/CompareMSPowerPointFiles.sct @@ -58,7 +58,7 @@ var mergeApp; function isAccessibleVBAProject(wbk) { try { - return (wbk.VBProject.VBComponents.Count > 0); + return (wbk.VBProject.VBComponents.Count >= 0); } catch (e) { return false; } @@ -97,7 +97,7 @@ function writeShape(fo, shp) { writeShape(fo, shp2); } } else if (shp.HasTextFrame) { - fo.WriteLine(shp.TextFrame.TextRange.Characters.Text); + fo.WriteLine(shp.TextFrame.TextRange.Characters().Text); } else { fo.WriteLine(""); } @@ -189,13 +189,14 @@ function UnpackFile(fileSrc, fileDst, pbChanged, pSubcode) { if (regRead(REGKEY_PATH + "CompareVBAMacros", true)) { if (!isAccessibleVBAProject(prs)) { fo.WriteLine(translate(MsgCannotGetMacros)); - } - for (var it = new Enumerator(prs.VBProject.VBComponents), cmp = it.item(); !it.atEnd(); it.moveNext(), cmp = it.item()) { - fo.WriteLine("[CodeModule." + cmp.Name + "]"); - if (cmp.CodeModule.CountOfLines > 0) { - fo.WriteLine(cmp.CodeModule.Lines(1, cmp.CodeModule.CountOfLines)); + } else { + for (var it = new Enumerator(prs.VBProject.VBComponents), cmp = it.item(); !it.atEnd(); it.moveNext(), cmp = it.item()) { + fo.WriteLine("[CodeModule." + cmp.Name + "]"); + if (cmp.CodeModule.CountOfLines > 0) { + fo.WriteLine(cmp.CodeModule.Lines(1, cmp.CodeModule.CountOfLines)); + } + fo.WriteLine(""); } - fo.WriteLine(""); } } @@ -269,9 +270,10 @@ function UnpackFolder(fileSrc, folderDst, pbChanged, pSubcode) { var fo = fso.CreateTextFile(fso.BuildPath(folderDst, "CannotGetMacros.bas"), true, true); fo.WriteLine(translate(MsgCannotGetMacros)); fo.Close(); - } - for (var it = new Enumerator(prs.VBProject.VBComponents), cmp = it.item(); !it.atEnd(); it.moveNext(), cmp = it.item()) { - cmp.Export(fso.BuildPath(folderDst, cmp.Name + getModuleExtension(cmp))); + } else { + for (var it = new Enumerator(prs.VBProject.VBComponents), cmp = it.item(); !it.atEnd(); it.moveNext(), cmp = it.item()) { + cmp.Export(fso.BuildPath(folderDst, cmp.Name + getModuleExtension(cmp))); + } } } @@ -467,7 +469,6 @@ function importSettingsFromXMLFile(filepath) { } } - function chkUnpackToFolder_onclick() { if (!chkUnpackToFolder.checked) chkCompareSlideAsImage.checked = false; diff --git a/Plugins/dlls/CompareMSVisioFiles.sct b/Plugins/dlls/CompareMSVisioFiles.sct index 3d4c008a081..12d2a6b85a1 100644 --- a/Plugins/dlls/CompareMSVisioFiles.sct +++ b/Plugins/dlls/CompareMSVisioFiles.sct @@ -59,7 +59,7 @@ var mergeApp; function isAccessibleVBAProject(doc) { try { - return (doc.VBProject.VBComponents.Count > 0); + return (doc.VBProject.VBComponents.Count >= 0); } catch (e) { return false; } @@ -86,8 +86,10 @@ function ungroupShapes(pge) { var cnt; do { cnt = pge.Shapes.Count; - for (var it = new Enumerator(pge.Shapes), shp = it.item(); !itShp.atEnd(); itShp.moveNext(), shp = it.item()) { - shp.Ungroup(); + for (var it = new Enumerator(pge.Shapes), shp = it.item(); !it.atEnd(); it.moveNext(), shp = it.item()) { + try { + shp.Ungroup(); + } catch (e) {} } } while (cnt !== pge.Shapes.Count); } catch (e) {} @@ -96,7 +98,9 @@ function ungroupShapes(pge) { function writeTextsInShapes(fo, pge) { try { for (var it = new Enumerator(pge.Shapes), shp = it.item(); !it.atEnd(); it.moveNext(), shp = it.item()) { - fo.WriteLine(shp.Name + ": " + shp.Text); + try { + fo.WriteLine(shp.Name + ": " + shp.Text); + } catch (e) {} } } catch (e) {} } @@ -168,13 +172,14 @@ function UnpackFile(fileSrc, fileDst, pbChanged, pSubcode) { if (regRead(REGKEY_PATH + "CompareVBAMacros", true)) { if (!isAccessibleVBAProject(doc)) { fo.WriteLine(translate(MsgCannotGetMacros)); - } - for (var it = new Enumerator(doc.VBProject.VBComponents), cmp = it.item(); !it.atEnd(); it.moveNext(), cmp = it.item()) { - fo.WriteLine("[CodeModule." + cmp.Name + "]"); - if (cmp.CodeModule.CountOfLines > 0) { - fo.WriteLine(cmp.CodeModule.Lines(1, cmp.CodeModule.CountOfLines)); + } else { + for (var it = new Enumerator(doc.VBProject.VBComponents), cmp = it.item(); !it.atEnd(); it.moveNext(), cmp = it.item()) { + fo.WriteLine("[CodeModule." + cmp.Name + "]"); + if (cmp.CodeModule.CountOfLines > 0) { + fo.WriteLine(cmp.CodeModule.Lines(1, cmp.CodeModule.CountOfLines)); + } + fo.WriteLine(""); } - fo.WriteLine(""); } } @@ -237,9 +242,10 @@ function UnpackFolder(fileSrc, folderDst, pbChanged, pSubcode) { var fo = fso.CreateTextFile(fso.BuildPath(folderDst, "CannotGetMacros.bas"), true, true); fo.WriteLine(translate(MsgCannotGetMacros)); fo.Close(); - } - for (var it = new Enumerator(doc.VBProject.VBComponents), cmp = it.item(); !it.atEnd(); it.moveNext(), cmp = it.item()) { - cmp.Export(fso.BuildPath(folderDst, cmp.Name + getModuleExtension(cmp))); + } else { + for (var it = new Enumerator(doc.VBProject.VBComponents), cmp = it.item(); !it.atEnd(); it.moveNext(), cmp = it.item()) { + cmp.Export(fso.BuildPath(folderDst, cmp.Name + getModuleExtension(cmp))); + } } } diff --git a/Plugins/dlls/CompareMSWordFiles.sct b/Plugins/dlls/CompareMSWordFiles.sct index c8716f41b92..a1843825eba 100644 --- a/Plugins/dlls/CompareMSWordFiles.sct +++ b/Plugins/dlls/CompareMSWordFiles.sct @@ -59,7 +59,7 @@ var mergeApp; function isAccessibleVBAProject(doc) { try { - return (doc.VBProject.VBComponents.Count > 0); + return (doc.VBProject.VBComponents.Count >= 0); } catch (e) { return false; } @@ -94,10 +94,12 @@ function ungroupShapes(sht) { var cnt; do { cnt = sht.Shapes.Count; - for (var it = new Enumerator(doc.Shapes), shp = it.item(); !itShp.atEnd(); itShp.moveNext(), shp = it.item()) { - if (shp.Type == pbGroup) { - shp.Ungroup(); - } + for (var it = new Enumerator(doc.Shapes), shp = it.item(); !it.atEnd(); it.moveNext(), shp = it.item()) { + try { + if (shp.Type == pbGroup) { + shp.Ungroup(); + } + } catch (e) {} } } while (cnt !== doc.Shapes.Count); } catch (e) {} @@ -106,7 +108,9 @@ function ungroupShapes(sht) { function writeTextsInShapes(fo, doc) { try { for (var it = new Enumerator(doc.Shapes), shp = it.item(); !it.atEnd(); it.moveNext(), shp = it.item()) { - fo.WriteLine(shp.Name + ": " + shp.TextFrame.TextRange.Text); + try { + fo.WriteLine(shp.Name + ": " + shp.TextFrame.TextRange.Text); + } catch (e) {} } } catch (e) {} } @@ -159,7 +163,7 @@ function UnpackFile(fileSrc, fileDst, pbChanged, pSubcode) { throw new Error(30001, "CompareMSWordFiles.sct: " + fileSrc + ": Target file '" + fileSrc2 + "' not found"); } } - var doc = wd.Documents.Open(fileSrc2); + var doc = wd.Documents.Open(fileSrc2, true, true); if (regRead(REGKEY_PATH + "CompareDocumentProperties", false)) { fo.WriteLine("[Document Properties]"); @@ -189,13 +193,14 @@ function UnpackFile(fileSrc, fileDst, pbChanged, pSubcode) { if (regRead(REGKEY_PATH + "CompareVBAMacros", true)) { if (!isAccessibleVBAProject(doc)) { fo.WriteLine(translate(MsgCannotGetMacros)); - } - for (var it = new Enumerator(doc.VBProject.VBComponents), cmp = it.item(); !it.atEnd(); it.moveNext(), cmp = it.item()) { - fo.WriteLine("[CodeModule." + cmp.Name + "]"); - if (cmp.CodeModule.CountOfLines > 0) { - fo.WriteLine(cmp.CodeModule.Lines(1, cmp.CodeModule.CountOfLines)); + } else { + for (var it = new Enumerator(doc.VBProject.VBComponents), cmp = it.item(); !it.atEnd(); it.moveNext(), cmp = it.item()) { + fo.WriteLine("[CodeModule." + cmp.Name + "]"); + if (cmp.CodeModule.CountOfLines > 0) { + fo.WriteLine(cmp.CodeModule.Lines(1, cmp.CodeModule.CountOfLines)); + } + fo.WriteLine(""); } - fo.WriteLine(""); } } @@ -274,9 +279,10 @@ function UnpackFolder(fileSrc, folderDst, pbChanged, pSubcode) { var fo = fso.CreateTextFile(fso.BuildPath(folderDst, "CannotGetMacros.bas"), true, true); fo.WriteLine(translate(MsgCannotGetMacros)); fo.Close(); - } - for (var it = new Enumerator(doc.VBProject.VBComponents), cmp = it.item(); !it.atEnd(); it.moveNext(), cmp = it.item()) { - cmp.Export(fso.BuildPath(folderDst, cmp.Name + getModuleExtension(cmp))); + } else { + for (var it = new Enumerator(doc.VBProject.VBComponents), cmp = it.item(); !it.atEnd(); it.moveNext(), cmp = it.item()) { + cmp.Export(fso.BuildPath(folderDst, cmp.Name + getModuleExtension(cmp))); + } } } diff --git a/Src/7zcommon.patch b/Src/7zcommon.patch new file mode 100644 index 00000000000..c05f96ec724 --- /dev/null +++ b/Src/7zcommon.patch @@ -0,0 +1,102 @@ +--- c:/dev/winmerge/src/7zCommon.cpp Mon Mar 6 00:06:40 2023 ++++ d:/dev/winmerge/src/7zCommon.cpp Tue Feb 14 23:00:32 2023 +@@ -151,17 +151,17 @@ + return nullptr; + String path2(path); + // Map extensions through ExternalArchiveFormat.ini +- static tchar_t null[] = _T(""); +- static const tchar_t section[] = _T("extensions"); ++ static TCHAR null[] = _T(""); ++ static const TCHAR section[] = _T("extensions"); + String entry = paths::FindExtension(path); +- tchar_t value[20]; +- static const tchar_t* filename = nullptr; ++ TCHAR value[20]; ++ static LPCTSTR filename = nullptr; + if (filename == nullptr) + { +- tchar_t cPath[INTERNET_MAX_PATH_LENGTH]; ++ TCHAR cPath[INTERNET_MAX_PATH_LENGTH]; + DWORD cchPath = SearchPath(nullptr, _T("ExternalArchiveFormat.ini"), nullptr, + INTERNET_MAX_PATH_LENGTH, cPath, nullptr); +- filename = cchPath && cchPath < INTERNET_MAX_PATH_LENGTH ? tc::tcsdup(cPath) : null; ++ filename = cchPath && cchPath < INTERNET_MAX_PATH_LENGTH ? _tcsdup(cPath) : null; + } + if (*filename && + GetPrivateProfileString(section, entry.c_str(), null, value, 20, filename) && +@@ -169,7 +169,7 @@ + { + // Remove end-of-line comments (in string returned from GetPrivateProfileString) + // that is, remove semicolon & whatever follows it +- if (tchar_t* p = StrChr(value, ';')) ++ if (LPTSTR p = StrChr(value, ';')) + { + *p = '\0'; + StrTrim(value, _T(" \t")); +@@ -318,7 +318,7 @@ + /** + * @brief SingleFileEnumerator constructor. + */ +-SingleItemEnumerator::SingleItemEnumerator(const tchar_t* path, const tchar_t* FullPath, const tchar_t* Name) ++SingleItemEnumerator::SingleItemEnumerator(LPCTSTR path, LPCTSTR FullPath, LPCTSTR Name) + : FullPath(FullPath) + , Name(Name) + { +@@ -408,20 +408,9 @@ + while ((m_nIndex = pView(m_pView)->GetNextItem(m_nIndex, m_nFlags & nMask)) == -1) + { + m_strFolderPrefix = *m_curFolderPrefix++; +- m_index++; ++ m_index = 1; + } +- const auto& di = m_pView->GetDiffItem(m_nIndex); +- // If the current item is a folder, ignore the current item if the next selected item is a child element of that folder. +- if (m_index > (((di.diffcode.diffcode & DIFFCODE::THREEWAY) == 0) ? 1 : 2) || !di.diffcode.isDirectory()) +- return di; +- const int nextIndex = pView(m_pView)->GetNextItem(m_nIndex, m_nFlags & nMask); +- if (nextIndex == -1) +- return di; +- const auto& diNext = m_pView->GetDiffItem(nextIndex); +- const String curRelPath = strutils::makelower(di.diffFileInfo[m_index].GetFile()); +- if (strutils::makelower(diNext.diffFileInfo[m_index].GetFile()).find(curRelPath) != 0) +- return di; +- return *DIFFITEM::GetEmptyItem(); ++ return m_pView->GetDiffItem(m_nIndex); + } + + /** +@@ -443,7 +432,7 @@ + const CDiffContext& ctxt = m_pView->GetDiffContext(); + const DIFFITEM &di = Next(); + +- if (di.isEmpty() || ((m_nFlags & DiffsOnly) && !IsItemNavigableDiff(ctxt, di))) ++ if ((m_nFlags & DiffsOnly) && !IsItemNavigableDiff(ctxt, di)) + { + return 0; + } +@@ -505,7 +494,7 @@ + /** + * @brief Apply appropriate handlers from left to right. + */ +-bool DirItemEnumerator::MultiStepCompressArchive(const tchar_t* path) ++bool DirItemEnumerator::MultiStepCompressArchive(LPCTSTR path) + { + DeleteFile(path); + Merge7z::Format *piHandler = ArchiveGuessFormat(path); +@@ -536,14 +525,14 @@ + /** + * @brief Generate archive from DirView items. + */ +-void DirItemEnumerator::CompressArchive(const tchar_t* path) ++void DirItemEnumerator::CompressArchive(LPCTSTR path) + { + String strPath; + if (path == nullptr) + { + // 7z311 can only write 7z, zip, and tar(.gz|.bz2) archives, so don't + // offer other formats here! +- static const tchar_t _T_Filter[] ++ static const TCHAR _T_Filter[] + ( + _T("7z|*.7z|") + //_T("z|*.z|") diff --git a/Src/MergeAppLib.h b/Src/MergeAppLib.h index c89c05a6ac5..e51f49aa90b 100644 --- a/Src/MergeAppLib.h +++ b/Src/MergeAppLib.h @@ -7,8 +7,8 @@ /* at Tue Jan 19 12:14:07 2038 */ /* Compiler settings for MergeAppLib.idl: - Oicf, W1, Zp8, env=Win64 (32b run), target_arch=AMD64 8.01.0628 - protocol : all , ms_ext, c_ext, robust + Oicf, W1, Zp8, env=Win32 (32b run), target_arch=X86 8.01.0628 + protocol : dce , ms_ext, c_ext, robust error checks: allocation ref bounds_check enum stub_data VC __declspec() decoration level: __declspec(uuid()), __declspec(selectany), __declspec(novtable) diff --git a/Testing/Data/Office/excel.xls b/Testing/Data/Office/excel.xls index 7b9ce65907a1361d9ef2a47386f7669442a0fda1..262ff98426c6d401aafb0402a7b2d30c039524c4 100644 GIT binary patch delta 5992 zcmb_gcUV(Nw4WQ&2rU$8p@gCY5D0`WUI_`bHAB6^P8D7=gi!5&ppGN!0`%&Hd!HdN344g zgo6@rW9S4=hTsYS@I}S)X#_V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I<5Des!6%Iiu!c3@%RX*~{OJK7RAlgkJXQk4M>D^szq|#l-n=si#FzY_)n0gv2)9 zrBTn=ppeYp8ilgv2dzpZtTpd)17D%>Xe3vYbz_)2a^hmbg92C>AX9@xBNPFPB5Xhr z+;FHkh=j+A@uS2H%rs=2aX=7dW6X~tNC3zno)s8_j|?(FNyh^gK=wTbM1mloDg;7- zikT1KQ}+fNQ>j!cjjHp6PSpf>G@1zrC}9W^qf&MBb}Q3>7FC(5%rx`{Tf?FQW0K;% zfy>T#R!|h3R#A&$qrCZoXj-gDB=K~xvs5%sV8ygX`LV)cq5%~^<{6d_!NFkxdn_F+ zKrjb{fq-<&<3b$Kd=8XmNwcuh2NqNvrlu~#3YcqZQ?(hI3~LKZU5=%>Iftnu#KF+^ zTXKp*;{2k3qE%RAP`o!&F(xW1CK`>kM<$D7$Hd13vlNlH2Yzuuf!+?l%4!qSQd`d( z*t=m{3w5W<`2miF2igscCaqfO`I}!asBI$i-3m~4(N4YJXUgHWv z!{WEb#6|d<#l%Ex1X3JvS98wUFc1&6wtB=lf(YQ>3dOWSGOO+j(E0^rTg76K_fZcS zkTxTk&Vl6_CBZb%KE+0}Kc-Ff0YK8G-oU|Ns9%!XP%&#z1K%c83`U4(|`Y)m+T9y_kuy G*B1c67Z7Lw delta 140 zcmZozz}m2bb%KH7at0_6U|?7cWHJKrzyJULgG5&X@rsRs(oF0E0?rrKW!-EpX4+oN z#MtXQi7AKuz}Jrb8?$b1E@tXwoWwRo1gHrNRsnVW1+qYR^8~gOMqU=62rCea1M&aO Wk}UF!jB6%avL0W=$F$6ckp%!9moj$% diff --git a/Testing/Data/Office/~$word.doc b/Testing/Data/Office/~$word.doc new file mode 100644 index 0000000000000000000000000000000000000000..58d84eee0a34ba3295ea44b87f126a16ad8653d6 GIT binary patch literal 162 zcmd<+b({6@LD-}=22ubELu~Z>h$Z>Dehdu%>lqk6$W55Sz{J2H(0i357HE(Z)Uc+9 j&U--eFaT7-08+;w026`GS3`oh6E`EoVEXU*d+Y%KiZd3n literal 0 HcmV?d00001 diff --git a/Testing/PluginTests/PluginTests.js b/Testing/PluginTests/PluginTests.js index 52a40b34913..ffb2bfaacd8 100644 --- a/Testing/PluginTests/PluginTests.js +++ b/Testing/PluginTests/PluginTests.js @@ -3,9 +3,34 @@ var g_testname; var FileSys = new ActiveXObject("Scripting.FileSystemObject"); var ScriptFolder = FileSys.GetParentFolderName(WScript.ScriptFullName); +var WShell = new ActiveXObject("Wscript.Shell"); +var ScriptFolder = FileSys.GetParentFolderName(WScript.ScriptFullName); + +try { + FileSys.CreateFolder(ScriptFolder + "\\result"); + FileSys.CreateFolder(ScriptFolder + "\\result\\excel"); + FileSys.CreateFolder(ScriptFolder + "\\result\\word"); + FileSys.CreateFolder(ScriptFolder + "\\result\\powerpnt"); +} catch (e) { } var MergeApp = { - "Log": function (level, text) { WScript.Echo(text); } + "GetOption": function (key, defvalue) { + try { + return WShell.RegRead("HKCU\\Software\\Thingamahoochie\\WinMerge\\" + key); + } catch (e) { + return defvalue; + } + }, + "SaveOption": function (key, value) { + var t = typeof value === "string" ? "REG_SZ" : "REG_DWORD"; + WShell.RegWrite("HKCU\\Software\\Thingamahoochie\\WinMerge\\" + key, value, t); + }, + "Translate": function (text) { + return text; + }, + "Log": function (level, text) { + WScript.Echo(text); + } }; function setTestName(testname) { g_cnt = 0; @@ -26,12 +51,13 @@ function assertTrue(value) { function assertEquals(expected, actual) { g_cnt++; if (expected !== actual) { - throw new Error(30001, getCurrentTestName() + "\r\nexpected: \"" + expected + "\"\r\nactual: \"" + actual + "\""); + var msg = getCurrentTestName() + "\r\nexpected: \"" + expected + "\"\r\nactual: \"" + actual + "\""; + WScript.Echo(msg); + throw new Error(30001, msg); } } -function CompareMSExcelFilesTest() { - var p = GetObject("script: " + ScriptFolder + "\\..\\..\\Plugins\\dlls\\CompareMSExcelFiles.sct"); +function printPluginInfo(p) { WScript.Echo("PluginDescription: " + p.PluginDescription); WScript.Echo("PluginEvent : " + p.PluginEvent); WScript.Echo("PluginFileFilters: " + p.PluginFileFilters); @@ -40,10 +66,39 @@ function CompareMSExcelFilesTest() { WScript.Echo("PluginUnpackedFileExtension: " + p.PluginUnpackedFileExtension); } catch (e) { } +} + +function CompareMSExcelFilesTest() { + var p = GetObject("script: " + ScriptFolder + "\\..\\..\\Plugins\\dlls\\CompareMSExcelFiles.sct"); + printPluginInfo(p); + var changed = false; + var subcode = 0; + p.PluginOnEvent(0, MergeApp); + p.UnpackFile(ScriptFolder + "\\..\\Data\\Office\\excel.xls", ScriptFolder + "\\result\\excel.xls.txt", changed, subcode); + p.UnpackFolder(ScriptFolder + "\\..\\Data\\Office\\excel.xls", ScriptFolder + "\\result\\excel\\", changed, subcode); + p.PluginOnEvent(1, MergeApp); +} +function CompareMSWordFilesTest() { + var p = GetObject("script: " + ScriptFolder + "\\..\\..\\Plugins\\dlls\\CompareMSWordFiles.sct"); + printPluginInfo(p); var changed = false; var subcode = 0; - p.UnpackFile(ScriptFolder + "\\..\\Data\\Office\\excel.xls", ScriptFolder + "\\result.txt", changed, subcode); + p.PluginOnEvent(0, MergeApp); + p.UnpackFile(ScriptFolder + "\\..\\Data\\Office\\word.doc", ScriptFolder + "\\result\\word.doc.txt", changed, subcode); + p.UnpackFolder(ScriptFolder + "\\..\\Data\\Office\\word.doc", ScriptFolder + "\\result\\word\\", changed, subcode); + p.PluginOnEvent(1, MergeApp); +} + +function CompareMSPowerPointFilesTest() { + var p = GetObject("script: " + ScriptFolder + "\\..\\..\\Plugins\\dlls\\CompareMSPowerPointFiles.sct"); + printPluginInfo(p); + var changed = false; + var subcode = 0; + p.PluginOnEvent(0, MergeApp); + p.UnpackFile(ScriptFolder + "\\..\\Data\\Office\\powerpnt.ppt", ScriptFolder + "\\result\\powerpnt.ppt.txt", changed, subcode); + p.UnpackFolder(ScriptFolder + "\\..\\Data\\Office\\powerpnt.ppt", ScriptFolder + "\\result\\powerpnt\\", changed, subcode); + p.PluginOnEvent(1, MergeApp); } function EditorAddinTest() { @@ -246,5 +301,7 @@ function EditorAddinTest() { } EditorAddinTest(); -//CompareMSExcelFilesTest +CompareMSExcelFilesTest(); +CompareMSWordFilesTest(); +CompareMSPowerPointFilesTest(); diff --git a/Testing/PluginTests/result/excel.xls.txt b/Testing/PluginTests/result/excel.xls.txt new file mode 100644 index 0000000000000000000000000000000000000000..5e7f86224a53100e741dc9d49eeb7aa39a679e07 GIT binary patch literal 2740 zcmd^B%T59@6g^u^{D%n(qA?N}9zk}9pbIfXG%kpXL0$$01DN=0{($kT)N|Volv3lw zrDoEZ_V(P<+tc1@KR>#-K!isOu)r;Lv7<^C9gJxkV2Ql3N9f@WDL!fSES1mFw8R?G zTQEE5vu{X?@QFvt)ZTKhx%XV$j%e?(2y0&<2CSv%nZii5`>L(Ig=;getco(ilZr$~ zf5rL>qdvxr-+<9q`IgyeTwd|IsL(-$LooU@mb_)yE#T zHlrPpAwULgg^kCxW0G-)R*derE_R!B9f6C@;6#lpoc10F&EC}Ov)$|4AwHC?$#3*_ z=W6qbF4DiAov-&hMO|iBnN4P2uOMvA3P!Vm`;PpQ`l^aE&Ww+yQMz${rx(H)Qt9TDa>`Or*G={*&URRc2?YoKLq>BHaY_pL8o5 z-5NYOhCLBr*?9FO2+qj2Y6sT%e)@*lw9CO zDLdgmK+fce(Om24_uRfub;v6JkoX?8hkdor1KQ+iah%cW9+QT?JLx-BL){4EULzdq e?D%Qy_`FOOX?#*7L&yKfWav1*lcD2XE$A;}c%dx- literal 0 HcmV?d00001 diff --git a/Testing/PluginTests/result/excel/(0)Names.txt b/Testing/PluginTests/result/excel/(0)Names.txt new file mode 100644 index 00000000000..46b134b197f --- /dev/null +++ b/Testing/PluginTests/result/excel/(0)Names.txt @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/Testing/PluginTests/result/excel/(1)Sheet1(1-1).png b/Testing/PluginTests/result/excel/(1)Sheet1(1-1).png new file mode 100644 index 0000000000000000000000000000000000000000..c279f471f1d1c70240ea7113da62ac999634ce0b GIT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JCle9_bvA>UDB80Ge;v^OiEiqORt?$=}R81OPpe-&{AZ(H7` zx5Q^vXPw{sQe|!5oG4`?chN?O{Oh~bmh9I=YR8uFou;E4lx$vo zL!rS01Lgk0f0g@xcNy$3gtM3rQ~PH4UwyP$DaYt7Zw`A;(!~YQ34s=LjrS~I^S^Z? zi4){cK(10hhi1PqzR|n&)i}FDf!H|~gk=I^BHU}wQ|^CyFyDYS0AfTbwqQErs%VsW z&kWFNE-=J)xLqg~qAFhw|E5ZwyYe>1dN7l;G-3Saa;t6QSkfAEE`|fR&Wr#y(ci$7 z?P0L)uvJ1S-TQpQl+$Pz*^ddn`7G1(wbeV?j<#0lyk0aiN4_+Nw(eVv3;W;B<{LC0 zg`NH3pSL$69q^I0yI&NuM4HDyj07J=)FYXe_zNel+` zQ2L)F3F!3M#LcGU8$*M_g&b`};AyJmWlRELdSkMm_)S#ODJ<|u*80E4pMIka_xueP*PkFLP`VtE2HqR8uR#oP+P}-Xsz0XqrRzCk0n69tmHsLSJbm-~m@YU7TMF@a~ zLvK{>pP69D?+^m7VF%;G<%z`!PHNz~1<;T3u@g?WHDCwC(PAN@mhcUei=jrF*HrUW zdhD|H4h|qKvdDp&$gf|&UMeV{$Hm3H0F*jU0iXvf$3rS04NFixilhL!;NRVY|B{R& uzTOsVmzZB-BK`Fza}usyqSJHxU@c7jE=6(L0O*nYL|#Vab-9#j;Qs(!$jx^E literal 0 HcmV?d00001 diff --git a/Testing/PluginTests/result/excel/(1)Sheet1.tsv b/Testing/PluginTests/result/excel/(1)Sheet1.tsv new file mode 100644 index 0000000000000000000000000000000000000000..2be88251fe7734bb778513fd38fb98b9fb39e46c GIT binary patch literal 130 zcmezWFOeaMA(?>_2$jIFgdvron4tv91BoUwaDmluF{A+H(tskoKoO7*PAKb`!A^q{ h1~7giP&^5UL8hjFRipx0oIstN4C!Eg3YZVk4FJbL4}bsw literal 0 HcmV?d00001 diff --git a/Testing/PluginTests/result/excel/(1)Sheet1_HeadersAndFooters.txt b/Testing/PluginTests/result/excel/(1)Sheet1_HeadersAndFooters.txt new file mode 100644 index 0000000000000000000000000000000000000000..aabbcdaf14eaa515f27c0521e0deb8a30734a51f GIT binary patch literal 242 zcmezW&xawEA&sGg!2?JqGNb^>A_gl41%?bHJ}(0ogENqy2UG`=M^~%H;Kl$_6U30o zkPg&|X<7i#>~x@B1qL;S0I*t^y>1NoKnO7xWN#W0AKhMbwV0+NT!5}tjll(MF94Jv BD3kyI literal 0 HcmV?d00001 diff --git a/Testing/PluginTests/result/excel/(1)Sheet1_Shapes.txt b/Testing/PluginTests/result/excel/(1)Sheet1_Shapes.txt new file mode 100644 index 0000000000000000000000000000000000000000..a71a5af2aa7e7b4bdab084e51c8c656bfb281091 GIT binary patch literal 180 zcmezWFN7hLp@N}=!HFRsNGmWHGFSo0V1^8aM1}&OoFM}*0~Z6jDkC&iMnKgH4DJj? jKvPPA`mpOV#?Y07MVANA)Nn{1`Jpz0}T>t<7zjyE6_wV1YTepszoBP6r3)7}e14`bxbEl!9p}4qMSXlV# z)vMat+UL%l`~Ca3hK9!Z^XJvn)Kpbf|NZ-SlBSEK+1%{^TlLoEE0C0L!=4U8NmMVQ>m_%ynW4jl7S zZMN9CB1M3?+2AVAqh=!w*2QdsY*&ohUo|u`GAK7OD)?ls?f@FW;OXk;vd$@?2>{SP BaGU@D literal 0 HcmV?d00001 diff --git a/Testing/PluginTests/result/excel/(2)Sheet2.tsv b/Testing/PluginTests/result/excel/(2)Sheet2.tsv new file mode 100644 index 0000000000000000000000000000000000000000..ca9053508c38ce794241a50d536ce683f2f662f4 GIT binary patch literal 8 PcmezW&yazafr|kE5MTmE literal 0 HcmV?d00001 diff --git a/Testing/PluginTests/result/excel/(2)Sheet2_HeadersAndFooters.txt b/Testing/PluginTests/result/excel/(2)Sheet2_HeadersAndFooters.txt new file mode 100644 index 0000000000000000000000000000000000000000..fd9e062162f0e802be6cb4d09e1f785ce6505003 GIT binary patch literal 182 zcmezW&xawEA&sGg!2?JqGNb^>A_gl41qNOQE(T{HFApdO62m4R#E{95&X9paH_T)= ThI}A|n1an@Z1M<`vB?4e!UrCp literal 0 HcmV?d00001 diff --git a/Testing/PluginTests/result/excel/(2)Sheet2_Shapes.txt b/Testing/PluginTests/result/excel/(2)Sheet2_Shapes.txt new file mode 100644 index 00000000000..46b134b197f --- /dev/null +++ b/Testing/PluginTests/result/excel/(2)Sheet2_Shapes.txt @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/Testing/PluginTests/result/excel/(3)Sheet3(1-1).png b/Testing/PluginTests/result/excel/(3)Sheet3(1-1).png new file mode 100644 index 0000000000000000000000000000000000000000..86595a359f5d8729ab91ab1db751503cbf405014 GIT binary patch literal 430 zcmeAS@N?(olHy`uVBq!ia0vp^9zZO_!3-qNt7SX^QjEnx?oJHr&dIz4a#+$GeH|GX zHuiJ>Nn{1`rv>kD|L@(;IN@ZrPc$&!si|GMbV*iL z_V@4KPo6wcQc^l}=#ad;{Oi}RtE#GI&Yb!5>C?u>#@^muX=&+~FJHcY|2`xn1Zc3g zx3{04pN)+TGc$8_b@ko5ce%K@7A;ydd-m*Evu4ekH?Os|_1?XE3JMBWuUw@CM9y57fl}%x9FJ;wd=cN^-DBPA_gl41qNOQE(T{HFApdO62m4R#E{95&X9paH_T)= ThI}A|n1an@Z1M<`vB?4e!UrCp literal 0 HcmV?d00001 diff --git a/Testing/PluginTests/result/excel/(3)Sheet3_Shapes.txt b/Testing/PluginTests/result/excel/(3)Sheet3_Shapes.txt new file mode 100644 index 00000000000..46b134b197f --- /dev/null +++ b/Testing/PluginTests/result/excel/(3)Sheet3_Shapes.txt @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/Testing/PluginTests/result/excel/(4)Sheet4(1-1).png b/Testing/PluginTests/result/excel/(4)Sheet4(1-1).png new file mode 100644 index 0000000000000000000000000000000000000000..fa9064d5df2da6fa16e9708803ae810f815c22f6 GIT binary patch literal 1151 zcmeAS@N?(olHy`uVBq!ia0vp^K0qwQ!3-piojoxRNHG=%xjQkeJ16rJ$YDu$^mSxl z*x1kgCy^B>_bI?9#P$FG|F2)a-oJnU)vH&}pFjWi@84OoW^LKB<-vmoRaI4GWo1vF zK3%b5#gQXN5)u+-&YXGp@Zk?1K5XB<{nxKw|Ni~kv17;DwQIkA{rdg;_lAZBKR>^y zsHjbwHZ5GZP)kc|_UzeQTwL+-@hK@O2M!#ltgO6z`Ep4~$@AyWSFT(c78cgm*Z1PZ z3l(%ciEL^78Uy$Bro}Dc!tzbHaoPlO|0H4h}we@L*O}*6P)(_w3md z6BDy_>sBu>ugJ*A6DLlzwzd`*7vH&aM_E~U*|KG6X=x%NBD}o33JMBKmMl?MS6{GT zL1AH`o10rfL4miocVlCtrKP2jkoqksw{6?T&(DAH;zd(a(`V0~B_<}$n>Q~m zE^hkt>4JiSJ9qB%@bH*Ab*hz>)$QB2+uGVnOG_U;dQ@LuudS_p?b@|DbLN~ocW&v@ zr57$-m^*jwx^?SfV`C#CA}(FJR9jn{ot@p%(xRcE@#M*qprD{tt5&I~sC0C6czSwf zW@b*FJUKc#+TGp#8vy|UU0q$~=H{K9o$2Z6p`oF!z54q4-@bkO@#Dv# zLxN#t*Eo5`$yT@LtOI$G(v=YLo9_n& ubnh;|cYk$@?ydHA_gl41qNOQE(T{HFApdO62m4R#E{95&X9paH_T)= ThI}A|n1an@Z1M<`vB?4e!UrCp literal 0 HcmV?d00001 diff --git a/Testing/PluginTests/result/excel/(4)Sheet4_Shapes.txt b/Testing/PluginTests/result/excel/(4)Sheet4_Shapes.txt new file mode 100644 index 00000000000..46b134b197f --- /dev/null +++ b/Testing/PluginTests/result/excel/(4)Sheet4_Shapes.txt @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/Testing/PluginTests/result/excel/(5)Sheet5(1-1).png b/Testing/PluginTests/result/excel/(5)Sheet5(1-1).png new file mode 100644 index 0000000000000000000000000000000000000000..67ce0ad6331e30492ad7dcfc212257572274b6cb GIT binary patch literal 704 zcmeAS@N?(olHy`uVBq!ia0vp^9zZO_!3-qNt7SX^QjEnx?oJHr&dIz4a#+$GeH|GX zHuiJ>Nn{1eDFpb0xc>kD|M20%42ce;% zK)XCWJ@@Y2tEQ$lapJ@c8#bh;r=L1?%G})iTOf%$alR)-59=qv_M9tEi~#-o3lIxw*Q!`rf^J8X6iaSFW_Q zw2X;~Nls3lGG)rUcke7LETW^Mi;9Zs>gvM6!c0v~fByXW{{8#gw{Jgs^yt~MXIHOY z{rmSX&?C_b3Lq+>B*-rq7*@0d48^%moPl<67I;J!GcfQS24TkI`72U@f_pt(978Pp z-%c{*JFLLtTFb!pJ|+3nfi!)cduQhSj$fuyDz!xI!qQil)Lnl%p1ORTp?;rJtnHZ< z|K44E!l)3qO4TII&Wv9+>k;PxE(Iaip!gkbnTq}DSEoG?>;zcCG*b literal 0 HcmV?d00001 diff --git a/Testing/PluginTests/result/excel/(5)Sheet5.tsv b/Testing/PluginTests/result/excel/(5)Sheet5.tsv new file mode 100644 index 0000000000000000000000000000000000000000..cd493ac6239ef5d75017b84ed17bceefc0ca4112 GIT binary patch literal 12 TcmezW&yYcn!H9vEfr|kE8@K|d literal 0 HcmV?d00001 diff --git a/Testing/PluginTests/result/excel/(5)Sheet5_HeadersAndFooters.txt b/Testing/PluginTests/result/excel/(5)Sheet5_HeadersAndFooters.txt new file mode 100644 index 0000000000000000000000000000000000000000..fd9e062162f0e802be6cb4d09e1f785ce6505003 GIT binary patch literal 182 zcmezW&xawEA&sGg!2?JqGNb^>A_gl41qNOQE(T{HFApdO62m4R#E{95&X9paH_T)= ThI}A|n1an@Z1M<`vB?4e!UrCp literal 0 HcmV?d00001 diff --git a/Testing/PluginTests/result/excel/(5)Sheet5_Shapes.txt b/Testing/PluginTests/result/excel/(5)Sheet5_Shapes.txt new file mode 100644 index 00000000000..46b134b197f --- /dev/null +++ b/Testing/PluginTests/result/excel/(5)Sheet5_Shapes.txt @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/Testing/PluginTests/result/excel/(6)Sheet6(1-1).png b/Testing/PluginTests/result/excel/(6)Sheet6(1-1).png new file mode 100644 index 0000000000000000000000000000000000000000..4673fc73bbe8ba8ebc6648d5505357720bb4873a GIT binary patch literal 1154 zcmeAS@N?(olHy`uVBq!ia0vp^9zZO_!3-qNt7SX^QjEnx?oJHr&dIz4a#+$GeH|GX zHuiJ>Nn~YUVB!t%332`Z|NraPulMZP^YZ1(ef#!3e*F08(WAF--#&Ki*ww37Pn9-qKk`*rlzK!pI?7}e_C4Fgb5Q49Xh0|tGjF0 zE@NZkEnBuoOG~Gxr>|eX-q+W+q@<*vpdc(PtgfyO=<>FLSpOI zt%{0@2M->+bm@|zq2bAsC(X^xSFT*y*x1D!Q z*VkXVbZKN{WL#XFtE=nRuU|iY{HUOyU}ZopuCm#B_Kv%`pLCx{MCV%9cfm{ogB3O$Xr?XsUF5<@vNsDzG@`xIMuTx%GNKu zm;Hy)qaE%ckIw&k`PX%IAkzt(UsVlH8X^LXw>(wXaPLn2{cr8dm=ZX0MFUeE1b@Q8izggCq21eX}#mYo_YFr-~F0-i`URhV_l6k zH#f_k=MoqAFYFELx45Pt_}MnNM{dni3El8dmz+Akv40DDS>t9>Zh7|SkH%h3>DOzf oUOHgNS-803*SBZ!oiDgQU(MYA!0d4!FpL>IUHx3vIVCg!0DWSCu>b%7 literal 0 HcmV?d00001 diff --git a/Testing/PluginTests/result/excel/(6)Sheet6.tsv b/Testing/PluginTests/result/excel/(6)Sheet6.tsv new file mode 100644 index 0000000000000000000000000000000000000000..d3c9bf9d193171e0ddddee20706d32c845310ac2 GIT binary patch literal 38 mcmezW&y}GF2=jqhm%)g^kimq(jKKoPG6rG`AfK0kiva+xUItMB literal 0 HcmV?d00001 diff --git a/Testing/PluginTests/result/excel/(6)Sheet6_HeadersAndFooters.txt b/Testing/PluginTests/result/excel/(6)Sheet6_HeadersAndFooters.txt new file mode 100644 index 0000000000000000000000000000000000000000..fd9e062162f0e802be6cb4d09e1f785ce6505003 GIT binary patch literal 182 zcmezW&xawEA&sGg!2?JqGNb^>A_gl41qNOQE(T{HFApdO62m4R#E{95&X9paH_T)= ThI}A|n1an@Z1M<`vB?4e!UrCp literal 0 HcmV?d00001 diff --git a/Testing/PluginTests/result/excel/(6)Sheet6_Shapes.txt b/Testing/PluginTests/result/excel/(6)Sheet6_Shapes.txt new file mode 100644 index 00000000000..46b134b197f --- /dev/null +++ b/Testing/PluginTests/result/excel/(6)Sheet6_Shapes.txt @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/Testing/PluginTests/result/excel/Sheet1.bas b/Testing/PluginTests/result/excel/Sheet1.bas new file mode 100644 index 00000000000..678f6efd8ae --- /dev/null +++ b/Testing/PluginTests/result/excel/Sheet1.bas @@ -0,0 +1,12 @@ +VERSION 1.0 CLASS +BEGIN + MultiUse = -1 'True +END +Attribute VB_Name = "Sheet1" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = True +Sub test() + MsgBox "eXg" +End Sub diff --git a/Testing/PluginTests/result/excel/Sheet2.bas b/Testing/PluginTests/result/excel/Sheet2.bas new file mode 100644 index 00000000000..9368fcbc336 --- /dev/null +++ b/Testing/PluginTests/result/excel/Sheet2.bas @@ -0,0 +1,9 @@ +VERSION 1.0 CLASS +BEGIN + MultiUse = -1 'True +END +Attribute VB_Name = "Sheet2" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = True diff --git a/Testing/PluginTests/result/excel/Sheet3.bas b/Testing/PluginTests/result/excel/Sheet3.bas new file mode 100644 index 00000000000..bf55a0db47c --- /dev/null +++ b/Testing/PluginTests/result/excel/Sheet3.bas @@ -0,0 +1,9 @@ +VERSION 1.0 CLASS +BEGIN + MultiUse = -1 'True +END +Attribute VB_Name = "Sheet3" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = True diff --git a/Testing/PluginTests/result/excel/Sheet4.bas b/Testing/PluginTests/result/excel/Sheet4.bas new file mode 100644 index 00000000000..3b5658440a1 --- /dev/null +++ b/Testing/PluginTests/result/excel/Sheet4.bas @@ -0,0 +1,9 @@ +VERSION 1.0 CLASS +BEGIN + MultiUse = -1 'True +END +Attribute VB_Name = "Sheet4" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = True diff --git a/Testing/PluginTests/result/excel/Sheet5.bas b/Testing/PluginTests/result/excel/Sheet5.bas new file mode 100644 index 00000000000..5d56cc32a47 --- /dev/null +++ b/Testing/PluginTests/result/excel/Sheet5.bas @@ -0,0 +1,9 @@ +VERSION 1.0 CLASS +BEGIN + MultiUse = -1 'True +END +Attribute VB_Name = "Sheet5" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = True diff --git a/Testing/PluginTests/result/excel/Sheet6.bas b/Testing/PluginTests/result/excel/Sheet6.bas new file mode 100644 index 00000000000..2e001954d69 --- /dev/null +++ b/Testing/PluginTests/result/excel/Sheet6.bas @@ -0,0 +1,9 @@ +VERSION 1.0 CLASS +BEGIN + MultiUse = -1 'True +END +Attribute VB_Name = "Sheet6" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = True diff --git a/Testing/PluginTests/result/excel/ThisWorkbook.bas b/Testing/PluginTests/result/excel/ThisWorkbook.bas new file mode 100644 index 00000000000..71a359849aa --- /dev/null +++ b/Testing/PluginTests/result/excel/ThisWorkbook.bas @@ -0,0 +1,9 @@ +VERSION 1.0 CLASS +BEGIN + MultiUse = -1 'True +END +Attribute VB_Name = "ThisWorkbook" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = True diff --git a/Testing/PluginTests/result/powerpnt.ppt.txt b/Testing/PluginTests/result/powerpnt.ppt.txt new file mode 100644 index 0000000000000000000000000000000000000000..589f640cac1d055665e5b5eb5d74a075046a1c5d GIT binary patch literal 298 zcmezWFPb5kA%`K8A%!88!H^-AftP`cVZXr=gA)d?4HSSPRtyRZB|y1iAPJHSj}DDf zU@!uUhd{+qRe)5XnySa($B+*-C4eE3Aswg>ViUq{1qM%sT&SD^LjcfCi44g=bs0dN vIbhcn0bK%d56A|DiMUlmTnSQ*Y>yv9DbS`QpxGc3aoJ=H_Msuz&ma>3>ohVv literal 0 HcmV?d00001 diff --git a/Testing/PluginTests/result/powerpnt/CannotGetMacros.bas b/Testing/PluginTests/result/powerpnt/CannotGetMacros.bas new file mode 100644 index 0000000000000000000000000000000000000000..68c9e3d768bbaafdd0efb8f95bdad9cb7293d1c6 GIT binary patch literal 514 zcmZXRQEJ0L3`FNU&^zn_N)OR|n-&_{@6?G?2iF_C4kedw^F~WBB?xx4l4dm0{{61C z)re)yN;+sCcSE$*M6~Eh4_cA4ZHOdt1D5rJ|Dhgq18xd*0`HoZ^IIosCvpjYVSMC$ zhS~8(Z=5gcupX3SmBC%+;C19HGRDl9dmdm&;Vt<^cY=2h-mlLC#n3>gF(2+_^X24Hoo&w($}=dB&B0pJ0B`+C5ZYlw@3 zyRAeb85kJga=9fXB}z(4;4&VMPe@3psi~=`sAz9*=kxg@k*Kk;kxr-g^z>L+S!ro$ zsj8|H2!sn4F4)`K3xz@#7ng~N2{alFgTYWJ6obKti;MI2_D)Gj(bd%jF+U&>NYLz$ zc5^xdGXD1gzJhoS&4*EA&)7*yjBr~9>mr356uZ~!s~P*vAVG!*5Bj*nt}DKC4?z;;5Rx%+(7a1 zKeJ?Z|C=gJbM__sbl1egH-P|kvcV~|VQXR~16%jezZHT2JZPL3f8;p)lfzk2g-Rvl zB2bIx@4GXT3q2rEwK})ZyHM$d^W|?|scY3*>RCHz@PzFeAf}Bl1 zw`AU>{;5^EJ6yW0WTKz(T;X`%9P@XU+xe)biSOdMK)_Qu zjGb>z$t{%o_nzI^;h3spl;VeFytXf@v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ZT_N;_la)g_XHaFni}`B4s-VCaqRB4UIn=v^*MccXk1qCS)MnH zLzhRHYPU6m67Ldeq2)0w%=Tv~Jt>@;aR{FD)?;$bvo(XbSKr8;Mt2}DD+1MOJ&=7T zrfQK>Ib(BQ2j4a73zJ4Z{q(}lRrEs>3n;0H{A4J~G0&kFCDJY5@OK9uc+c(|#^N4> zBwzwh?XqqKi$-66{r38bp+D#_tPOc&Q6GFoL6XKj`zwsi&eWh= zA{o7|&J1(eA|p^#1b^g%Z9SG$J^wzGTEVMl6$0UH*n$)?%(%t&W1WwyJonqPGul)(Mdk+%; literal 0 HcmV?d00001 diff --git a/Testing/PluginTests/result/powerpnt/Slide1.txt b/Testing/PluginTests/result/powerpnt/Slide1.txt new file mode 100644 index 0000000000000000000000000000000000000000..f9ee31a6dd2405336ed84eade07e847d332a9d80 GIT binary patch literal 64 ycmezWZ@!aT&j)Ws*&ySV<-jMlms;qmtJGAUPG{508myOcmMzZ literal 0 HcmV?d00001 diff --git a/Testing/PluginTests/result/word.doc.txt b/Testing/PluginTests/result/word.doc.txt new file mode 100644 index 0000000000000000000000000000000000000000..d857a6b9d330e5058a64565ad8bff944206a1d7a GIT binary patch literal 154 zcmezWFPg!LAs+~{8FCpC8H#{(F+(f^F9R1CM>B*lq%u@6lrShTI0IGX0a>YF5}^vD zHku)rAp@wt04R%)0f~cjr2s{J!E`A@4v?(}G&O@E6R6S!D4NVr3bY$yD#B&}ZRi=P literal 0 HcmV?d00001 diff --git a/Testing/PluginTests/result/word/(0)Bookmarks.txt b/Testing/PluginTests/result/word/(0)Bookmarks.txt new file mode 100644 index 00000000000..46b134b197f --- /dev/null +++ b/Testing/PluginTests/result/word/(0)Bookmarks.txt @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/Testing/PluginTests/result/word/CannotGetMacros.bas b/Testing/PluginTests/result/word/CannotGetMacros.bas new file mode 100644 index 0000000000000000000000000000000000000000..68c9e3d768bbaafdd0efb8f95bdad9cb7293d1c6 GIT binary patch literal 514 zcmZXRQEJ0L3`FNU&^zn_N)OR|n-&_{@6?G?2iF_C4kedw^F~WBB?xx4l4dm0{{61C z)re)yN;+sCcSE$*M6~Eh4_cA4ZHOdt1D5rJ|Dhgq18xd*0`HoZ^IIosCvpjYVSMC$ zhS~8(Z=5gcupX3SmBC%+;C19HGRDl9dmdm&;Vt<^cY=2h- + + + + + + + + + + +

+ +

 

+ +
+ + + + diff --git a/Testing/PluginTests/result/word/Document.txt b/Testing/PluginTests/result/word/Document.txt new file mode 100644 index 0000000000000000000000000000000000000000..7315ccb59ea7ab1fade1a0d1aeefd9310ab233de GIT binary patch literal 4 LcmezWkCy=e2NVJe literal 0 HcmV?d00001 diff --git a/Testing/PluginTests/result/word/Shapes.txt b/Testing/PluginTests/result/word/Shapes.txt new file mode 100644 index 00000000000..46b134b197f --- /dev/null +++ b/Testing/PluginTests/result/word/Shapes.txt @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/Testing/PluginTests/result/word/ThisDocument.bas b/Testing/PluginTests/result/word/ThisDocument.bas new file mode 100644 index 00000000000..d365bf6b19c --- /dev/null +++ b/Testing/PluginTests/result/word/ThisDocument.bas @@ -0,0 +1,9 @@ +VERSION 1.0 CLASS +BEGIN + MultiUse = -1 'True +END +Attribute VB_Name = "ThisDocument" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = True diff --git a/Testing/SingleInstanceTest.cmd b/Testing/SingleInstanceTest.cmd new file mode 100644 index 00000000000..af5e812778a --- /dev/null +++ b/Testing/SingleInstanceTest.cmd @@ -0,0 +1,12 @@ +setlocal enabledelayedexpansion +if not defined exepath ( + set exepath=%~dp0\..\Build\x64\Release\WinMergeU.exe +) +for /L %%i in (0,1,5) do ( + set cnt=%%i + set /a lrev=cnt + set /a rrev=cnt+1 + echo %exepath% -s:2 -u %%1 %%2> %~dp0\tmp.cmd + git difftool --extcmd %~dp0\tmp.cmd HEAD~!lrev!..HEAD~!rrev! ../Src/MainFrm.cpp +) +rem del %~dp0\tmp.cmd diff --git a/crowdin.yml b/crowdin.yml new file mode 100644 index 00000000000..0452199c1fb --- /dev/null +++ b/crowdin.yml @@ -0,0 +1,54 @@ +project_id : 544816 +base_path : . +base_url : https://api.crowdin.com +preserve_hierarchy: true +files: + - source: /Docs/Users/ReadMe.txt + translation: /Translations/Docs/Readme/ReadMe-%language%.txt + languages_mapping: &anchor + language: + ar: Arabic + eu: Basque + pt-BR: Brazilian + bg: Bulgarian + ca: Catalan + zh-CN: ChineseSimplified + zh-TW: ChineseTraditional + co: Corsican + hr: Croatian + cs: Czech + da: Danish + nl: Dutch + fi: Finnish + fr: French + gl: Galician + de: German + el: Greek + hu: Hungarian + it: Italian + ja: Japanese + ko: Korean + it: Lithuanian + nb: Norwegian + fa: Persian + pl: Polish + pt: Portuguese + ro: Romanian + ru: Russian + sr: Serbian + si: Sinhala + sk: Slovak + sl: Slovenian + es: Spanish + sv: Swedish + tr: Turkish + uk: Ukrainian + - source: /Translations/WinMerge/English.pot + translation: /Translations/WinMerge/%language%.po + languages_mapping: *anchor + - source: /Translations/InnoSetup/English.isl + translation: /Translations/InnoSetup/%language%.isl + languages_mapping: *anchor + - source: /Translations/ShellExtension/English.pot + translation: /Translations/ShellExtension/%language%.po + languages_mapping: *anchor From 65ce7cd4fa0540a88ab8d23b015543dcbce4382a Mon Sep 17 00:00:00 2001 From: Takashi Sawanaka Date: Tue, 6 Feb 2024 08:22:33 +0900 Subject: [PATCH 25/58] Update TranslationsStatus --- Translations/TranslationsStatus.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Translations/TranslationsStatus.md b/Translations/TranslationsStatus.md index c06e429b911..dc29ab222da 100644 --- a/Translations/TranslationsStatus.md +++ b/Translations/TranslationsStatus.md @@ -1,6 +1,6 @@ # Translations Status -Status from **2024-01-29**: +Status from **2024-02-06**: ## WinMerge @@ -34,7 +34,7 @@ Status from **2024-01-29**: | Polish | 1325 | 1313 | 0 | 12 | 99 % | 2023-11-28 | | Portuguese | 1325 | 1325 | 0 | 0 | 100 % | 2024-01-17 | | Romanian | 1325 | 1311 | 0 | 14 | 98 % | 2023-11-07 | -| Russian | 1325 | 1284 | 0 | 41 | 96 % | 2023-04-27 | +| Russian | 1325 | 1323 | 0 | 2 | 99 % | 2023-04-27 | | Serbian | 1325 | 632 | 0 | 693 | 47 % | | | Sinhala | 1325 | 563 | 58 | 704 | 46 % | 2010-12-12 | | Slovak | 1325 | 1189 | 0 | 136 | 89 % | 2022-02-17 | From 83f4e3ee00f9a8fbfbfbf227996f7a2a597e1a41 Mon Sep 17 00:00:00 2001 From: Takashi Sawanaka Date: Tue, 6 Feb 2024 09:09:33 +0900 Subject: [PATCH 26/58] WIP --- Testing/PluginTests/PluginTests.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Testing/PluginTests/PluginTests.js b/Testing/PluginTests/PluginTests.js index ffb2bfaacd8..73905e54cb6 100644 --- a/Testing/PluginTests/PluginTests.js +++ b/Testing/PluginTests/PluginTests.js @@ -62,10 +62,8 @@ function printPluginInfo(p) { WScript.Echo("PluginEvent : " + p.PluginEvent); WScript.Echo("PluginFileFilters: " + p.PluginFileFilters); WScript.Echo("PluginIsAutomatic: " + p.PluginIsAutomatic); - try { - WScript.Echo("PluginUnpackedFileExtension: " + p.PluginUnpackedFileExtension); - } catch (e) { - } + try { WScript.Echo("PluginUnpackedFileExtension: " + p.PluginUnpackedFileExtension); } catch (e) {} + try { WScript.Echo("PluginExtendedProperties: " + p.PluginExtendedProperties); } catch (e) {} } function CompareMSExcelFilesTest() { @@ -74,7 +72,7 @@ function CompareMSExcelFilesTest() { var changed = false; var subcode = 0; p.PluginOnEvent(0, MergeApp); - p.UnpackFile(ScriptFolder + "\\..\\Data\\Office\\excel.xls", ScriptFolder + "\\result\\excel.xls.txt", changed, subcode); + p.UnpackFile(ScriptFolder + "\\..\\Data\\Office\\excel.xls", ScriptFolder + "\\result\\excel.xls.tsv", changed, subcode); p.UnpackFolder(ScriptFolder + "\\..\\Data\\Office\\excel.xls", ScriptFolder + "\\result\\excel\\", changed, subcode); p.PluginOnEvent(1, MergeApp); } From ab09036299785d3bd1bbf7af3f34d12418f24f76 Mon Sep 17 00:00:00 2001 From: Takashi Sawanaka Date: Tue, 6 Feb 2024 21:21:00 +0900 Subject: [PATCH 27/58] WIP --- Plugins/dlls/CompareMSExcelFiles.sct | 2 +- Plugins/dlls/CompareMSWordFiles.sct | 7 ++- Testing/Data/Office/word.doc | Bin 11264 -> 41984 bytes Testing/PluginTests/result/word.doc.txt | Bin 154 -> 836 bytes Testing/PluginTests/result/word/Document.htm | 57 ++++++++++++++++++- Testing/PluginTests/result/word/Document.txt | Bin 4 -> 442 bytes Testing/PluginTests/result/word/Shapes.txt | Bin 2 -> 118 bytes 7 files changed, 60 insertions(+), 6 deletions(-) diff --git a/Plugins/dlls/CompareMSExcelFiles.sct b/Plugins/dlls/CompareMSExcelFiles.sct index 5ea80586e48..452e9dc976e 100644 --- a/Plugins/dlls/CompareMSExcelFiles.sct +++ b/Plugins/dlls/CompareMSExcelFiles.sct @@ -182,7 +182,7 @@ function ungroupShapes(sht) { cnt = sht.Shapes.Count; for (var it = new Enumerator(sht.Shapes), shp = it.item(); !it.atEnd(); it.moveNext(), shp = it.item()) { try { - if (shp.Type == pbGroup) { + if (shp.Type === pbGroup) { shp.Ungroup(); } } catch (e) {} diff --git a/Plugins/dlls/CompareMSWordFiles.sct b/Plugins/dlls/CompareMSWordFiles.sct index a1843825eba..e547b16e7cc 100644 --- a/Plugins/dlls/CompareMSWordFiles.sct +++ b/Plugins/dlls/CompareMSWordFiles.sct @@ -52,6 +52,7 @@ var MsgCannotGetMacros = "${Cannot get Macros.\r\n" + " To allow WinMerge to compare macros, use MS Office to alter the settings in the Macro Security for the current application.\r\n" + " The Trust access to Visual Basic Project feature should be turned on to use this feature in WinMerge.\r\n}"; var wdFormatFilteredHTML = 10; +var pbGroup = 6; var fso = new ActiveXObject("Scripting.FileSystemObject"); var wsh = new ActiveXObject("WScript.Shell"); @@ -89,14 +90,14 @@ function writeBookmarks(fo, items) { } catch (e) {} } -function ungroupShapes(sht) { +function ungroupShapes(doc) { try { var cnt; do { - cnt = sht.Shapes.Count; + cnt = doc.Shapes.Count; for (var it = new Enumerator(doc.Shapes), shp = it.item(); !it.atEnd(); it.moveNext(), shp = it.item()) { try { - if (shp.Type == pbGroup) { + if (shp.Type === pbGroup) { shp.Ungroup(); } } catch (e) {} diff --git a/Testing/Data/Office/word.doc b/Testing/Data/Office/word.doc index 07ff23c4a3587c99f3867a611c35570b5b996107..519a3f6dfc4cf8ffa8a16dedd5cdd7cc413ba164 100644 GIT binary patch literal 41984 zcmeHw2S8KJvhbz=0Vxp?5m7@#MWlp|DAExS>7ocK0YVJ~DfWVb6$|>=3-;cycSXJS zhP^A;dsl3jf950yVua7~y?5XH?_*)k?#}Mc?#{N^**zzvXX=+N++bKvluSp$BHyIy zL{$OL0Czju&n2V-xS0Uoq*5uOodCdDXZ}Cpz_X?MNhDEc6Y?>1A2uQ((6V4SggB@Z zqD^8`VpEDg6n~(w-#zNH^@)u(A?M~UPDaqj4pM_@F2_lwI#r>yx#oMm*(MNmu{j}IVOT|4$wt^RNH4FtjF9|E*PG7wyFl=qf^zY}ro)wO zq^oFXzS1^bUpfx@Tj&z93(_G=mP7r}DBGA%DBzI}+B6-yytE(rqiAS4inw2K)Ajlp zJ(|7`6dw8VPYq44sy_1m#+~}!@NM^NRbzqfhwe~cMZVGbKLtGY+q1w|0od68(9ra! zK|es#4dP)}qy2O^75EPxNC)$$>C&X=_SyyEST35+v`yzv`)Qj_Uz<(GQ?}{;NZYlg zr}4w&{Gk1{*~eiB?&XoXj|pMVusFWaTOrrYE|H()kR%pbSwuFN_Ln z$cs--NDyU;(&LiT6M<+v50j%iTOtwj5+s?Jf4rn$mSt5zcyW+EV9(%X#L0)tt!4~f%)Iws=rY_7`^oYbODS3_yFAia8ySE z!~=)`8mPl60niX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6+cCeZxgRzZZbmtL)0><_R=se0<^_-MZ@H!Et2}pxrfq^5I z7ekdB)8}o74Daj(x=n{k11PWaQ7+~~Fh|{p@F48wWC~?O`O~3hXi`$rEFJQaoJOk; z;8O@&qjpfD{G<%6!i z+B6H6ZAU_3Cv1nD&*-fW<~+I&=IPFqB(boD;Z9QCf&*M$6KHcdK5N+$4qLWW7qP>o z2$V95TH7>B8$soSeSz6)<9`Fx-L`Je%NS3 zZ6x>WGPH?+iGYcKiGYcKiGYcKiGYc~eIEf{Uii;3?=HND^8U%+eDLPQ-*v=*`89V3 z3NNwzUf6)bFZq<;Lg80;(z<{&P$LoGtlCY(R%5@Zp zm9AQgpaD$h$YRFr=NIuaUw&~ddHFYMH+X69)_hRTLRbYYH{h32uS`L1aMGYx#;?-}*}*$0~ET%rG5KhOgW zVWd)-A!Y)W@BY_t3XG_CA~^-5OPSZM4EqD`pUN%E63)%XjFPg#7531vZ-Nn0Y*54Dj8O}oQrkn+7}v~`|Av_k zW6A{vj4F|HKOxR2QgaVLA+1Va>dRy2Fe}8JCb$Gcn|x9_7s_=jO||_Sz;X z=*f60DShP`wR?8g+giT+bHw$1B#fG~7qOuFQ|dLR^JoPtsuRr^>SwH6&|2Y;)|KT| z)WwomP_KWdP`nt>>@mMPo-58B6U!ODo^L;cZbj^>lQz#OwF(dBS#n<+C%(g)KF?5) z%9Tak_IM*&9Zbl$JmNpx=WFyBJx6bm!+Z1+J@M?&$1yAX=cYaGE{vlF - +

-

 

+

What is WinMerge?

+ +

WinMerge is an Open Source differencing +and merging tool for Windows. WinMerge can compare both folders and files, +presenting differences in a visual text format that is easy to understand and +handle.

+ +

+ + + + + + + + + + + + + + + + + +
+ + + + +
+
+

What is WinMerge?

+

 

+
+
+
 
eLXg {bNX: WinMerge
+ + 

diff --git a/Testing/PluginTests/result/word/Document.txt b/Testing/PluginTests/result/word/Document.txt index 7315ccb59ea7ab1fade1a0d1aeefd9310ab233de..82e05a853e5df60e80e8cd8f8a18c67927d2dacc 100644 GIT binary patch literal 442 zcmZXROAf*?3`FMw+#v@*T!9lH7A#nYmKLOzA`*U=2c8|ZAfc*pJmb&UdB3(gC@L%H zsKmL&p0v_l7qy&A&Hk`4HWC@M)|oiFZ8YdgUWFf2Q>o#zO2$`SxrMR38rwV9PIxAN zPzTdsFW91{#=E0#F(F@lfx1OUMO2TL=>39r_?hWSwT_Oa#AY1(H+1emljfjj&r7Z~ zPn!Oxuz1^mO&s}e+!J$0SDwj#_&&=FJ-BVxl>F{_kC*gxX5hT~PKv?|S2i?S%QeK* IE_jidKH(ElKL7v# literal 4 LcmezWkCy=e2NVJe diff --git a/Testing/PluginTests/result/word/Shapes.txt b/Testing/PluginTests/result/word/Shapes.txt index 46b134b197f35e75e0784bedbf94a8dd124693b1..9bff1b8de9836be427eab1bf4a29a0a59d1f2868 100644 GIT binary patch literal 118 zcmezW@0h__gPjH^3=|md7#ucO4`eGa7&2HfC@_RGWH2N$lmJr6CPN;BFGDIr b5koqVv}fQ2LoNnvW*9-uK-B}%!NmXomj4_J literal 2 JcmezW4*&xG0sa60 From ad6fbd51af45d7bebefed55a6c1276a572329c89 Mon Sep 17 00:00:00 2001 From: Takashi Sawanaka Date: Thu, 8 Feb 2024 09:09:29 +0900 Subject: [PATCH 28/58] WIP --- Plugins/dlls/CompareMSExcelFiles.sct | 4 +- Plugins/dlls/CompareMSPowerPointFiles.sct | 4 +- Plugins/dlls/CompareMSVisioFiles.sct | 4 +- Plugins/dlls/CompareMSWordFiles.sct | 4 +- Src/MergeAppLib.h | 4 +- Testing/PluginTests/PluginTests.js | 123 +++++++++++++++++++- Testing/PluginTests/result/powerpnt.ppt.txt | Bin 298 -> 1730 bytes Testing/PluginTests/result/word.doc.txt | Bin 836 -> 2254 bytes 8 files changed, 132 insertions(+), 11 deletions(-) diff --git a/Plugins/dlls/CompareMSExcelFiles.sct b/Plugins/dlls/CompareMSExcelFiles.sct index 452e9dc976e..8a1570b7c71 100644 --- a/Plugins/dlls/CompareMSExcelFiles.sct +++ b/Plugins/dlls/CompareMSExcelFiles.sct @@ -79,7 +79,9 @@ function regWrite(Key, Value, TypeNm) { function writeObjectProperties(fo, items) { try { for (var it = new Enumerator(items), o = it.item(); !it.atEnd(); it.moveNext(), o = it.item()) { - fo.WriteLine(o.Name + ": " + o.Value); + try { + fo.WriteLine(o.Name + ": " + o.Value); + } catch (e) {} } } catch (e) {} } diff --git a/Plugins/dlls/CompareMSPowerPointFiles.sct b/Plugins/dlls/CompareMSPowerPointFiles.sct index adb57ce7195..a3e81bd2fe6 100644 --- a/Plugins/dlls/CompareMSPowerPointFiles.sct +++ b/Plugins/dlls/CompareMSPowerPointFiles.sct @@ -75,7 +75,9 @@ function regWrite(Key, Value, TypeNm) { function writeObjectProperties(fo, items) { try { for (var it = new Enumerator(items), o = it.item(); !it.atEnd(); it.moveNext(), o = it.item()) { - fo.WriteLine(o.Name + ": " + o.Value); + try { + fo.WriteLine(o.Name + ": " + o.Value); + } catch (e) {} } } catch (e) {} } diff --git a/Plugins/dlls/CompareMSVisioFiles.sct b/Plugins/dlls/CompareMSVisioFiles.sct index 12d2a6b85a1..4d64188c77d 100644 --- a/Plugins/dlls/CompareMSVisioFiles.sct +++ b/Plugins/dlls/CompareMSVisioFiles.sct @@ -76,7 +76,9 @@ function regWrite(Key, Value, TypeNm) { function writeObjectProperties(fo, items) { try { for (var it = new Enumerator(items), o = it.item(); !it.atEnd(); it.moveNext(), o = it.item()) { - fo.WriteLine(o.Name + ": " + o.Value); + try { + fo.WriteLine(o.Name + ": " + o.Value); + } catch (e) {} } } catch (e) {} } diff --git a/Plugins/dlls/CompareMSWordFiles.sct b/Plugins/dlls/CompareMSWordFiles.sct index e547b16e7cc..052a1681891 100644 --- a/Plugins/dlls/CompareMSWordFiles.sct +++ b/Plugins/dlls/CompareMSWordFiles.sct @@ -77,7 +77,9 @@ function regWrite(Key, Value, TypeNm) { function writeObjectProperties(fo, items) { try { for (var it = new Enumerator(items), o = it.item(); !it.atEnd(); it.moveNext(), o = it.item()) { - fo.WriteLine(o.Name + ": " + o.Value); + try { + fo.WriteLine(o.Name + ": " + o.Value); + } catch (e) {} } } catch (e) {} } diff --git a/Src/MergeAppLib.h b/Src/MergeAppLib.h index e51f49aa90b..c89c05a6ac5 100644 --- a/Src/MergeAppLib.h +++ b/Src/MergeAppLib.h @@ -7,8 +7,8 @@ /* at Tue Jan 19 12:14:07 2038 */ /* Compiler settings for MergeAppLib.idl: - Oicf, W1, Zp8, env=Win32 (32b run), target_arch=X86 8.01.0628 - protocol : dce , ms_ext, c_ext, robust + Oicf, W1, Zp8, env=Win64 (32b run), target_arch=AMD64 8.01.0628 + protocol : all , ms_ext, c_ext, robust error checks: allocation ref bounds_check enum stub_data VC __declspec() decoration level: __declspec(uuid()), __declspec(selectany), __declspec(novtable) diff --git a/Testing/PluginTests/PluginTests.js b/Testing/PluginTests/PluginTests.js index 73905e54cb6..c456db31cb6 100644 --- a/Testing/PluginTests/PluginTests.js +++ b/Testing/PluginTests/PluginTests.js @@ -13,17 +13,60 @@ try { FileSys.CreateFolder(ScriptFolder + "\\result\\powerpnt"); } catch (e) { } +var PluginSettings = { + "Plugins": { + "CompareMSExcelFiles.sct": { + "UnpackToFolder": 1, + "UpdateLinks": 3, + "CompareDocumentProperties": 1, + "CompareNames": 1, + "CompareCellValues": 1, + "CompareWorksheetsAsImage": 1, + "CompareWorksheetsAsHTML": 1, + "ImageWidth": 1000, + "ImageHeight": 3000, + "CompareFormulas": 1, + "CompareTextsInShapes": 1, + "CompareHeadersAndFooters": 1, + "CompareVBAMacros": 1 + }, + "CompareMSPowerPointFiles.sct": { + "UnpackToFolder": 1, + "CompareDocumentProperties": 1, + "CompareSlideAsImage": 1, + "CompareTextsInShapes": 1, + "CompareTextsInNotesPage": 1, + "CompareVBAMacros": 1 + }, + "CompareMSVisioFiles.sct": { + "UnpackToFolder": 1, + "ComparePageAsImage": 1, + "CompareTextsInShapes": 1, + "CompareVBAMacros": 1 + }, + "CompareMSWordFiles.sct": { + "UnpackToFolder": 1, + "CompareDocumentProperties": 1, + "CompareBookmarks": 1, + "CompareTextContents": 1, + "CompareDocumentsAsHTML": 1, + "CompareTextsInShapes": 1, + "CompareVBAMacros": 1 + } + } +}; + var MergeApp = { "GetOption": function (key, defvalue) { - try { - return WShell.RegRead("HKCU\\Software\\Thingamahoochie\\WinMerge\\" + key); - } catch (e) { - return defvalue; + var ary1 = key.split("/"); + var ary2 = ary1[0].split("\\"); + if (ary2.length > 1) { + return PluginSettings[ary2[0]][ary2[1]][ary1[1]]; } + return PluginSettings[ary2[0]][ary1[1]]; }, "SaveOption": function (key, value) { var t = typeof value === "string" ? "REG_SZ" : "REG_DWORD"; - WShell.RegWrite("HKCU\\Software\\Thingamahoochie\\WinMerge\\" + key, value, t); }, "Translate": function (text) { return text; @@ -64,6 +107,7 @@ function printPluginInfo(p) { WScript.Echo("PluginIsAutomatic: " + p.PluginIsAutomatic); try { WScript.Echo("PluginUnpackedFileExtension: " + p.PluginUnpackedFileExtension); } catch (e) {} try { WScript.Echo("PluginExtendedProperties: " + p.PluginExtendedProperties); } catch (e) {} + WScript.Echo(""); } function CompareMSExcelFilesTest() { @@ -102,6 +146,7 @@ function CompareMSPowerPointFilesTest() { function EditorAddinTest() { var asciiChars = ""; var p = GetObject("script: " + ScriptFolder + "\\..\\..\\Plugins\\dlls\\editor addin.sct"); + printPluginInfo(p); for (var i = 0; i < 128; i++) { asciiChars += String.fromCharCode(i); @@ -298,7 +343,75 @@ function EditorAddinTest() { p.PluginOnEvent(1, MergeApp); } +function InsertDateTimeTest() { + var changed = false; + var text = ""; + var size; + var p = GetObject("script: " + ScriptFolder + "\\..\\..\\Plugins\\dlls\\insert datetime.sct"); + printPluginInfo(p); + + WScript.Echo(p.InsertDate("date=")); + WScript.Echo(p.InsertTime("time=")); + WScript.Echo(); + +} + +function IgnoreLeadingLineNumbersTest() { + var changed = false; + var text = ""; + var size; + var p = GetObject("script: " + ScriptFolder + "\\..\\..\\Plugins\\dlls\\IgnoreLeadingLineNumbers.sct"); + printPluginInfo(p); + + // + text = ""; + size = text.length; + changed = false; + var result = p.PrediffBufferW(text, size, changed); + if (typeof result !== "string") { text = result.getItem(1); size = result.getItem(2); changed = result.getItem(3); } + setTestName("IgnoreLeadingLineNumbers1"); + assertEquals("", text); + assertEquals(0, size); + assertEquals(false, changed); + + // + text = "n1 aaa\r\nN2 bbb\r\n"; + size = text.length; + changed = false; + var result = p.PrediffBufferW(text, size, changed); + if (typeof result !== "string") { text = result.getItem(1); size = result.getItem(2); changed = result.getItem(3); } + setTestName("IgnoreLeadingLineNumbers2"); + assertEquals(" aaa\r\n bbb\r\n", text); + assertEquals(text.length, size); + assertEquals(true, changed); + + // + text = "1 aaa\nbbb\n"; + size = text.length; + changed = false; + var result = p.PrediffBufferW(text, size, changed); + if (typeof result !== "string") { text = result.getItem(1); size = result.getItem(2); changed = result.getItem(3); } + setTestName("IgnoreLeadingLineNumbers3"); + assertEquals(" aaa\nbbb\n", text); + assertEquals(text.length, size); + assertEquals(true, changed); + + // + text = "aaa\r2 bbb\r"; + size = text.length; + changed = false; + var result = p.PrediffBufferW(text, size, changed); + if (typeof result !== "string") { text = result.getItem(1); size = result.getItem(2); changed = result.getItem(3); } + setTestName("IgnoreLeadingLineNumbers4"); + assertEquals("aaa\r bbb\r", text); + assertEquals(text.length, size); + assertEquals(true, changed); + +} + EditorAddinTest(); +InsertDateTimeTest(); +IgnoreLeadingLineNumbersTest(); CompareMSExcelFilesTest(); CompareMSWordFilesTest(); CompareMSPowerPointFilesTest(); diff --git a/Testing/PluginTests/result/powerpnt.ppt.txt b/Testing/PluginTests/result/powerpnt.ppt.txt index 589f640cac1d055665e5b5eb5d74a075046a1c5d..db463067351349d4b78ac7847bab0b7361f472d0 100644 GIT binary patch literal 1730 zcma)+OKuZU5JhW@#2$K%gxYo_ej{XrKoAlUM+_{G{7D>xf9h@ru@W}GKA6H<7_bB2 z+^TkLCw>lt?)EF+y7jxS{{HFOGn?DMmNvCBn^|R<9b18I!MWf(=3Cl(yK8r>!>O_f zmdD^^Il;4UAF&MhN7f}QL(b=5XMBf_dy2iX3wVn?s8`^>*k?x#iJInXgPC6Cybsxd zb4oQ6>ybfZzB|X)AWAS9-|cKw>05j+sj1|dQ(4BNuJy4;O^v$Jg-09H5k*|1d!Daq zI>b8gE|+kfd(0!g>e&E3&0tO+#H?THWaaE_EN5H1LqA1bnuanv@@Zt&v;$5}%jsmp z-%Wdn<&;Ub?H-m#Jb8_2f>EXGK9q1@dOoT{3Q_jAM>&A$wkRFys^Fi1luD#5)j8t4 z87=pm-fZ+b^PXkbbkeH(6H^|6DbP|{LC+mA_3jDvJO7sd%%3d#U)6&{>@%Jbx$RSI z=y2iaebIL1-zPsQGSu6$2TY>Dv=o0AUQr6qN$&->DLm62CEXqSZ46}0cNh1}r?JW< z-SZ3Q)BTptPOkB%{ie)say3^?yNCb4{TFo|;r)WH#O_h(`D}vC->wI~TRHi#9^l@EJ?D_RvGkeLsk6N{rv_-X{w8|R%I$u%PR~Wi{T%;`XBND delta 12 TcmX@ayNZeF|G&+%STz^{BdrAX diff --git a/Testing/PluginTests/result/word.doc.txt b/Testing/PluginTests/result/word.doc.txt index bedb7bc6e92255ee7390ebadc990673234da17cf..4f78ef6a5d77c5ca2f155d781296720e0f47d309 100644 GIT binary patch literal 2254 zcma)8OKuZE5Un*5cWAK+0<4LNfv`cr5FvpbgpGn^Wid1UB*gYuGvj>j!xph-jf6M^ zci;xVdsWl%C+#S*+C5WUUG?hK$Nu-XC$A)vROT{~flQ?oC+{VPY=-w7?3?~!Seg|2BH-~){)tBs1+sRSy&nM#g z083}^Q($HA=CH_00=Y%ePGw@{rzY?T`iL zFQl2G24k=rYjrY@-uAPKnGXE1`g6s5sh*9qCT_91Mw%%*3D@JkYOwaK1HxJ@oKLYB zq197Z&-#E|OwlL4J3`SVI444jX$Oq$ijOO#&zfZynf_+h=$o94^m_&l?M7XBegm&I z8_eD*a+N^4fMuc$M-{>o%8rvQ%m&uZF>DoD6YQ8m?yL1WqI{}2$P?$4pIT*wYcq!R z8=MNv*}RG`jGXg>RXkTlZi?~xBxR?u=4?i6M#lQ>$xB3(VNSA=a_oNU+G!WIE`Zjd z&zB?jT8CQeJm(DKgkiQ@ihwou0<5jeye=bja-ezTQwJW{6E>^Z%bZ<|g>0v4nSITB zee9egIXGJMJ0syF7-G+{n`h4DbD*nTNf!7V>>7>~TAc4>fs-%6yVV1&jp5N)UHIo* z<*!m951~KPd#p#+hsSh13hI*qMjT_=^k<%loRwvKTMX9Ulyjymc;@6TPy|S@d z9j0$sSYPD0rTe_X+66*Z)_RrOKZBcYF5B6z{z=&X24k5#ZK1zu!&RRaJdLy?E+DxF S4Kh>WiCV8KR?P|}T>k;_O?;gI delta 12 TcmX>nc!Z7V|G&*WtWL}TC65I% From 85cfdc4d60bf604c68201dd0ffe8184bf406f82f Mon Sep 17 00:00:00 2001 From: Takashi Sawanaka Date: Thu, 8 Feb 2024 21:19:36 +0900 Subject: [PATCH 29/58] WIP --- Plugins/dlls/CompareMSExcelFiles.sct | 28 +++++++++++------ Plugins/dlls/CompareMSPowerPointFiles.sct | 37 +++++++++++++++-------- Plugins/dlls/CompareMSVisioFiles.sct | 21 ++++++++----- Plugins/dlls/CompareMSWordFiles.sct | 22 +++++++++----- 4 files changed, 70 insertions(+), 38 deletions(-) diff --git a/Plugins/dlls/CompareMSExcelFiles.sct b/Plugins/dlls/CompareMSExcelFiles.sct index 8a1570b7c71..8cb2a02cdf9 100644 --- a/Plugins/dlls/CompareMSExcelFiles.sct +++ b/Plugins/dlls/CompareMSExcelFiles.sct @@ -78,8 +78,9 @@ function regWrite(Key, Value, TypeNm) { function writeObjectProperties(fo, items) { try { - for (var it = new Enumerator(items), o = it.item(); !it.atEnd(); it.moveNext(), o = it.item()) { + for (var it = new Enumerator(items); !it.atEnd(); it.moveNext()) { try { + var o = it.item(); fo.WriteLine(o.Name + ": " + o.Value); } catch (e) {} } @@ -166,7 +167,8 @@ function writeFormulas(fo, sht) { function getUsedRangeIncludingShapes(sht) { var col_max = 0; var row_max = 0; - for (var it = new Enumerator(sht.Shapes), shp = it.item(); !it.atEnd(); it.moveNext(), shp = it.item()) { + for (var it = new Enumerator(sht.Shapes); !it.atEnd(); it.moveNext()) { + var shp = it.item(); rng = shp.BottomRightCell; if (row_max < rng.Row + rng.Rows.Count - 1) { row_max = rng.Row + rng.Rows.Count - 1 } if (col_max < rng.Column + rng.Columns.Count - 1) { col_max = rng.Column + rng.Columns.Count - 1 } @@ -182,8 +184,9 @@ function ungroupShapes(sht) { var cnt; do { cnt = sht.Shapes.Count; - for (var it = new Enumerator(sht.Shapes), shp = it.item(); !it.atEnd(); it.moveNext(), shp = it.item()) { + for (var it = new Enumerator(sht.Shapes); !it.atEnd(); it.moveNext()) { try { + var shp = it.item(); if (shp.Type === pbGroup) { shp.Ungroup(); } @@ -195,8 +198,9 @@ function ungroupShapes(sht) { function writeTextsInShapes(fo, sht) { try { - for (var it = new Enumerator(sht.Shapes), shp = it.item(); !it.atEnd(); it.moveNext(), shp = it.item()) { + for (var it = new Enumerator(sht.Shapes); !it.atEnd(); it.moveNext()) { try { + var shp = it.item(); fo.WriteLine(shp.Name + ": " + shp.TextFrame.Characters().Text); } catch (e) {} } @@ -432,7 +436,7 @@ function UnpackFile(fileSrc, fileDst, pbChanged, pSubcode) { throw new Error(30001, "CompareMSExcelFiles.sct: " + fileSrc + ": Target file '" + fileSrc2 + "' not found"); } } - var wbk = xl.Workbooks.Open(fileSrc2, regRead(REGKEY_PATH + "UpdateLinks", 0), null, null, null, null, null, null, null, null, null, null,null, true); + var wbk = xl.Workbooks.Open(fileSrc2, regRead(REGKEY_PATH + "UpdateLinks", 0), null, null, null, null, null, null, null, null, null, null,null, -1); if (regRead(REGKEY_PATH + "CompareDocumentProperties", false)) { fo.WriteLine("[Document Properties]"); writeObjectProperties(fo, wbk.BuiltinDocumentProperties); @@ -445,7 +449,8 @@ function UnpackFile(fileSrc, fileDst, pbChanged, pSubcode) { fo.WriteLine(""); } - for (var it = new Enumerator(wbk.Worksheets), sht = it.item(); !it.atEnd(); it.moveNext(), sht = it.item()) { + for (var it = new Enumerator(wbk.Worksheets); !it.atEnd(); it.moveNext()) { + var sht = it.item(); if (regRead(REGKEY_PATH + "CompareCellValues", true)) { fo.WriteLine("[" + sht.Name + "]"); writeCellValues(fo, sht); @@ -473,7 +478,8 @@ function UnpackFile(fileSrc, fileDst, pbChanged, pSubcode) { if (!isAccessibleVBAProject(wbk)) { fo.WriteLine(translate(MsgCannotGetMacros)); } else { - for (var it = new Enumerator(wbk.VBProject.VBComponents), cmp = it.item(); !it.atEnd(); it.moveNext(), cmp = it.item()) { + for (var it = new Enumerator(wbk.VBProject.VBComponents); !it.atEnd(); it.moveNext()) { + var cmp = it.item(); fo.WriteLine("[CodeModule." + cmp.Name + "]"); if (cmp.CodeModule.CountOfLines > 0) { fo.WriteLine(cmp.CodeModule.Lines(1, cmp.CodeModule.CountOfLines)); @@ -526,7 +532,7 @@ function UnpackFolder(fileSrc, folderDst, pbChanged, pSubcode) { throw new Error(30001, "CompareMSExcelFiles.sct: " + fileSrc + ": Target file '" + fileSrc2 + "' not found"); } } - var wbk = xl.Workbooks.Open(fileSrc2, regRead(REGKEY_PATH + "UpdateLinks", 0), null, null, null, null, null, null, null, null, null, null, null, true); + var wbk = xl.Workbooks.Open(fileSrc2, regRead(REGKEY_PATH + "UpdateLinks", 0), null, null, null, null, null, null, null, null, null, null, null, -1); digit = String(wbk.Worksheets.Count).length; if (digit <= 0) { digit = 1; } @@ -545,7 +551,8 @@ function UnpackFolder(fileSrc, folderDst, pbChanged, pSubcode) { } var No = 1; - for (var it = new Enumerator(wbk.Worksheets), sht = it.item(); !it.atEnd(); it.moveNext(), sht = it.item()) { + for (var it = new Enumerator(wbk.Worksheets); !it.atEnd(); it.moveNext()) { + var sht = it.item(); No = zf + No; No = No.substr(No.length - digit, digit); if (regRead(REGKEY_PATH + "CompareCellValues", true)) { @@ -588,7 +595,8 @@ function UnpackFolder(fileSrc, folderDst, pbChanged, pSubcode) { fo.WriteLine(translate(MsgCannotGetMacros)); fo.Close(); } else { - for (var it = new Enumerator(wbk.VBProject.VBComponents), cmp = it.item(); !it.atEnd(); it.moveNext(), cmp = it.item()) { + for (var it = new Enumerator(wbk.VBProject.VBComponents); !it.atEnd(); it.moveNext()) { + var cmp = it.item(); cmp.Export(fso.BuildPath(folderDst, cmp.Name + getModuleExtension(cmp))); } } diff --git a/Plugins/dlls/CompareMSPowerPointFiles.sct b/Plugins/dlls/CompareMSPowerPointFiles.sct index a3e81bd2fe6..9cffae4d202 100644 --- a/Plugins/dlls/CompareMSPowerPointFiles.sct +++ b/Plugins/dlls/CompareMSPowerPointFiles.sct @@ -56,9 +56,9 @@ var fso = new ActiveXObject("Scripting.FileSystemObject"); var wsh = new ActiveXObject("WScript.Shell"); var mergeApp; -function isAccessibleVBAProject(wbk) { +function isAccessibleVBAProject(prs) { try { - return (wbk.VBProject.VBComponents.Count >= 0); + return (prs.VBProject.VBComponents.Count >= 0); } catch (e) { return false; } @@ -74,10 +74,12 @@ function regWrite(Key, Value, TypeNm) { function writeObjectProperties(fo, items) { try { - for (var it = new Enumerator(items), o = it.item(); !it.atEnd(); it.moveNext(), o = it.item()) { + for (var it = new Enumerator(items); !it.atEnd(); it.moveNext()) { try { + var o = it.item(); fo.WriteLine(o.Name + ": " + o.Value); } catch (e) {} + o = null; } } catch (e) {} } @@ -95,7 +97,8 @@ function writeShape(fo, shp) { } } } else if (shpType === 6) { //msoGroup = 6 - for (var it = new Enumerator(shp.GroupItems), shp2 = it.item(); !it.atEnd(); it.moveNext(), shp2 = it.item()) { + for (var it = new Enumerator(shp.GroupItems); !it.atEnd(); it.moveNext()) { + var shp2 = it.item(); writeShape(fo, shp2); } } else if (shp.HasTextFrame) { @@ -108,7 +111,8 @@ function writeShape(fo, shp) { function writeTextsInShapes(fo, shps) { try { - for (var it = new Enumerator(shps), shp = it.item(); !it.atEnd(); it.moveNext(), shp = it.item()) { + for (var it = new Enumerator(shps); !it.atEnd(); it.moveNext()) { + var shp = it.item(); writeShape(fo, shp); } } catch (e) {} @@ -167,7 +171,8 @@ function UnpackFile(fileSrc, fileDst, pbChanged, pSubcode) { throw new Error(30001, "CompareMSPowerPointFiles.sct: " + fileSrc + ": Target file '" + fileSrc2 + "' not found"); } } - var prs = pp.Presentations.Open(fileSrc2); + + var prs = pp.Presentations.Open(fileSrc2, -1); if (regRead(REGKEY_PATH + "CompareDocumentProperties", false)) { fo.WriteLine("[Document Properties]"); @@ -175,7 +180,8 @@ function UnpackFile(fileSrc, fileDst, pbChanged, pSubcode) { fo.WriteLine(""); } - for (var it = new Enumerator(prs.Slides), sld = it.item(); !it.atEnd(); it.moveNext(), sld = it.item()) { + for (var it = new Enumerator(prs.Slides); !it.atEnd(); it.moveNext()) { + var sld = it.item(); if (regRead(REGKEY_PATH + "CompareTextsInShapes", true)) { fo.WriteLine("[" + sld.Name + "]"); writeTextsInShapes(fo, sld.Shapes); @@ -186,23 +192,25 @@ function UnpackFile(fileSrc, fileDst, pbChanged, pSubcode) { writeTextsInShapes(fo, sld.NotesPage.Shapes); fo.WriteLine(""); } + sld = null; } if (regRead(REGKEY_PATH + "CompareVBAMacros", true)) { if (!isAccessibleVBAProject(prs)) { fo.WriteLine(translate(MsgCannotGetMacros)); } else { - for (var it = new Enumerator(prs.VBProject.VBComponents), cmp = it.item(); !it.atEnd(); it.moveNext(), cmp = it.item()) { + for (var it = new Enumerator(prs.VBProject.VBComponents); !it.atEnd(); it.moveNext()) { + var cmp = it.item(); fo.WriteLine("[CodeModule." + cmp.Name + "]"); if (cmp.CodeModule.CountOfLines > 0) { fo.WriteLine(cmp.CodeModule.Lines(1, cmp.CodeModule.CountOfLines)); } fo.WriteLine(""); + cmp = null; } } } - sld = null; prs.Close(); prs = null; pp.Quit(); @@ -242,7 +250,7 @@ function UnpackFolder(fileSrc, folderDst, pbChanged, pSubcode) { throw new Error(30001, "CompareMSPowerPointFiles.sct: " + fileSrc + ": Target file '" + fileSrc2 + "' not found"); } } - var prs = pp.Presentations.Open(fileSrc2); + var prs = pp.Presentations.Open(fileSrc2, -1); if (regRead(REGKEY_PATH + "CompareDocumentProperties", false)) { var fo = fso.CreateTextFile(fso.BuildPath(folderDst, "(0)DocumentProperties.txt"), true, true); @@ -250,7 +258,8 @@ function UnpackFolder(fileSrc, folderDst, pbChanged, pSubcode) { fo.Close(); } - for (var it = new Enumerator(prs.Slides), sld = it.item(); !it.atEnd(); it.moveNext(), sld = it.item()) { + for (var it = new Enumerator(prs.Slides); !it.atEnd(); it.moveNext()) { + var sld = it.item(); if (regRead(REGKEY_PATH + "CompareTextsInShapes", true)) { var fo = fso.CreateTextFile(fso.BuildPath(folderDst, sld.Name + ".txt"), true, true); writeTextsInShapes(fo, sld.Shapes); @@ -266,6 +275,7 @@ function UnpackFolder(fileSrc, folderDst, pbChanged, pSubcode) { if (regRead(REGKEY_PATH + "CompareSlideAsImage", true)) { saveSlideAsImage(sld, fso.BuildPath(folderDst, sld.Name + ".png")); } + sld = null; } if (regRead(REGKEY_PATH + "CompareVBAMacros", true)) { if (!isAccessibleVBAProject(prs)) { @@ -273,13 +283,14 @@ function UnpackFolder(fileSrc, folderDst, pbChanged, pSubcode) { fo.WriteLine(translate(MsgCannotGetMacros)); fo.Close(); } else { - for (var it = new Enumerator(prs.VBProject.VBComponents), cmp = it.item(); !it.atEnd(); it.moveNext(), cmp = it.item()) { + for (var it = new Enumerator(prs.VBProject.VBComponents); !it.atEnd(); it.moveNext()) { + var cmp = it.item(); cmp.Export(fso.BuildPath(folderDst, cmp.Name + getModuleExtension(cmp))); + cmp = nul; } } } - sld = null; prs.Close(); prs = null; pp.Quit(); diff --git a/Plugins/dlls/CompareMSVisioFiles.sct b/Plugins/dlls/CompareMSVisioFiles.sct index 4d64188c77d..e808eed9e18 100644 --- a/Plugins/dlls/CompareMSVisioFiles.sct +++ b/Plugins/dlls/CompareMSVisioFiles.sct @@ -75,8 +75,9 @@ function regWrite(Key, Value, TypeNm) { function writeObjectProperties(fo, items) { try { - for (var it = new Enumerator(items), o = it.item(); !it.atEnd(); it.moveNext(), o = it.item()) { + for (var it = new Enumerator(items); !it.atEnd(); it.moveNext()) { try { + var o = it.item(); fo.WriteLine(o.Name + ": " + o.Value); } catch (e) {} } @@ -88,8 +89,9 @@ function ungroupShapes(pge) { var cnt; do { cnt = pge.Shapes.Count; - for (var it = new Enumerator(pge.Shapes), shp = it.item(); !it.atEnd(); it.moveNext(), shp = it.item()) { + for (var it = new Enumerator(pge.Shapes); !it.atEnd(); it.moveNext()) { try { + var shp = it.item(); shp.Ungroup(); } catch (e) {} } @@ -99,8 +101,9 @@ function ungroupShapes(pge) { function writeTextsInShapes(fo, pge) { try { - for (var it = new Enumerator(pge.Shapes), shp = it.item(); !it.atEnd(); it.moveNext(), shp = it.item()) { + for (var it = new Enumerator(pge.Shapes); !it.atEnd(); it.moveNext()) { try { + var shp = it.item(); fo.WriteLine(shp.Name + ": " + shp.Text); } catch (e) {} } @@ -162,7 +165,8 @@ function UnpackFile(fileSrc, fileDst, pbChanged, pSubcode) { } var doc = vs.Documents.OpenEx(fileSrc2, 0x80); - for (var it = new Enumerator(doc.Pages), pge = it.item(); !it.atEnd(); it.moveNext(), pge = it.item()) { + for (var it = new Enumerator(doc.Pages); !it.atEnd(); it.moveNext()) { + var pge = it.item(); if (regRead(REGKEY_PATH + "CompareTextsInShapes", true)) { fo.WriteLine("[" + pge.Name + "]"); ungroupShapes(pge); @@ -175,7 +179,8 @@ function UnpackFile(fileSrc, fileDst, pbChanged, pSubcode) { if (!isAccessibleVBAProject(doc)) { fo.WriteLine(translate(MsgCannotGetMacros)); } else { - for (var it = new Enumerator(doc.VBProject.VBComponents), cmp = it.item(); !it.atEnd(); it.moveNext(), cmp = it.item()) { + for (var it = new Enumerator(doc.VBProject.VBComponents); !it.atEnd(); it.moveNext()) { + var cmp = it.item(); fo.WriteLine("[CodeModule." + cmp.Name + "]"); if (cmp.CodeModule.CountOfLines > 0) { fo.WriteLine(cmp.CodeModule.Lines(1, cmp.CodeModule.CountOfLines)); @@ -227,7 +232,8 @@ function UnpackFolder(fileSrc, folderDst, pbChanged, pSubcode) { } var doc = vs.Documents.OpenEx(fileSrc2, 0x80); - for (var it = new Enumerator(doc.Pages), pge = it.item(); !it.atEnd(); it.moveNext(), pge = it.item()) { + for (var it = new Enumerator(doc.Pages); !it.atEnd(); it.moveNext()) { + var pge = it.item(); if (regRead(REGKEY_PATH + "CompareTextsInShapes", true)) { var fo = fso.CreateTextFile(fso.BuildPath(folderDst, pge.Name + ".txt"), true, true); ungroupShapes(pge); @@ -245,7 +251,8 @@ function UnpackFolder(fileSrc, folderDst, pbChanged, pSubcode) { fo.WriteLine(translate(MsgCannotGetMacros)); fo.Close(); } else { - for (var it = new Enumerator(doc.VBProject.VBComponents), cmp = it.item(); !it.atEnd(); it.moveNext(), cmp = it.item()) { + for (var it = new Enumerator(doc.VBProject.VBComponents); !it.atEnd(); it.moveNext()) { + var cmp = it.item(); cmp.Export(fso.BuildPath(folderDst, cmp.Name + getModuleExtension(cmp))); } } diff --git a/Plugins/dlls/CompareMSWordFiles.sct b/Plugins/dlls/CompareMSWordFiles.sct index 052a1681891..b9843e609c3 100644 --- a/Plugins/dlls/CompareMSWordFiles.sct +++ b/Plugins/dlls/CompareMSWordFiles.sct @@ -76,7 +76,8 @@ function regWrite(Key, Value, TypeNm) { function writeObjectProperties(fo, items) { try { - for (var it = new Enumerator(items), o = it.item(); !it.atEnd(); it.moveNext(), o = it.item()) { + for (var it = new Enumerator(items); !it.atEnd(); it.moveNext()) { + var o = it.item(); try { fo.WriteLine(o.Name + ": " + o.Value); } catch (e) {} @@ -86,7 +87,8 @@ function writeObjectProperties(fo, items) { function writeBookmarks(fo, items) { try { - for (var it = new Enumerator(items), o = it.item(); !it.atEnd(); it.moveNext(), o = it.item()) { + for (var it = new Enumerator(items); !it.atEnd(); it.moveNext()) { + var o = it.item(); fo.WriteLine(o.Name + ": " + o.Start); } } catch (e) {} @@ -97,8 +99,9 @@ function ungroupShapes(doc) { var cnt; do { cnt = doc.Shapes.Count; - for (var it = new Enumerator(doc.Shapes), shp = it.item(); !it.atEnd(); it.moveNext(), shp = it.item()) { + for (var it = new Enumerator(doc.Shapes); !it.atEnd(); it.moveNext()) { try { + var shp = it.item(); if (shp.Type === pbGroup) { shp.Ungroup(); } @@ -110,8 +113,9 @@ function ungroupShapes(doc) { function writeTextsInShapes(fo, doc) { try { - for (var it = new Enumerator(doc.Shapes), shp = it.item(); !it.atEnd(); it.moveNext(), shp = it.item()) { + for (var it = new Enumerator(doc.Shapes); !it.atEnd(); it.moveNext()) { try { + var shp = it.item(); fo.WriteLine(shp.Name + ": " + shp.TextFrame.TextRange.Text); } catch (e) {} } @@ -166,7 +170,7 @@ function UnpackFile(fileSrc, fileDst, pbChanged, pSubcode) { throw new Error(30001, "CompareMSWordFiles.sct: " + fileSrc + ": Target file '" + fileSrc2 + "' not found"); } } - var doc = wd.Documents.Open(fileSrc2, true, true); + var doc = wd.Documents.Open(fileSrc2, -1, -1); if (regRead(REGKEY_PATH + "CompareDocumentProperties", false)) { fo.WriteLine("[Document Properties]"); @@ -197,7 +201,8 @@ function UnpackFile(fileSrc, fileDst, pbChanged, pSubcode) { if (!isAccessibleVBAProject(doc)) { fo.WriteLine(translate(MsgCannotGetMacros)); } else { - for (var it = new Enumerator(doc.VBProject.VBComponents), cmp = it.item(); !it.atEnd(); it.moveNext(), cmp = it.item()) { + for (var it = new Enumerator(doc.VBProject.VBComponents); !it.atEnd(); it.moveNext()) { + var cmp = it.item(); fo.WriteLine("[CodeModule." + cmp.Name + "]"); if (cmp.CodeModule.CountOfLines > 0) { fo.WriteLine(cmp.CodeModule.Lines(1, cmp.CodeModule.CountOfLines)); @@ -247,7 +252,7 @@ function UnpackFolder(fileSrc, folderDst, pbChanged, pSubcode) { throw new Error(30001, "CompareMSWordFiles.sct: " + fileSrc + ": Target file '" + fileSrc2 + "' not found"); } } - var doc = wd.Documents.Open(fileSrc2); + var doc = wd.Documents.Open(fileSrc2, -1, -1); if (regRead(REGKEY_PATH + "CompareDocumentProperties", false)) { var fo = fso.CreateTextFile(fso.BuildPath(folderDst, "(0)DocumentProperties.txt"), true, true); @@ -283,7 +288,8 @@ function UnpackFolder(fileSrc, folderDst, pbChanged, pSubcode) { fo.WriteLine(translate(MsgCannotGetMacros)); fo.Close(); } else { - for (var it = new Enumerator(doc.VBProject.VBComponents), cmp = it.item(); !it.atEnd(); it.moveNext(), cmp = it.item()) { + for (var it = new Enumerator(doc.VBProject.VBComponents); !it.atEnd(); it.moveNext()) { + var cmp = it.item(); cmp.Export(fso.BuildPath(folderDst, cmp.Name + getModuleExtension(cmp))); } } From 9a685b8e140d989fae88a8346478f683611bb5af Mon Sep 17 00:00:00 2001 From: Takashi Sawanaka Date: Thu, 8 Feb 2024 21:39:15 +0900 Subject: [PATCH 30/58] WIP --- Plugins/dlls/CompareMSPowerPointFiles.sct | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/Plugins/dlls/CompareMSPowerPointFiles.sct b/Plugins/dlls/CompareMSPowerPointFiles.sct index 9cffae4d202..2e409aba70d 100644 --- a/Plugins/dlls/CompareMSPowerPointFiles.sct +++ b/Plugins/dlls/CompareMSPowerPointFiles.sct @@ -78,8 +78,8 @@ function writeObjectProperties(fo, items) { try { var o = it.item(); fo.WriteLine(o.Name + ": " + o.Value); + o = null; } catch (e) {} - o = null; } } catch (e) {} } @@ -109,11 +109,12 @@ function writeShape(fo, shp) { } catch (e) {} } -function writeTextsInShapes(fo, shps) { +function writeTextsInShapes(fo, p) { try { - for (var it = new Enumerator(shps); !it.atEnd(); it.moveNext()) { + for (var it = new Enumerator(p.Shapes); !it.atEnd(); it.moveNext()) { var shp = it.item(); writeShape(fo, shp); + shp = null; } } catch (e) {} } @@ -184,12 +185,12 @@ function UnpackFile(fileSrc, fileDst, pbChanged, pSubcode) { var sld = it.item(); if (regRead(REGKEY_PATH + "CompareTextsInShapes", true)) { fo.WriteLine("[" + sld.Name + "]"); - writeTextsInShapes(fo, sld.Shapes); + writeTextsInShapes(fo, sld); fo.WriteLine(""); } if (regRead(REGKEY_PATH + "CompareTextsInNotesPage", true)) { fo.WriteLine("[" + sld.Name + ".NotesPage]"); - writeTextsInShapes(fo, sld.NotesPage.Shapes); + writeTextsInShapes(fo, sld.NotesPage); fo.WriteLine(""); } sld = null; @@ -262,13 +263,13 @@ function UnpackFolder(fileSrc, folderDst, pbChanged, pSubcode) { var sld = it.item(); if (regRead(REGKEY_PATH + "CompareTextsInShapes", true)) { var fo = fso.CreateTextFile(fso.BuildPath(folderDst, sld.Name + ".txt"), true, true); - writeTextsInShapes(fo, sld.Shapes); + writeTextsInShapes(fo, sld); fo.Close(); } if (regRead(REGKEY_PATH + "CompareTextsInNotesPage", true)) { var fo = fso.CreateTextFile(fso.BuildPath(folderDst, sld.Name + "_NotesPage.txt"), true, true); - writeTextsInShapes(fo, sld.NotesPage.Shapes); + writeTextsInShapes(fo, sld.NotesPage); fo.Close(); } From 34c0dc93ed6e38c9a22cd56f40be7d2e928c96cf Mon Sep 17 00:00:00 2001 From: Takashi Sawanaka Date: Fri, 9 Feb 2024 08:04:38 +0900 Subject: [PATCH 31/58] WIP --- Plugins/dlls/CompareMSExcelFiles.sct | 4 ++++ Plugins/dlls/CompareMSPowerPointFiles.sct | 4 ++++ Plugins/dlls/CompareMSVisioFiles.sct | 4 ++++ Plugins/dlls/CompareMSWordFiles.sct | 4 ++++ Testing/PluginTests/PluginTests.js | 6 ++++++ 5 files changed, 22 insertions(+) diff --git a/Plugins/dlls/CompareMSExcelFiles.sct b/Plugins/dlls/CompareMSExcelFiles.sct index 8cb2a02cdf9..a51c95d886a 100644 --- a/Plugins/dlls/CompareMSExcelFiles.sct +++ b/Plugins/dlls/CompareMSExcelFiles.sct @@ -500,6 +500,8 @@ function UnpackFile(fileSrc, fileDst, pbChanged, pSubcode) { pbChanged = true; pSubcode = 0; + CollectGarbage(); + var result = new ActiveXObject("Scripting.Dictionary"); result.Add(0, true); result.Add(1, pbChanged); @@ -613,6 +615,8 @@ function UnpackFolder(fileSrc, folderDst, pbChanged, pSubcode) { pbChanged = true; pSubcode = 0; + CollectGarbage(); + var result = new ActiveXObject("Scripting.Dictionary"); result.Add(0, true); result.Add(1, pbChanged); diff --git a/Plugins/dlls/CompareMSPowerPointFiles.sct b/Plugins/dlls/CompareMSPowerPointFiles.sct index 2e409aba70d..b1d4f72f410 100644 --- a/Plugins/dlls/CompareMSPowerPointFiles.sct +++ b/Plugins/dlls/CompareMSPowerPointFiles.sct @@ -222,6 +222,8 @@ function UnpackFile(fileSrc, fileDst, pbChanged, pSubcode) { pbChanged = true; pSubcode = 0; + CollectGarbage(); + var result = new ActiveXObject("Scripting.Dictionary"); result.Add(0, true); result.Add(1, pbChanged); @@ -301,6 +303,8 @@ function UnpackFolder(fileSrc, folderDst, pbChanged, pSubcode) { pbChanged = true; pSubcode = 0; + CollectGarbage(); + var result = new ActiveXObject("Scripting.Dictionary"); result.Add(0, true); result.Add(1, pbChanged); diff --git a/Plugins/dlls/CompareMSVisioFiles.sct b/Plugins/dlls/CompareMSVisioFiles.sct index e808eed9e18..bc22a375cb7 100644 --- a/Plugins/dlls/CompareMSVisioFiles.sct +++ b/Plugins/dlls/CompareMSVisioFiles.sct @@ -201,6 +201,8 @@ function UnpackFile(fileSrc, fileDst, pbChanged, pSubcode) { pbChanged = true; pSubcode = 0; + CollectGarbage(); + var result = new ActiveXObject("Scripting.Dictionary"); result.Add(0, true); result.Add(1, pbChanged); @@ -268,6 +270,8 @@ function UnpackFolder(fileSrc, folderDst, pbChanged, pSubcode) { pbChanged = true; pSubcode = 0; + CollectGarbage(); + var result = new ActiveXObject("Scripting.Dictionary"); result.Add(0, true); result.Add(1, pbChanged); diff --git a/Plugins/dlls/CompareMSWordFiles.sct b/Plugins/dlls/CompareMSWordFiles.sct index b9843e609c3..b2af4147d0a 100644 --- a/Plugins/dlls/CompareMSWordFiles.sct +++ b/Plugins/dlls/CompareMSWordFiles.sct @@ -224,6 +224,8 @@ function UnpackFile(fileSrc, fileDst, pbChanged, pSubcode) { pbChanged = true; pSubcode = 0; + CollectGarbage(); + var result = new ActiveXObject("Scripting.Dictionary"); result.Add(0, true); result.Add(1, pbChanged); @@ -304,6 +306,8 @@ function UnpackFolder(fileSrc, folderDst, pbChanged, pSubcode) { pbChanged = true; pSubcode = 0; + CollectGarbage(); + var result = new ActiveXObject("Scripting.Dictionary"); result.Add(0, true); result.Add(1, pbChanged); diff --git a/Testing/PluginTests/PluginTests.js b/Testing/PluginTests/PluginTests.js index c456db31cb6..9cb72d2e29b 100644 --- a/Testing/PluginTests/PluginTests.js +++ b/Testing/PluginTests/PluginTests.js @@ -117,7 +117,9 @@ function CompareMSExcelFilesTest() { var subcode = 0; p.PluginOnEvent(0, MergeApp); p.UnpackFile(ScriptFolder + "\\..\\Data\\Office\\excel.xls", ScriptFolder + "\\result\\excel.xls.tsv", changed, subcode); + CollectGarbage(); p.UnpackFolder(ScriptFolder + "\\..\\Data\\Office\\excel.xls", ScriptFolder + "\\result\\excel\\", changed, subcode); + CollectGarbage(); p.PluginOnEvent(1, MergeApp); } @@ -128,7 +130,9 @@ function CompareMSWordFilesTest() { var subcode = 0; p.PluginOnEvent(0, MergeApp); p.UnpackFile(ScriptFolder + "\\..\\Data\\Office\\word.doc", ScriptFolder + "\\result\\word.doc.txt", changed, subcode); + CollectGarbage(); p.UnpackFolder(ScriptFolder + "\\..\\Data\\Office\\word.doc", ScriptFolder + "\\result\\word\\", changed, subcode); + CollectGarbage(); p.PluginOnEvent(1, MergeApp); } @@ -139,7 +143,9 @@ function CompareMSPowerPointFilesTest() { var subcode = 0; p.PluginOnEvent(0, MergeApp); p.UnpackFile(ScriptFolder + "\\..\\Data\\Office\\powerpnt.ppt", ScriptFolder + "\\result\\powerpnt.ppt.txt", changed, subcode); + CollectGarbage(); p.UnpackFolder(ScriptFolder + "\\..\\Data\\Office\\powerpnt.ppt", ScriptFolder + "\\result\\powerpnt\\", changed, subcode); + CollectGarbage(); p.PluginOnEvent(1, MergeApp); } From 32f86c72805d1a6b06655c5cf51222cd838f0b55 Mon Sep 17 00:00:00 2001 From: Takashi Sawanaka Date: Fri, 9 Feb 2024 08:09:44 +0900 Subject: [PATCH 32/58] WIP --- Testing/PluginTests/result/excel.xls.txt | Bin 2740 -> 0 bytes Testing/PluginTests/result/excel/(0)Names.txt | 1 - .../result/excel/(1)Sheet1(1-1).png | Bin 31086 -> 0 bytes .../PluginTests/result/excel/(1)Sheet1.tsv | Bin 130 -> 0 bytes .../excel/(1)Sheet1_HeadersAndFooters.txt | Bin 242 -> 0 bytes .../result/excel/(1)Sheet1_Shapes.txt | Bin 180 -> 0 bytes .../result/excel/(2)Sheet2(1-1).png | Bin 282 -> 0 bytes .../PluginTests/result/excel/(2)Sheet2.tsv | Bin 8 -> 0 bytes .../excel/(2)Sheet2_HeadersAndFooters.txt | Bin 182 -> 0 bytes .../result/excel/(2)Sheet2_Shapes.txt | 1 - .../result/excel/(3)Sheet3(1-1).png | Bin 430 -> 0 bytes .../PluginTests/result/excel/(3)Sheet3.tsv | Bin 8 -> 0 bytes .../excel/(3)Sheet3_HeadersAndFooters.txt | Bin 182 -> 0 bytes .../result/excel/(3)Sheet3_Shapes.txt | 1 - .../result/excel/(4)Sheet4(1-1).png | Bin 1151 -> 0 bytes .../PluginTests/result/excel/(4)Sheet4.tsv | Bin 70 -> 0 bytes .../excel/(4)Sheet4_HeadersAndFooters.txt | Bin 182 -> 0 bytes .../result/excel/(4)Sheet4_Shapes.txt | 1 - .../result/excel/(5)Sheet5(1-1).png | Bin 704 -> 0 bytes .../PluginTests/result/excel/(5)Sheet5.tsv | Bin 12 -> 0 bytes .../excel/(5)Sheet5_HeadersAndFooters.txt | Bin 182 -> 0 bytes .../result/excel/(5)Sheet5_Shapes.txt | 1 - .../result/excel/(6)Sheet6(1-1).png | Bin 1154 -> 0 bytes .../PluginTests/result/excel/(6)Sheet6.tsv | Bin 38 -> 0 bytes .../excel/(6)Sheet6_HeadersAndFooters.txt | Bin 182 -> 0 bytes .../result/excel/(6)Sheet6_Shapes.txt | 1 - Testing/PluginTests/result/excel/Sheet1.bas | 12 --- Testing/PluginTests/result/excel/Sheet2.bas | 9 -- Testing/PluginTests/result/excel/Sheet3.bas | 9 -- Testing/PluginTests/result/excel/Sheet4.bas | 9 -- Testing/PluginTests/result/excel/Sheet5.bas | 9 -- Testing/PluginTests/result/excel/Sheet6.bas | 9 -- .../PluginTests/result/excel/ThisWorkbook.bas | 9 -- Testing/PluginTests/result/powerpnt.ppt.txt | Bin 1730 -> 0 bytes .../result/powerpnt/CannotGetMacros.bas | Bin 514 -> 0 bytes .../PluginTests/result/powerpnt/Slide1.png | Bin 2895 -> 0 bytes .../PluginTests/result/powerpnt/Slide1.txt | Bin 64 -> 0 bytes .../result/powerpnt/Slide1_NotesPage.txt | Bin 168 -> 0 bytes Testing/PluginTests/result/word.doc.txt | Bin 2254 -> 0 bytes .../PluginTests/result/word/(0)Bookmarks.txt | 1 - .../result/word/CannotGetMacros.bas | Bin 514 -> 0 bytes Testing/PluginTests/result/word/Document.htm | 99 ------------------ Testing/PluginTests/result/word/Document.txt | Bin 442 -> 0 bytes Testing/PluginTests/result/word/Shapes.txt | Bin 118 -> 0 bytes .../PluginTests/result/word/ThisDocument.bas | 9 -- 45 files changed, 181 deletions(-) delete mode 100644 Testing/PluginTests/result/excel.xls.txt delete mode 100644 Testing/PluginTests/result/excel/(0)Names.txt delete mode 100644 Testing/PluginTests/result/excel/(1)Sheet1(1-1).png delete mode 100644 Testing/PluginTests/result/excel/(1)Sheet1.tsv delete mode 100644 Testing/PluginTests/result/excel/(1)Sheet1_HeadersAndFooters.txt delete mode 100644 Testing/PluginTests/result/excel/(1)Sheet1_Shapes.txt delete mode 100644 Testing/PluginTests/result/excel/(2)Sheet2(1-1).png delete mode 100644 Testing/PluginTests/result/excel/(2)Sheet2.tsv delete mode 100644 Testing/PluginTests/result/excel/(2)Sheet2_HeadersAndFooters.txt delete mode 100644 Testing/PluginTests/result/excel/(2)Sheet2_Shapes.txt delete mode 100644 Testing/PluginTests/result/excel/(3)Sheet3(1-1).png delete mode 100644 Testing/PluginTests/result/excel/(3)Sheet3.tsv delete mode 100644 Testing/PluginTests/result/excel/(3)Sheet3_HeadersAndFooters.txt delete mode 100644 Testing/PluginTests/result/excel/(3)Sheet3_Shapes.txt delete mode 100644 Testing/PluginTests/result/excel/(4)Sheet4(1-1).png delete mode 100644 Testing/PluginTests/result/excel/(4)Sheet4.tsv delete mode 100644 Testing/PluginTests/result/excel/(4)Sheet4_HeadersAndFooters.txt delete mode 100644 Testing/PluginTests/result/excel/(4)Sheet4_Shapes.txt delete mode 100644 Testing/PluginTests/result/excel/(5)Sheet5(1-1).png delete mode 100644 Testing/PluginTests/result/excel/(5)Sheet5.tsv delete mode 100644 Testing/PluginTests/result/excel/(5)Sheet5_HeadersAndFooters.txt delete mode 100644 Testing/PluginTests/result/excel/(5)Sheet5_Shapes.txt delete mode 100644 Testing/PluginTests/result/excel/(6)Sheet6(1-1).png delete mode 100644 Testing/PluginTests/result/excel/(6)Sheet6.tsv delete mode 100644 Testing/PluginTests/result/excel/(6)Sheet6_HeadersAndFooters.txt delete mode 100644 Testing/PluginTests/result/excel/(6)Sheet6_Shapes.txt delete mode 100644 Testing/PluginTests/result/excel/Sheet1.bas delete mode 100644 Testing/PluginTests/result/excel/Sheet2.bas delete mode 100644 Testing/PluginTests/result/excel/Sheet3.bas delete mode 100644 Testing/PluginTests/result/excel/Sheet4.bas delete mode 100644 Testing/PluginTests/result/excel/Sheet5.bas delete mode 100644 Testing/PluginTests/result/excel/Sheet6.bas delete mode 100644 Testing/PluginTests/result/excel/ThisWorkbook.bas delete mode 100644 Testing/PluginTests/result/powerpnt.ppt.txt delete mode 100644 Testing/PluginTests/result/powerpnt/CannotGetMacros.bas delete mode 100644 Testing/PluginTests/result/powerpnt/Slide1.png delete mode 100644 Testing/PluginTests/result/powerpnt/Slide1.txt delete mode 100644 Testing/PluginTests/result/powerpnt/Slide1_NotesPage.txt delete mode 100644 Testing/PluginTests/result/word.doc.txt delete mode 100644 Testing/PluginTests/result/word/(0)Bookmarks.txt delete mode 100644 Testing/PluginTests/result/word/CannotGetMacros.bas delete mode 100644 Testing/PluginTests/result/word/Document.htm delete mode 100644 Testing/PluginTests/result/word/Document.txt delete mode 100644 Testing/PluginTests/result/word/Shapes.txt delete mode 100644 Testing/PluginTests/result/word/ThisDocument.bas diff --git a/Testing/PluginTests/result/excel.xls.txt b/Testing/PluginTests/result/excel.xls.txt deleted file mode 100644 index 5e7f86224a53100e741dc9d49eeb7aa39a679e07..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2740 zcmd^B%T59@6g^u^{D%n(qA?N}9zk}9pbIfXG%kpXL0$$01DN=0{($kT)N|Volv3lw zrDoEZ_V(P<+tc1@KR>#-K!isOu)r;Lv7<^C9gJxkV2Ql3N9f@WDL!fSES1mFw8R?G zTQEE5vu{X?@QFvt)ZTKhx%XV$j%e?(2y0&<2CSv%nZii5`>L(Ig=;getco(ilZr$~ zf5rL>qdvxr-+<9q`IgyeTwd|IsL(-$LooU@mb_)yE#T zHlrPpAwULgg^kCxW0G-)R*derE_R!B9f6C@;6#lpoc10F&EC}Ov)$|4AwHC?$#3*_ z=W6qbF4DiAov-&hMO|iBnN4P2uOMvA3P!Vm`;PpQ`l^aE&Ww+yQMz${rx(H)Qt9TDa>`Or*G={*&URRc2?YoKLq>BHaY_pL8o5 z-5NYOhCLBr*?9FO2+qj2Y6sT%e)@*lw9CO zDLdgmK+fce(Om24_uRfub;v6JkoX?8hkdor1KQ+iah%cW9+QT?JLx-BL){4EULzdq e?D%Qy_`FOOX?#*7L&yKfWav1*lcD2XE$A;}c%dx- diff --git a/Testing/PluginTests/result/excel/(0)Names.txt b/Testing/PluginTests/result/excel/(0)Names.txt deleted file mode 100644 index 46b134b197f..00000000000 --- a/Testing/PluginTests/result/excel/(0)Names.txt +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/Testing/PluginTests/result/excel/(1)Sheet1(1-1).png b/Testing/PluginTests/result/excel/(1)Sheet1(1-1).png deleted file mode 100644 index c279f471f1d1c70240ea7113da62ac999634ce0b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 31086 zcmc$_by$>N_cyB2N_Tfimvl*YgMf62(jhQIOE=OW2m&JA4MUeSNTYO#^iVS}z`61J zJkRer*SXF)@B7#L2Nw*p?|tvR;s-F~9tTf=R~wZQLBVZegsfU$K&+gvel63zMJ{S?YfHxc z#fgmmIO*lDNZk4My3J0P3ITpg7WL%GuOF#$Zd!B3N6DAlvVNVFH@q1$phXX+MbBTT zv7aqXX9NR(2R{!lH)|*V_un74FdhbE$Rx1>K%{1*LP2+% z_c0#>9i6n9EH1J(4ETD30FQzqromx8-+g;HlQ;0rudly<$QTz{nve^a1t#aXQ2ki< zo7xAJ!eLAz_3Kw!QBiU_I=W2WcRv_0$@t_}9#-T^H$>3KLeI;KXWZmG zR$f~5s)BqtjWg!m^tb<>+tAR^qATdJ%%%7fBqUy|KJ-{h5uN{GpaS`_bNI7~9=2~s zgpZHUH&R!{0E{sNUU!O7Q(xa#ZP{DxFwdn|@mjy{SBpp3=;p>opOjKz_F%bDU7znR zpx`^~huwyj8#iGysibrzF{yreRVF{0$*&k0aC?10%4ehWMkK*@B+c>;0f(*tYob8| z3_+4EhJ>5g35t*xc)GK*lfi3^dI#IYp#$tFvL_hWe=hC{b8fr0M7nrYnt7WSXE-($ zTe`|5gEt@#JC90Da7|P^*RM4wMFuG;H!$) zVO5=Xuj{+pnwuln^e@<7m3QSx`11I{PDb6S0sFyodQe;-+CTH|iaIzrWJ~xG&z9;F zbfe_vz}?-p?rw5f?NGWmgMas?IZJEF$RLG)PG#g=U8_x0aFG-FX_(+$ zT`%=YbWjo#6WuYS{nj@6V*peCm?0H-CmwKr>&;t*MH3@IOZ(D{O<3GG@apI@1esF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4(^s&U7xJqEV z4?0jxWEtiGSm^4tzd0NOJQp|si9FSJV+FE(a*5Rm&?u|=jf18Svd*fT$xD5a zhbqye_E$lcMs9k*nyURM*o1;I9%GuTd zY$9j)@MBBULL+4FEEQS1$ic#eQUWE+GgGSp(P6(vb+r%VmsOYCo)uR=Bwb}5^zFE9 zrqD%6JCle9_bvA>UDB80Ge;v^OiEiqORt?$=}R81OPpe-&{AZ(H7` zx5Q^vXPw{sQe|!5oG4`?chN?O{Oh~bmh9I=YR8uFou;E4lx$vo zL!rS01Lgk0f0g@xcNy$3gtM3rQ~PH4UwyP$DaYt7Zw`A;(!~YQ34s=LjrS~I^S^Z? zi4){cK(10hhi1PqzR|n&)i}FDf!H|~gk=I^BHU}wQ|^CyFyDYS0AfTbwqQErs%VsW z&kWFNE-=J)xLqg~qAFhw|E5ZwyYe>1dN7l;G-3Saa;t6QSkfAEE`|fR&Wr#y(ci$7 z?P0L)uvJ1S-TQpQl+$Pz*^ddn`7G1(wbeV?j<#0lyk0aiN4_+Nw(eVv3;W;B<{LC0 zg`NH3pSL$69q^I0yI&NuM4HDyj07J=)FYXe_zNel+` zQ2L)F3F!3M#LcGU8$*M_g&b`};AyJmWlRELdSkMm_)S#ODJ<|u*80E4pMIka_xueP*PkFLP`VtE2HqR8uR#oP+P}-Xsz0XqrRzCk0n69tmHsLSJbm-~m@YU7TMF@a~ zLvK{>pP69D?+^m7VF%;G<%z`!PHNz~1<;T3u@g?WHDCwC(PAN@mhcUei=jrF*HrUW zdhD|H4h|qKvdDp&$gf|&UMeV{$Hm3H0F*jU0iXvf$3rS04NFixilhL!;NRVY|B{R& uzTOsVmzZB-BK`Fza}usyqSJHxU@c7jE=6(L0O*nYL|#Vab-9#j;Qs(!$jx^E diff --git a/Testing/PluginTests/result/excel/(1)Sheet1.tsv b/Testing/PluginTests/result/excel/(1)Sheet1.tsv deleted file mode 100644 index 2be88251fe7734bb778513fd38fb98b9fb39e46c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 130 zcmezWFOeaMA(?>_2$jIFgdvron4tv91BoUwaDmluF{A+H(tskoKoO7*PAKb`!A^q{ h1~7giP&^5UL8hjFRipx0oIstN4C!Eg3YZVk4FJbL4}bsw diff --git a/Testing/PluginTests/result/excel/(1)Sheet1_HeadersAndFooters.txt b/Testing/PluginTests/result/excel/(1)Sheet1_HeadersAndFooters.txt deleted file mode 100644 index aabbcdaf14eaa515f27c0521e0deb8a30734a51f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 242 zcmezW&xawEA&sGg!2?JqGNb^>A_gl41%?bHJ}(0ogENqy2UG`=M^~%H;Kl$_6U30o zkPg&|X<7i#>~x@B1qL;S0I*t^y>1NoKnO7xWN#W0AKhMbwV0+NT!5}tjll(MF94Jv BD3kyI diff --git a/Testing/PluginTests/result/excel/(1)Sheet1_Shapes.txt b/Testing/PluginTests/result/excel/(1)Sheet1_Shapes.txt deleted file mode 100644 index a71a5af2aa7e7b4bdab084e51c8c656bfb281091..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 180 zcmezWFN7hLp@N}=!HFRsNGmWHGFSo0V1^8aM1}&OoFM}*0~Z6jDkC&iMnKgH4DJj? jKvPPA`mpOV#?Y07MVANA)Nn{1`Jpz0}T>t<7zjyE6_wV1YTepszoBP6r3)7}e14`bxbEl!9p}4qMSXlV# z)vMat+UL%l`~Ca3hK9!Z^XJvn)Kpbf|NZ-SlBSEK+1%{^TlLoEE0C0L!=4U8NmMVQ>m_%ynW4jl7S zZMN9CB1M3?+2AVAqh=!w*2QdsY*&ohUo|u`GAK7OD)?ls?f@FW;OXk;vd$@?2>{SP BaGU@D diff --git a/Testing/PluginTests/result/excel/(2)Sheet2.tsv b/Testing/PluginTests/result/excel/(2)Sheet2.tsv deleted file mode 100644 index ca9053508c38ce794241a50d536ce683f2f662f4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8 PcmezW&yazafr|kE5MTmE diff --git a/Testing/PluginTests/result/excel/(2)Sheet2_HeadersAndFooters.txt b/Testing/PluginTests/result/excel/(2)Sheet2_HeadersAndFooters.txt deleted file mode 100644 index fd9e062162f0e802be6cb4d09e1f785ce6505003..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 182 zcmezW&xawEA&sGg!2?JqGNb^>A_gl41qNOQE(T{HFApdO62m4R#E{95&X9paH_T)= ThI}A|n1an@Z1M<`vB?4e!UrCp diff --git a/Testing/PluginTests/result/excel/(2)Sheet2_Shapes.txt b/Testing/PluginTests/result/excel/(2)Sheet2_Shapes.txt deleted file mode 100644 index 46b134b197f..00000000000 --- a/Testing/PluginTests/result/excel/(2)Sheet2_Shapes.txt +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/Testing/PluginTests/result/excel/(3)Sheet3(1-1).png b/Testing/PluginTests/result/excel/(3)Sheet3(1-1).png deleted file mode 100644 index 86595a359f5d8729ab91ab1db751503cbf405014..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 430 zcmeAS@N?(olHy`uVBq!ia0vp^9zZO_!3-qNt7SX^QjEnx?oJHr&dIz4a#+$GeH|GX zHuiJ>Nn{1`rv>kD|L@(;IN@ZrPc$&!si|GMbV*iL z_V@4KPo6wcQc^l}=#ad;{Oi}RtE#GI&Yb!5>C?u>#@^muX=&+~FJHcY|2`xn1Zc3g zx3{04pN)+TGc$8_b@ko5ce%K@7A;ydd-m*Evu4ekH?Os|_1?XE3JMBWuUw@CM9y57fl}%x9FJ;wd=cN^-DBPA_gl41qNOQE(T{HFApdO62m4R#E{95&X9paH_T)= ThI}A|n1an@Z1M<`vB?4e!UrCp diff --git a/Testing/PluginTests/result/excel/(3)Sheet3_Shapes.txt b/Testing/PluginTests/result/excel/(3)Sheet3_Shapes.txt deleted file mode 100644 index 46b134b197f..00000000000 --- a/Testing/PluginTests/result/excel/(3)Sheet3_Shapes.txt +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/Testing/PluginTests/result/excel/(4)Sheet4(1-1).png b/Testing/PluginTests/result/excel/(4)Sheet4(1-1).png deleted file mode 100644 index fa9064d5df2da6fa16e9708803ae810f815c22f6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1151 zcmeAS@N?(olHy`uVBq!ia0vp^K0qwQ!3-piojoxRNHG=%xjQkeJ16rJ$YDu$^mSxl z*x1kgCy^B>_bI?9#P$FG|F2)a-oJnU)vH&}pFjWi@84OoW^LKB<-vmoRaI4GWo1vF zK3%b5#gQXN5)u+-&YXGp@Zk?1K5XB<{nxKw|Ni~kv17;DwQIkA{rdg;_lAZBKR>^y zsHjbwHZ5GZP)kc|_UzeQTwL+-@hK@O2M!#ltgO6z`Ep4~$@AyWSFT(c78cgm*Z1PZ z3l(%ciEL^78Uy$Bro}Dc!tzbHaoPlO|0H4h}we@L*O}*6P)(_w3md z6BDy_>sBu>ugJ*A6DLlzwzd`*7vH&aM_E~U*|KG6X=x%NBD}o33JMBKmMl?MS6{GT zL1AH`o10rfL4miocVlCtrKP2jkoqksw{6?T&(DAH;zd(a(`V0~B_<}$n>Q~m zE^hkt>4JiSJ9qB%@bH*Ab*hz>)$QB2+uGVnOG_U;dQ@LuudS_p?b@|DbLN~ocW&v@ zr57$-m^*jwx^?SfV`C#CA}(FJR9jn{ot@p%(xRcE@#M*qprD{tt5&I~sC0C6czSwf zW@b*FJUKc#+TGp#8vy|UU0q$~=H{K9o$2Z6p`oF!z54q4-@bkO@#Dv# zLxN#t*Eo5`$yT@LtOI$G(v=YLo9_n& ubnh;|cYk$@?ydHA_gl41qNOQE(T{HFApdO62m4R#E{95&X9paH_T)= ThI}A|n1an@Z1M<`vB?4e!UrCp diff --git a/Testing/PluginTests/result/excel/(4)Sheet4_Shapes.txt b/Testing/PluginTests/result/excel/(4)Sheet4_Shapes.txt deleted file mode 100644 index 46b134b197f..00000000000 --- a/Testing/PluginTests/result/excel/(4)Sheet4_Shapes.txt +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/Testing/PluginTests/result/excel/(5)Sheet5(1-1).png b/Testing/PluginTests/result/excel/(5)Sheet5(1-1).png deleted file mode 100644 index 67ce0ad6331e30492ad7dcfc212257572274b6cb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 704 zcmeAS@N?(olHy`uVBq!ia0vp^9zZO_!3-qNt7SX^QjEnx?oJHr&dIz4a#+$GeH|GX zHuiJ>Nn{1eDFpb0xc>kD|M20%42ce;% zK)XCWJ@@Y2tEQ$lapJ@c8#bh;r=L1?%G})iTOf%$alR)-59=qv_M9tEi~#-o3lIxw*Q!`rf^J8X6iaSFW_Q zw2X;~Nls3lGG)rUcke7LETW^Mi;9Zs>gvM6!c0v~fByXW{{8#gw{Jgs^yt~MXIHOY z{rmSX&?C_b3Lq+>B*-rq7*@0d48^%moPl<67I;J!GcfQS24TkI`72U@f_pt(978Pp z-%c{*JFLLtTFb!pJ|+3nfi!)cduQhSj$fuyDz!xI!qQil)Lnl%p1ORTp?;rJtnHZ< z|K44E!l)3qO4TII&Wv9+>k;PxE(Iaip!gkbnTq}DSEoG?>;zcCG*b diff --git a/Testing/PluginTests/result/excel/(5)Sheet5.tsv b/Testing/PluginTests/result/excel/(5)Sheet5.tsv deleted file mode 100644 index cd493ac6239ef5d75017b84ed17bceefc0ca4112..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12 TcmezW&yYcn!H9vEfr|kE8@K|d diff --git a/Testing/PluginTests/result/excel/(5)Sheet5_HeadersAndFooters.txt b/Testing/PluginTests/result/excel/(5)Sheet5_HeadersAndFooters.txt deleted file mode 100644 index fd9e062162f0e802be6cb4d09e1f785ce6505003..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 182 zcmezW&xawEA&sGg!2?JqGNb^>A_gl41qNOQE(T{HFApdO62m4R#E{95&X9paH_T)= ThI}A|n1an@Z1M<`vB?4e!UrCp diff --git a/Testing/PluginTests/result/excel/(5)Sheet5_Shapes.txt b/Testing/PluginTests/result/excel/(5)Sheet5_Shapes.txt deleted file mode 100644 index 46b134b197f..00000000000 --- a/Testing/PluginTests/result/excel/(5)Sheet5_Shapes.txt +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/Testing/PluginTests/result/excel/(6)Sheet6(1-1).png b/Testing/PluginTests/result/excel/(6)Sheet6(1-1).png deleted file mode 100644 index 4673fc73bbe8ba8ebc6648d5505357720bb4873a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1154 zcmeAS@N?(olHy`uVBq!ia0vp^9zZO_!3-qNt7SX^QjEnx?oJHr&dIz4a#+$GeH|GX zHuiJ>Nn~YUVB!t%332`Z|NraPulMZP^YZ1(ef#!3e*F08(WAF--#&Ki*ww37Pn9-qKk`*rlzK!pI?7}e_C4Fgb5Q49Xh0|tGjF0 zE@NZkEnBuoOG~Gxr>|eX-q+W+q@<*vpdc(PtgfyO=<>FLSpOI zt%{0@2M->+bm@|zq2bAsC(X^xSFT*y*x1D!Q z*VkXVbZKN{WL#XFtE=nRuU|iY{HUOyU}ZopuCm#B_Kv%`pLCx{MCV%9cfm{ogB3O$Xr?XsUF5<@vNsDzG@`xIMuTx%GNKu zm;Hy)qaE%ckIw&k`PX%IAkzt(UsVlH8X^LXw>(wXaPLn2{cr8dm=ZX0MFUeE1b@Q8izggCq21eX}#mYo_YFr-~F0-i`URhV_l6k zH#f_k=MoqAFYFELx45Pt_}MnNM{dni3El8dmz+Akv40DDS>t9>Zh7|SkH%h3>DOzf oUOHgNS-803*SBZ!oiDgQU(MYA!0d4!FpL>IUHx3vIVCg!0DWSCu>b%7 diff --git a/Testing/PluginTests/result/excel/(6)Sheet6.tsv b/Testing/PluginTests/result/excel/(6)Sheet6.tsv deleted file mode 100644 index d3c9bf9d193171e0ddddee20706d32c845310ac2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 38 mcmezW&y}GF2=jqhm%)g^kimq(jKKoPG6rG`AfK0kiva+xUItMB diff --git a/Testing/PluginTests/result/excel/(6)Sheet6_HeadersAndFooters.txt b/Testing/PluginTests/result/excel/(6)Sheet6_HeadersAndFooters.txt deleted file mode 100644 index fd9e062162f0e802be6cb4d09e1f785ce6505003..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 182 zcmezW&xawEA&sGg!2?JqGNb^>A_gl41qNOQE(T{HFApdO62m4R#E{95&X9paH_T)= ThI}A|n1an@Z1M<`vB?4e!UrCp diff --git a/Testing/PluginTests/result/excel/(6)Sheet6_Shapes.txt b/Testing/PluginTests/result/excel/(6)Sheet6_Shapes.txt deleted file mode 100644 index 46b134b197f..00000000000 --- a/Testing/PluginTests/result/excel/(6)Sheet6_Shapes.txt +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/Testing/PluginTests/result/excel/Sheet1.bas b/Testing/PluginTests/result/excel/Sheet1.bas deleted file mode 100644 index 678f6efd8ae..00000000000 --- a/Testing/PluginTests/result/excel/Sheet1.bas +++ /dev/null @@ -1,12 +0,0 @@ -VERSION 1.0 CLASS -BEGIN - MultiUse = -1 'True -END -Attribute VB_Name = "Sheet1" -Attribute VB_GlobalNameSpace = False -Attribute VB_Creatable = False -Attribute VB_PredeclaredId = True -Attribute VB_Exposed = True -Sub test() - MsgBox "eXg" -End Sub diff --git a/Testing/PluginTests/result/excel/Sheet2.bas b/Testing/PluginTests/result/excel/Sheet2.bas deleted file mode 100644 index 9368fcbc336..00000000000 --- a/Testing/PluginTests/result/excel/Sheet2.bas +++ /dev/null @@ -1,9 +0,0 @@ -VERSION 1.0 CLASS -BEGIN - MultiUse = -1 'True -END -Attribute VB_Name = "Sheet2" -Attribute VB_GlobalNameSpace = False -Attribute VB_Creatable = False -Attribute VB_PredeclaredId = True -Attribute VB_Exposed = True diff --git a/Testing/PluginTests/result/excel/Sheet3.bas b/Testing/PluginTests/result/excel/Sheet3.bas deleted file mode 100644 index bf55a0db47c..00000000000 --- a/Testing/PluginTests/result/excel/Sheet3.bas +++ /dev/null @@ -1,9 +0,0 @@ -VERSION 1.0 CLASS -BEGIN - MultiUse = -1 'True -END -Attribute VB_Name = "Sheet3" -Attribute VB_GlobalNameSpace = False -Attribute VB_Creatable = False -Attribute VB_PredeclaredId = True -Attribute VB_Exposed = True diff --git a/Testing/PluginTests/result/excel/Sheet4.bas b/Testing/PluginTests/result/excel/Sheet4.bas deleted file mode 100644 index 3b5658440a1..00000000000 --- a/Testing/PluginTests/result/excel/Sheet4.bas +++ /dev/null @@ -1,9 +0,0 @@ -VERSION 1.0 CLASS -BEGIN - MultiUse = -1 'True -END -Attribute VB_Name = "Sheet4" -Attribute VB_GlobalNameSpace = False -Attribute VB_Creatable = False -Attribute VB_PredeclaredId = True -Attribute VB_Exposed = True diff --git a/Testing/PluginTests/result/excel/Sheet5.bas b/Testing/PluginTests/result/excel/Sheet5.bas deleted file mode 100644 index 5d56cc32a47..00000000000 --- a/Testing/PluginTests/result/excel/Sheet5.bas +++ /dev/null @@ -1,9 +0,0 @@ -VERSION 1.0 CLASS -BEGIN - MultiUse = -1 'True -END -Attribute VB_Name = "Sheet5" -Attribute VB_GlobalNameSpace = False -Attribute VB_Creatable = False -Attribute VB_PredeclaredId = True -Attribute VB_Exposed = True diff --git a/Testing/PluginTests/result/excel/Sheet6.bas b/Testing/PluginTests/result/excel/Sheet6.bas deleted file mode 100644 index 2e001954d69..00000000000 --- a/Testing/PluginTests/result/excel/Sheet6.bas +++ /dev/null @@ -1,9 +0,0 @@ -VERSION 1.0 CLASS -BEGIN - MultiUse = -1 'True -END -Attribute VB_Name = "Sheet6" -Attribute VB_GlobalNameSpace = False -Attribute VB_Creatable = False -Attribute VB_PredeclaredId = True -Attribute VB_Exposed = True diff --git a/Testing/PluginTests/result/excel/ThisWorkbook.bas b/Testing/PluginTests/result/excel/ThisWorkbook.bas deleted file mode 100644 index 71a359849aa..00000000000 --- a/Testing/PluginTests/result/excel/ThisWorkbook.bas +++ /dev/null @@ -1,9 +0,0 @@ -VERSION 1.0 CLASS -BEGIN - MultiUse = -1 'True -END -Attribute VB_Name = "ThisWorkbook" -Attribute VB_GlobalNameSpace = False -Attribute VB_Creatable = False -Attribute VB_PredeclaredId = True -Attribute VB_Exposed = True diff --git a/Testing/PluginTests/result/powerpnt.ppt.txt b/Testing/PluginTests/result/powerpnt.ppt.txt deleted file mode 100644 index db463067351349d4b78ac7847bab0b7361f472d0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1730 zcma)+OKuZU5JhW@#2$K%gxYo_ej{XrKoAlUM+_{G{7D>xf9h@ru@W}GKA6H<7_bB2 z+^TkLCw>lt?)EF+y7jxS{{HFOGn?DMmNvCBn^|R<9b18I!MWf(=3Cl(yK8r>!>O_f zmdD^^Il;4UAF&MhN7f}QL(b=5XMBf_dy2iX3wVn?s8`^>*k?x#iJInXgPC6Cybsxd zb4oQ6>ybfZzB|X)AWAS9-|cKw>05j+sj1|dQ(4BNuJy4;O^v$Jg-09H5k*|1d!Daq zI>b8gE|+kfd(0!g>e&E3&0tO+#H?THWaaE_EN5H1LqA1bnuanv@@Zt&v;$5}%jsmp z-%Wdn<&;Ub?H-m#Jb8_2f>EXGK9q1@dOoT{3Q_jAM>&A$wkRFys^Fi1luD#5)j8t4 z87=pm-fZ+b^PXkbbkeH(6H^|6DbP|{LC+mA_3jDvJO7sd%%3d#U)6&{>@%Jbx$RSI z=y2iaebIL1-zPsQGSu6$2TY>Dv=o0AUQr6qN$&->DLm62CEXqSZ46}0cNh1}r?JW< z-SZ3Q)BTptPOkB%{ie)say3^?yNCb4{TFo|;r)WH#O_h(`D}vC->wI~TRHi#9^l@EJ?D_RvGkeLsk6N{rv_-X{w8|R%I$u%PR~Wi{T%;`XBND diff --git a/Testing/PluginTests/result/powerpnt/CannotGetMacros.bas b/Testing/PluginTests/result/powerpnt/CannotGetMacros.bas deleted file mode 100644 index 68c9e3d768bbaafdd0efb8f95bdad9cb7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/PluginTests/result/powerpnt/Slide1.txt deleted file mode 100644 index f9ee31a6dd2405336ed84eade07e847d332a9d80..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 64 ycmezWZ@!aT&j)Ws*&ySV<-jMlms;qmtJGAUPG{508myOcmMzZ diff --git a/Testing/PluginTests/result/word.doc.txt b/Testing/PluginTests/result/word.doc.txt deleted file mode 100644 index 4f78ef6a5d77c5ca2f155d781296720e0f47d309..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2254 zcma)8OKuZE5Un*5cWAK+0<4LNfv`cr5FvpbgpGn^Wid1UB*gYuGvj>j!xph-jf6M^ zci;xVdsWl%C+#S*+C5WUUG?hK$Nu-XC$A)vROT{~flQ?oC+{VPY=-w7?3?~!Seg|2BH-~){)tBs1+sRSy&nM#g z083}^Q($HA=CH_00=Y%ePGw@{rzY?T`iL zFQl2G24k=rYjrY@-uAPKnGXE1`g6s5sh*9qCT_91Mw%%*3D@JkYOwaK1HxJ@oKLYB zq197Z&-#E|OwlL4J3`SVI444jX$Oq$ijOO#&zfZynf_+h=$o94^m_&l?M7XBegm&I z8_eD*a+N^4fMuc$M-{>o%8rvQ%m&uZF>DoD6YQ8m?yL1WqI{}2$P?$4pIT*wYcq!R z8=MNv*}RG`jGXg>RXkTlZi?~xBxR?u=4?i6M#lQ>$xB3(VNSA=a_oNU+G!WIE`Zjd z&zB?jT8CQeJm(DKgkiQ@ihwou0<5jeye=bja-ezTQwJW{6E>^Z%bZ<|g>0v4nSITB zee9egIXGJMJ0syF7-G+{n`h4DbD*nTNf!7V>>7>~TAc4>fs-%6yVV1&jp5N)UHIo* z<*!m951~KPd#p#+hsSh13hI*qMjT_=^k<%loRwvKTMX9Ulyjymc;@6TPy|S@d z9j0$sSYPD0rTe_X+66*Z)_RrOKZBcYF5B6z{z=&X24k5#ZK1zu!&RRaJdLy?E+DxF S4Kh>WiCV8KR?P|}T>k;_O?;gI diff --git a/Testing/PluginTests/result/word/(0)Bookmarks.txt b/Testing/PluginTests/result/word/(0)Bookmarks.txt deleted file mode 100644 index 46b134b197f..00000000000 --- a/Testing/PluginTests/result/word/(0)Bookmarks.txt +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/Testing/PluginTests/result/word/CannotGetMacros.bas b/Testing/PluginTests/result/word/CannotGetMacros.bas deleted file mode 100644 index 68c9e3d768bbaafdd0efb8f95bdad9cb7293d1c6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 514 zcmZXRQEJ0L3`FNU&^zn_N)OR|n-&_{@6?G?2iF_C4kedw^F~WBB?xx4l4dm0{{61C z)re)yN;+sCcSE$*M6~Eh4_cA4ZHOdt1D5rJ|Dhgq18xd*0`HoZ^IIosCvpjYVSMC$ zhS~8(Z=5gcupX3SmBC%+;C19HGRDl9dmdm&;Vt<^cY=2h- - - - - - - - - - - -

- -

What is WinMerge?

- -

WinMerge is an Open Source differencing -and merging tool for Windows. WinMerge can compare both folders and files, -presenting differences in a visual text format that is easy to understand and -handle.

- -

- - - - - - - - - - - - - - - - - -
- - - - -
-
-

What is WinMerge?

-

 

-
-
-
 
eLXg {bNX: WinMerge
- - 

- -
- - - - diff --git a/Testing/PluginTests/result/word/Document.txt b/Testing/PluginTests/result/word/Document.txt deleted file mode 100644 index 82e05a853e5df60e80e8cd8f8a18c67927d2dacc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 442 zcmZXROAf*?3`FMw+#v@*T!9lH7A#nYmKLOzA`*U=2c8|ZAfc*pJmb&UdB3(gC@L%H zsKmL&p0v_l7qy&A&Hk`4HWC@M)|oiFZ8YdgUWFf2Q>o#zO2$`SxrMR38rwV9PIxAN zPzTdsFW91{#=E0#F(F@lfx1OUMO2TL=>39r_?hWSwT_Oa#AY1(H+1emljfjj&r7Z~ zPn!Oxuz1^mO&s}e+!J$0SDwj#_&&=FJ-BVxl>F{_kC*gxX5hT~PKv?|S2i?S%QeK* IE_jidKH(ElKL7v# diff --git a/Testing/PluginTests/result/word/Shapes.txt b/Testing/PluginTests/result/word/Shapes.txt deleted file mode 100644 index 9bff1b8de9836be427eab1bf4a29a0a59d1f2868..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 118 zcmezW@0h__gPjH^3=|md7#ucO4`eGa7&2HfC@_RGWH2N$lmJr6CPN;BFGDIr b5koqVv}fQ2LoNnvW*9-uK-B}%!NmXomj4_J diff --git a/Testing/PluginTests/result/word/ThisDocument.bas b/Testing/PluginTests/result/word/ThisDocument.bas deleted file mode 100644 index d365bf6b19c..00000000000 --- a/Testing/PluginTests/result/word/ThisDocument.bas +++ /dev/null @@ -1,9 +0,0 @@ -VERSION 1.0 CLASS -BEGIN - MultiUse = -1 'True -END -Attribute VB_Name = "ThisDocument" -Attribute VB_GlobalNameSpace = False -Attribute VB_Creatable = False -Attribute VB_PredeclaredId = True -Attribute VB_Exposed = True From 5be85de9cc1d57f074a015d4b04261b91c8bdafb Mon Sep 17 00:00:00 2001 From: Takashi Sawanaka Date: Fri, 9 Feb 2024 08:28:46 +0900 Subject: [PATCH 33/58] WIP --- Plugins/dlls/PrediffLineFilter.sct | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plugins/dlls/PrediffLineFilter.sct b/Plugins/dlls/PrediffLineFilter.sct index 0f393432b12..03532c7bc1f 100644 --- a/Plugins/dlls/PrediffLineFilter.sct +++ b/Plugins/dlls/PrediffLineFilter.sct @@ -25,7 +25,7 @@ /* This is a plugin for WinMerge. It does almost the same thing as Substitution filters. - Copyright (C) 2018-2023 Takashi Sawanaka + Copyright (C) 2018-2024 Takashi Sawanaka This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by From 08468725294dff676d9539ba74a803c94a0d7934 Mon Sep 17 00:00:00 2001 From: Takashi Sawanaka Date: Fri, 9 Feb 2024 19:50:45 +0900 Subject: [PATCH 34/58] WIP --- Testing/PluginTests/PluginTests.js | 124 +++++++++++++++++++++++++++++ 1 file changed, 124 insertions(+) diff --git a/Testing/PluginTests/PluginTests.js b/Testing/PluginTests/PluginTests.js index 9cb72d2e29b..70f21662b7c 100644 --- a/Testing/PluginTests/PluginTests.js +++ b/Testing/PluginTests/PluginTests.js @@ -52,6 +52,34 @@ var PluginSettings = { "CompareDocumentsAsHTML": 1, "CompareTextsInShapes": 1, "CompareVBAMacros": 1 + }, + "PrediffLineFilter.sct": { + "Count": 5, + "Enabled1": 1, + "IgnoreCase1": 0, + "UseRegExp1": 0, + "Pattern1": "abc", + "ReplaceText1": "def", + "Enabled2": 1, + "IgnoreCase2": 1, + "UseRegExp2": 0, + "Pattern2": "Ghi", + "ReplaceText2": "Jkl", + "Enabled3": 1, + "IgnoreCase3": 0, + "UseRegExp3": 1, + "Pattern3": "\\d+\\.\\d+", + "ReplaceText3": "x.x", + "Enabled4": 1, + "IgnoreCase4": 1, + "UseRegExp4": 1, + "Pattern4": "Mno.*Z", + "ReplaceText4": "XxxX", + "Enabled5": 0, + "IgnoreCase5": 0, + "UseRegExp5": 0, + "Pattern5": "disabled", + "ReplaceText5": "" } } }; @@ -415,10 +443,106 @@ function IgnoreLeadingLineNumbersTest() { } +function PrediffLineFilterTest() { + var changed = false; + var text = ""; + var size; + var p = GetObject("script: " + ScriptFolder + "\\..\\..\\Plugins\\dlls\\PrediffLineFilter.sct"); + printPluginInfo(p); + + p.PluginOnEvent(0, MergeApp); + + // + setTestName("PrediffLineFilter"); + text = ""; + size = text.length; + changed = false; + var result = p.PrediffBufferW(text, size, changed); + if (typeof result !== "string") { text = result.getItem(1); size = result.getItem(2); changed = result.getItem(3); } + assertEquals("", text); + assertEquals(0, size); + assertEquals(false, changed); + + // + text = "abc def abc"; + size = text.length; + changed = false; + var result = p.PrediffBufferW(text, size, changed); + if (typeof result !== "string") { text = result.getItem(1); size = result.getItem(2); changed = result.getItem(3); } + assertEquals("def def def", text); + assertEquals(text.length, size); + assertEquals(true, changed); + + // + text = "gHI def Ghi"; + size = text.length; + changed = false; + var result = p.PrediffBufferW(text, size, changed); + if (typeof result !== "string") { text = result.getItem(1); size = result.getItem(2); changed = result.getItem(3); } + assertEquals("Jkl def Jkl", text); + assertEquals(text.length, size); + assertEquals(true, changed); + + // + text = "1.2 def 3.4"; + size = text.length; + changed = false; + var result = p.PrediffBufferW(text, size, changed); + if (typeof result !== "string") { text = result.getItem(1); size = result.getItem(2); changed = result.getItem(3); } + assertEquals("x.x def x.x", text); + assertEquals(text.length, size); + assertEquals(true, changed); + + // + text = "mnopqrstuvwxyz"; + size = text.length; + changed = false; + var result = p.PrediffBufferW(text, size, changed); + if (typeof result !== "string") { text = result.getItem(1); size = result.getItem(2); changed = result.getItem(3); } + assertEquals("XxxX", text); + assertEquals(4, size); + assertEquals(true, changed); + + // + text = "disabled"; + size = text.length; + changed = false; + var result = p.PrediffBufferW(text, size, changed); + if (typeof result !== "string") { text = result.getItem(1); size = result.getItem(2); changed = result.getItem(3); } + assertEquals("disabled", text); + assertEquals(text.length, size); + assertEquals(true, changed); + + // + text = "abc def abc\r\n"; + text += "gHI def GHI\r\n"; + text += "1.2 def 3.4\r\n"; + text += "mnopqrstuvwxyz\r\n"; + text += "disabled"; + size = text.length; + changed = false; + var result = p.PrediffBufferW(text, size, changed); + if (typeof result !== "string") { text = result.getItem(1); size = result.getItem(2); changed = result.getItem(3); } + var expected = + "def def def\r\n" + + "Jkl def Jkl\r\n" + + "x.x def x.x\r\n" + + "XxxX\r\n" + + "disabled"; + assertEquals(expected, text); + assertEquals(expected.length, size); + assertEquals(true, changed); + + p.PluginOnEvent(1, MergeApp); +} + EditorAddinTest(); InsertDateTimeTest(); IgnoreLeadingLineNumbersTest(); +PrediffLineFilterTest(); +/* CompareMSExcelFilesTest(); CompareMSWordFilesTest(); CompareMSPowerPointFilesTest(); +*/ From a046206133528adfef75dd8f1aba33e901dcb236 Mon Sep 17 00:00:00 2001 From: Takashi Sawanaka Date: Sat, 10 Feb 2024 11:50:40 +0900 Subject: [PATCH 35/58] WIP --- Testing/Data/Patch/file1.txt | 6 ++++++ Testing/Data/Patch/file2.txt | 6 ++++++ Testing/Data/Patch/patch.diff | 11 +++++++++++ 3 files changed, 23 insertions(+) create mode 100644 Testing/Data/Patch/file1.txt create mode 100644 Testing/Data/Patch/file2.txt create mode 100644 Testing/Data/Patch/patch.diff diff --git a/Testing/Data/Patch/file1.txt b/Testing/Data/Patch/file1.txt new file mode 100644 index 00000000000..06f0917976f --- /dev/null +++ b/Testing/Data/Patch/file1.txt @@ -0,0 +1,6 @@ +b +c +d +e +f +file1 diff --git a/Testing/Data/Patch/file2.txt b/Testing/Data/Patch/file2.txt new file mode 100644 index 00000000000..8bf7561ebe8 --- /dev/null +++ b/Testing/Data/Patch/file2.txt @@ -0,0 +1,6 @@ +a +b +c +e +f +file2 diff --git a/Testing/Data/Patch/patch.diff b/Testing/Data/Patch/patch.diff new file mode 100644 index 00000000000..ae3d30a6a96 --- /dev/null +++ b/Testing/Data/Patch/patch.diff @@ -0,0 +1,11 @@ +--- C:/dev/winmerge/Testing/Data/Patch/file1.txt Sat Feb 10 11:48:34 2024 ++++ C:/dev/winmerge/Testing/Data/Patch/file2.txt Sat Feb 10 11:48:34 2024 +@@ -1,6 +1,6 @@ ++a + b + c +-d + e + f +-file1 ++file2 From aaf868649aeaf9f099173da0985531c6e67cc460 Mon Sep 17 00:00:00 2001 From: Takashi Sawanaka Date: Sun, 11 Feb 2024 05:09:51 +0900 Subject: [PATCH 36/58] WIP --- Plugins/dlls/ApplyPatch.sct | 34 ++++++++++--------- Testing/Data/Patch/dir1/file1.txt | 7 ++++ Testing/Data/Patch/dir1/file2.txt | 7 ++++ Testing/Data/Patch/dir1/subdir/sfile1.txt | 7 ++++ Testing/Data/Patch/dir1/subdir/sfile2.txt | 7 ++++ .../Patch/dir1/subdir/subsubdir/ssfile1.txt | 7 ++++ .../Patch/dir1/subdir/subsubdir/ssfile2.txt | 7 ++++ Testing/Data/Patch/dir2/file1.txt | 7 ++++ Testing/Data/Patch/dir2/file2.txt | 7 ++++ Testing/Data/Patch/dir2/subdir/sfile1.txt | 7 ++++ Testing/Data/Patch/dir2/subdir/sfile2.txt | 7 ++++ .../Patch/dir2/subdir/subsubdir/ssfile1.txt | 7 ++++ .../Patch/dir2/subdir/subsubdir/ssfile2.txt | 7 ++++ Testing/Data/Patch/patch2.diff | 16 +++++++++ Testing/Data/Patch/patch3.diff | 16 +++++++++ 15 files changed, 134 insertions(+), 16 deletions(-) create mode 100644 Testing/Data/Patch/dir1/file1.txt create mode 100644 Testing/Data/Patch/dir1/file2.txt create mode 100644 Testing/Data/Patch/dir1/subdir/sfile1.txt create mode 100644 Testing/Data/Patch/dir1/subdir/sfile2.txt create mode 100644 Testing/Data/Patch/dir1/subdir/subsubdir/ssfile1.txt create mode 100644 Testing/Data/Patch/dir1/subdir/subsubdir/ssfile2.txt create mode 100644 Testing/Data/Patch/dir2/file1.txt create mode 100644 Testing/Data/Patch/dir2/file2.txt create mode 100644 Testing/Data/Patch/dir2/subdir/sfile1.txt create mode 100644 Testing/Data/Patch/dir2/subdir/sfile2.txt create mode 100644 Testing/Data/Patch/dir2/subdir/subsubdir/ssfile1.txt create mode 100644 Testing/Data/Patch/dir2/subdir/subsubdir/ssfile2.txt create mode 100644 Testing/Data/Patch/patch2.diff create mode 100644 Testing/Data/Patch/patch3.diff diff --git a/Plugins/dlls/ApplyPatch.sct b/Plugins/dlls/ApplyPatch.sct index 41a0ac881e6..1fd6ef0599c 100644 --- a/Plugins/dlls/ApplyPatch.sct +++ b/Plugins/dlls/ApplyPatch.sct @@ -47,7 +47,7 @@ */ -var REGKEY_PATH = "Plugins\\CompareMSExcelFiles.sct/"; +var REGKEY_PATH = "Plugins\\ApplyPatch.sct/"; var PLUGIN_NAME = "ApplyPatch.sct WinMerge Plugin"; var fso = new ActiveXObject("Scripting.FileSystemObject"); @@ -109,16 +109,16 @@ function UnpackFile(fileSrc, fileDst, pbChanged, pSubcode) { return result.Items(); } - var filePatched = (PrevFileName !== "") ? PrevFileName : regRead(REGKEY_PATH + "Files\\Left/Item_0", ""); + var filePatched = (PrevFileName !== "") ? PrevFileName : regRead("Files\\Left/Item_0", ""); if (isPatchFile(filePatched)) { - filePatched = regRead(REGKEY_PATH + "Files\\Right/Item_0", ""); + filePatched = regRead("Files\\Right/Item_0", ""); } var msg = fmt(translate("${Enter the name of the file to which the patch '%1' will be applied}"), [ fso.GetFileName(fileSrc) ]); while (true) { filePatched = mergeApp.InputBox(msg, PLUGIN_NAME, filePatched); if (filePatched === "") { - return false; + return false; } if (fso.FileExists(filePatched)) { break; } mergeApp.MsgBox(fmt(translate("${File '%1' does not exist}"), [ filePatched ]), 48/*vbExclamation*/); @@ -164,9 +164,9 @@ function IsFolder(file) { function UnpackFolder(fileSrc, folderDst, pbChanged, pSubcode) { if (!fso.FolderExists(folderDst)) { fso.CreateFolder(folderDst); } - var dirPatched = regRead(REGKEY_PATH + "Files\\Left/Item_0", ""); + var dirPatched = regRead("Files\\Left/Item_0", ""); if (!fso.FolderExists(dirPatched)) { - dirPatched = regRead(REGKEY_PATH + "Files\\Right/Item_0", ""); + dirPatched = regRead("Files\\Right/Item_0", ""); } var msg = fmt(translate("${Enter the name of the folder to which the patch '%1' will be applied}"), [ fso.GetFileName(fileSrc) ]); @@ -202,11 +202,12 @@ function UnpackFolder(fileSrc, folderDst, pbChanged, pSubcode) { copyOriginalFiles(dirPatched, folderDst, files, stripCount); - run(wsh, "cmd.exe /s /c \"set PATH=" + getPatchExeFolder() + ";%PATH% & cd /d " + folderDst + " + " + cmdLine + " & pause\""); + run(wsh, "cmd.exe /s /c \"set PATH=" + getPatchExeFolder() + ";%PATH% & cd /d " + folderDst + " & " + cmdLine + " & pause\""); pbChanged = true; pSubcode = 0; + var result = new ActiveXObject("Scripting.Dictionary"); result.Add(0, true); result.Add(1, pbChanged); result.Add(2, pSubcode); @@ -250,7 +251,7 @@ function run(sh, cmd) { function getPatchExeFolder() { var winMergeExePath = "C:\\Program Files\\WinMerge\\WinMergeU.exe"; try { - winMergeExePath = wsh.RegRead(REGKEY_PATH + "\\Executable"); + winMergeExePath = wsh.RegRead("Executable"); } catch (e) {} return fso.BuildPath(fso.GetParentFolderName(winMergeExePath), "Commands\\msys2\\usr\\bin"); } @@ -290,16 +291,16 @@ function isNullDevice(path) { function stripDir(fileName, stripCount) { if (stripCount === -1) { return fso.GetFileName(fileName); - } else if ( stripCount === 0) { + } else if (stripCount === 0) { return fileName; } var pos = 0; for (var i = 0; i < stripCount; i++) { var posNext1 = fileName.indexOf("/", pos); var posNext2 = fileName.indexOf("\\", pos); - if (posNext1 > 0 && (posNext1 < posNext2 || posNext2 === 0)) { + if (posNext1 >= 0 && (posNext1 < posNext2 || posNext2 === -1)) { pos = posNext1 + 1; - } else if (posNext2 > 0 && (posNext2 < posNext1 || posNext1 === 0)) { + } else if (posNext2 >= 0 && (posNext2 < posNext1 || posNext1 === -1)) { pos = posNext2 + 1; } else { pos = -1; @@ -365,10 +366,10 @@ function createFolderEx(dirName) { } function copyOriginalFiles(srcDir, destDir, fileNamesInPatch, stripCount) { - for (var i = 0; i < fileNamesInPath.length; i++) { - if (!isNullDevice(fileNamesInPatch(i)(0))) { - var fileNameSrc = makePatchedFileName(srcDir, fileNamesInPatch(i)(0), stripCount); - var fileNameDest = makePatchedFileName(destDir, fileNamesInPatch(i)(0), stripCount); + for (var i = 0; i < fileNamesInPatch.length; i++) { + if (!isNullDevice(fileNamesInPatch[i][0])) { + var fileNameSrc = makePatchedFileName(srcDir, fileNamesInPatch[i][0], stripCount); + var fileNameDest = makePatchedFileName(destDir, fileNamesInPatch[i][0], stripCount); if (fso.FileExists(fileNameSrc)) { if (!fso.FolderExists(fso.GetParentFolderName(fileNameDest))) { createFolderEx(fso.GetParentFolderName(fileNameDest)); @@ -394,7 +395,8 @@ function getFileNamesInPatch(fileName) { var re = new RegExp("^(---|\\+\\+\\+|\\*\\*\\*) ([^\\t\\r\\n]+)"); var text = readAllText(fileName); var i = 0; - var lines = text.split(text, "\r\n"); + var eol = text.match(/\r\n|\n|\r/); + var lines = text.split(eol); while (i < lines.length) { var line = lines[i]; var ml = re.exec(line); diff --git a/Testing/Data/Patch/dir1/file1.txt b/Testing/Data/Patch/dir1/file1.txt new file mode 100644 index 00000000000..5286e53fa53 --- /dev/null +++ b/Testing/Data/Patch/dir1/file1.txt @@ -0,0 +1,7 @@ +b +c +d +e +f +file1 +dir1 diff --git a/Testing/Data/Patch/dir1/file2.txt b/Testing/Data/Patch/dir1/file2.txt new file mode 100644 index 00000000000..a76267def57 --- /dev/null +++ b/Testing/Data/Patch/dir1/file2.txt @@ -0,0 +1,7 @@ +a +b +c +e +f +file2 +dir1 diff --git a/Testing/Data/Patch/dir1/subdir/sfile1.txt b/Testing/Data/Patch/dir1/subdir/sfile1.txt new file mode 100644 index 00000000000..400b261e498 --- /dev/null +++ b/Testing/Data/Patch/dir1/subdir/sfile1.txt @@ -0,0 +1,7 @@ +b +c +d +e +f +sfile1 +dir1 diff --git a/Testing/Data/Patch/dir1/subdir/sfile2.txt b/Testing/Data/Patch/dir1/subdir/sfile2.txt new file mode 100644 index 00000000000..1e842421a26 --- /dev/null +++ b/Testing/Data/Patch/dir1/subdir/sfile2.txt @@ -0,0 +1,7 @@ +a +b +c +e +f +sfile2 +dir1 diff --git a/Testing/Data/Patch/dir1/subdir/subsubdir/ssfile1.txt b/Testing/Data/Patch/dir1/subdir/subsubdir/ssfile1.txt new file mode 100644 index 00000000000..1002482c257 --- /dev/null +++ b/Testing/Data/Patch/dir1/subdir/subsubdir/ssfile1.txt @@ -0,0 +1,7 @@ +b +c +d +e +f +ssfile1 +dir1 diff --git a/Testing/Data/Patch/dir1/subdir/subsubdir/ssfile2.txt b/Testing/Data/Patch/dir1/subdir/subsubdir/ssfile2.txt new file mode 100644 index 00000000000..087a4420f40 --- /dev/null +++ b/Testing/Data/Patch/dir1/subdir/subsubdir/ssfile2.txt @@ -0,0 +1,7 @@ +a +b +c +e +f +ssfile2 +dir1 diff --git a/Testing/Data/Patch/dir2/file1.txt b/Testing/Data/Patch/dir2/file1.txt new file mode 100644 index 00000000000..5243dffe7fa --- /dev/null +++ b/Testing/Data/Patch/dir2/file1.txt @@ -0,0 +1,7 @@ +b +c +d +e +f +file1 +dir2 diff --git a/Testing/Data/Patch/dir2/file2.txt b/Testing/Data/Patch/dir2/file2.txt new file mode 100644 index 00000000000..24e4ab165b7 --- /dev/null +++ b/Testing/Data/Patch/dir2/file2.txt @@ -0,0 +1,7 @@ +a +b +c +e +f +file2 +dir2 diff --git a/Testing/Data/Patch/dir2/subdir/sfile1.txt b/Testing/Data/Patch/dir2/subdir/sfile1.txt new file mode 100644 index 00000000000..111b0d8deb1 --- /dev/null +++ b/Testing/Data/Patch/dir2/subdir/sfile1.txt @@ -0,0 +1,7 @@ +b +c +d +e +f +sfile1 +dir2 diff --git a/Testing/Data/Patch/dir2/subdir/sfile2.txt b/Testing/Data/Patch/dir2/subdir/sfile2.txt new file mode 100644 index 00000000000..1b7d8a64495 --- /dev/null +++ b/Testing/Data/Patch/dir2/subdir/sfile2.txt @@ -0,0 +1,7 @@ +a +b +c +e +f +sfile2 +dir2 diff --git a/Testing/Data/Patch/dir2/subdir/subsubdir/ssfile1.txt b/Testing/Data/Patch/dir2/subdir/subsubdir/ssfile1.txt new file mode 100644 index 00000000000..f0bac615d42 --- /dev/null +++ b/Testing/Data/Patch/dir2/subdir/subsubdir/ssfile1.txt @@ -0,0 +1,7 @@ +b +c +d +e +f +ssfile1 +dir2 diff --git a/Testing/Data/Patch/dir2/subdir/subsubdir/ssfile2.txt b/Testing/Data/Patch/dir2/subdir/subsubdir/ssfile2.txt new file mode 100644 index 00000000000..29070556855 --- /dev/null +++ b/Testing/Data/Patch/dir2/subdir/subsubdir/ssfile2.txt @@ -0,0 +1,7 @@ +a +b +c +e +f +ssfile2 +dir2 diff --git a/Testing/Data/Patch/patch2.diff b/Testing/Data/Patch/patch2.diff new file mode 100644 index 00000000000..2c080dadf0a --- /dev/null +++ b/Testing/Data/Patch/patch2.diff @@ -0,0 +1,16 @@ +--- file1.txt Sat Feb 10 15:29:00 2024 ++++ file1.txt Sat Feb 10 15:29:00 2024 +@@ -4,4 +4,4 @@ + e + f + file1 +-dir1 ++dir2 +--- file2.txt Sat Feb 10 15:48:11 2024 ++++ file2.txt Sat Feb 10 15:48:11 2024 +@@ -4,4 +4,4 @@ + e + f + file2 +-dir1 ++dir2 diff --git a/Testing/Data/Patch/patch3.diff b/Testing/Data/Patch/patch3.diff new file mode 100644 index 00000000000..30a98dd566f --- /dev/null +++ b/Testing/Data/Patch/patch3.diff @@ -0,0 +1,16 @@ +--- subdir/subsubdir/ssfile1.txt Sat Feb 10 17:05:19 2024 ++++ subdir/subsubdir/ssfile1.txt Sat Feb 10 17:05:19 2024 +@@ -4,4 +4,4 @@ + e + f + ssfile1 +-dir1 ++dir2 +--- subdir/subsubdir/ssfile2.txt Sat Feb 10 17:05:31 2024 ++++ subdir/subsubdir/ssfile2.txt Sat Feb 10 17:05:31 2024 +@@ -4,4 +4,4 @@ + e + f + ssfile2 +-dir1 ++dir2 From 721c9f8867db56a7229b3beeef0e20ba058701cf Mon Sep 17 00:00:00 2001 From: Takashi Sawanaka Date: Sun, 11 Feb 2024 08:47:35 +0900 Subject: [PATCH 37/58] WIP --- .gitignore | 1 + Testing/PluginTests/PluginTests.js | 124 +++++++++++++++++++---------- 2 files changed, 85 insertions(+), 40 deletions(-) diff --git a/.gitignore b/.gitignore index 62a7602b1c7..6f27bcc0e31 100644 --- a/.gitignore +++ b/.gitignore @@ -125,3 +125,4 @@ Testing/Data/Symlink/Dir2/ss12_same_s11.txt Src/MergeAppLib_i.c Src/MergeAppLib_p.c Src/dlldata.c +/Testing/PluginTests/result diff --git a/Testing/PluginTests/PluginTests.js b/Testing/PluginTests/PluginTests.js index 70f21662b7c..04c18cf1dc7 100644 --- a/Testing/PluginTests/PluginTests.js +++ b/Testing/PluginTests/PluginTests.js @@ -11,9 +11,20 @@ try { FileSys.CreateFolder(ScriptFolder + "\\result\\excel"); FileSys.CreateFolder(ScriptFolder + "\\result\\word"); FileSys.CreateFolder(ScriptFolder + "\\result\\powerpnt"); + FileSys.CreateFolder(ScriptFolder + "\\result\\patch"); + FileSys.CreateFolder(ScriptFolder + "\\result\\patch\\result1"); + FileSys.CreateFolder(ScriptFolder + "\\result\\patch\\result2"); } catch (e) { } var PluginSettings = { + "Files": { + "Left": { + "Item_0": "" + }, + "Right": { + "Item_0": "" + } + }, "Plugins": { "CompareMSExcelFiles.sct": { "UnpackToFolder": 1, @@ -94,13 +105,24 @@ var MergeApp = { return PluginSettings[ary2[0]][ary1[1]]; }, "SaveOption": function (key, value) { - var t = typeof value === "string" ? "REG_SZ" : "REG_DWORD"; + var t = typeof value === "string" ? "REG_SZ" : "REG_DWORD"; }, "Translate": function (text) { return text; }, "Log": function (level, text) { WScript.Echo(text); + }, + "MsgBox": function (prompt, buttons, title) { + WScript.Echo("title: " + title); + WScript.Echo("prompt: " + prompt); + WScript.Echo("buttons: " + buttons); + }, + "InputBox": function (prompt, title, defaultValue) { + WScript.Echo("title: " + title); + WScript.Echo("prompt: " + prompt); + WScript.Echo("default: " + defaultValue); + return defaultValue; } }; function setTestName(testname) { @@ -138,45 +160,6 @@ function printPluginInfo(p) { WScript.Echo(""); } -function CompareMSExcelFilesTest() { - var p = GetObject("script: " + ScriptFolder + "\\..\\..\\Plugins\\dlls\\CompareMSExcelFiles.sct"); - printPluginInfo(p); - var changed = false; - var subcode = 0; - p.PluginOnEvent(0, MergeApp); - p.UnpackFile(ScriptFolder + "\\..\\Data\\Office\\excel.xls", ScriptFolder + "\\result\\excel.xls.tsv", changed, subcode); - CollectGarbage(); - p.UnpackFolder(ScriptFolder + "\\..\\Data\\Office\\excel.xls", ScriptFolder + "\\result\\excel\\", changed, subcode); - CollectGarbage(); - p.PluginOnEvent(1, MergeApp); -} - -function CompareMSWordFilesTest() { - var p = GetObject("script: " + ScriptFolder + "\\..\\..\\Plugins\\dlls\\CompareMSWordFiles.sct"); - printPluginInfo(p); - var changed = false; - var subcode = 0; - p.PluginOnEvent(0, MergeApp); - p.UnpackFile(ScriptFolder + "\\..\\Data\\Office\\word.doc", ScriptFolder + "\\result\\word.doc.txt", changed, subcode); - CollectGarbage(); - p.UnpackFolder(ScriptFolder + "\\..\\Data\\Office\\word.doc", ScriptFolder + "\\result\\word\\", changed, subcode); - CollectGarbage(); - p.PluginOnEvent(1, MergeApp); -} - -function CompareMSPowerPointFilesTest() { - var p = GetObject("script: " + ScriptFolder + "\\..\\..\\Plugins\\dlls\\CompareMSPowerPointFiles.sct"); - printPluginInfo(p); - var changed = false; - var subcode = 0; - p.PluginOnEvent(0, MergeApp); - p.UnpackFile(ScriptFolder + "\\..\\Data\\Office\\powerpnt.ppt", ScriptFolder + "\\result\\powerpnt.ppt.txt", changed, subcode); - CollectGarbage(); - p.UnpackFolder(ScriptFolder + "\\..\\Data\\Office\\powerpnt.ppt", ScriptFolder + "\\result\\powerpnt\\", changed, subcode); - CollectGarbage(); - p.PluginOnEvent(1, MergeApp); -} - function EditorAddinTest() { var asciiChars = ""; var p = GetObject("script: " + ScriptFolder + "\\..\\..\\Plugins\\dlls\\editor addin.sct"); @@ -536,10 +519,71 @@ function PrediffLineFilterTest() { p.PluginOnEvent(1, MergeApp); } +function ApplyPatchTest() { + var p = GetObject("script: " + ScriptFolder + "\\..\\..\\Plugins\\dlls\\ApplyPatch.sct"); + printPluginInfo(p); + var changed = false; + var subcode = 0; + p.PluginOnEvent(0, MergeApp); + PluginSettings.Files.Left.Item_0 = ScriptFolder + "\\..\\Data\\Patch\\file1.txt"; + PluginSettings.Files.Right.Item_0 = ScriptFolder + "\\..\\Data\\Patch\\patch.diff"; + p.UnpackFile(ScriptFolder + "\\..\\Data\\Patch\\patch.diff", ScriptFolder + "\\result\\patch\\result1.txt", changed, subcode); + PluginSettings.Files.Left.Item_0 = ScriptFolder + "\\..\\Data\\Patch\\patch.diff"; + PluginSettings.Files.Right.Item_0 = ScriptFolder + "\\..\\Data\\Patch\\file1.txt"; + p.UnpackFile(ScriptFolder + "\\..\\Data\\Patch\\patch.diff", ScriptFolder + "\\result\\patch\\result2.txt", changed, subcode); + PluginSettings.Files.Left.Item_0 = ScriptFolder + "\\..\\Data\\Patch\\dir1\\"; + PluginSettings.Files.Right.Item_0 = ScriptFolder + "\\..\\Data\\Patch\\patch3.diff"; + p.UnpackFolder(ScriptFolder + "\\..\\Data\\Patch\\patch3.diff", ScriptFolder + "\\result\\patch\\result1\\", changed, subcode); + PluginSettings.Files.Left.Item_0 = ScriptFolder + "\\..\\Data\\Patch\\patch3.diff"; + PluginSettings.Files.Right.Item_0 = ScriptFolder + "\\..\\Data\\Patch\\dir1\\subdir\\"; + p.UnpackFolder(ScriptFolder + "\\..\\Data\\Patch\\patch3.diff", ScriptFolder + "\\result\\patch\\result2\\", changed, subcode); + p.PluginOnEvent(1, MergeApp); +} + +function CompareMSExcelFilesTest() { + var p = GetObject("script: " + ScriptFolder + "\\..\\..\\Plugins\\dlls\\CompareMSExcelFiles.sct"); + printPluginInfo(p); + var changed = false; + var subcode = 0; + p.PluginOnEvent(0, MergeApp); + p.UnpackFile(ScriptFolder + "\\..\\Data\\Office\\excel.xls", ScriptFolder + "\\result\\excel.xls.tsv", changed, subcode); + CollectGarbage(); + p.UnpackFolder(ScriptFolder + "\\..\\Data\\Office\\excel.xls", ScriptFolder + "\\result\\excel\\", changed, subcode); + CollectGarbage(); + p.PluginOnEvent(1, MergeApp); +} + +function CompareMSWordFilesTest() { + var p = GetObject("script: " + ScriptFolder + "\\..\\..\\Plugins\\dlls\\CompareMSWordFiles.sct"); + printPluginInfo(p); + var changed = false; + var subcode = 0; + p.PluginOnEvent(0, MergeApp); + p.UnpackFile(ScriptFolder + "\\..\\Data\\Office\\word.doc", ScriptFolder + "\\result\\word.doc.txt", changed, subcode); + CollectGarbage(); + p.UnpackFolder(ScriptFolder + "\\..\\Data\\Office\\word.doc", ScriptFolder + "\\result\\word\\", changed, subcode); + CollectGarbage(); + p.PluginOnEvent(1, MergeApp); +} + +function CompareMSPowerPointFilesTest() { + var p = GetObject("script: " + ScriptFolder + "\\..\\..\\Plugins\\dlls\\CompareMSPowerPointFiles.sct"); + printPluginInfo(p); + var changed = false; + var subcode = 0; + p.PluginOnEvent(0, MergeApp); + p.UnpackFile(ScriptFolder + "\\..\\Data\\Office\\powerpnt.ppt", ScriptFolder + "\\result\\powerpnt.ppt.txt", changed, subcode); + CollectGarbage(); + p.UnpackFolder(ScriptFolder + "\\..\\Data\\Office\\powerpnt.ppt", ScriptFolder + "\\result\\powerpnt\\", changed, subcode); + CollectGarbage(); + p.PluginOnEvent(1, MergeApp); +} + EditorAddinTest(); InsertDateTimeTest(); IgnoreLeadingLineNumbersTest(); PrediffLineFilterTest(); +ApplyPatchTest(); /* CompareMSExcelFilesTest(); CompareMSWordFilesTest(); From 6b555bd5a1d29ecd7667ba2bbb0ebaf378d9f05b Mon Sep 17 00:00:00 2001 From: Takashi Sawanaka Date: Mon, 12 Feb 2024 09:50:41 +0900 Subject: [PATCH 38/58] WIP --- ALL.vs2017.sln | 10 +- ALL.vs2019.sln | 10 +- ALL.vs2022.sln | 10 +- BuildBin.vs2017.cmd | 2 +- BuildBin.vs2019.cmd | 2 +- BuildBin.vs2022.cmd | 2 +- ExpandEnvironmenStrings.js | 10 + ExpandEnvironmenStrings.vbs | 10 - Src/MergeLang.vcxproj | 8 +- Testing/PluginTests/PluginTests.js | 8 +- ...enuResources.vbs => CheckMenuResources.js} | 0 ...dResources.vbs => CheckUnusedResources.js} | 0 ...sterPotFile.vbs => CreateMasterPotFile.js} | 0 Translations/WinMerge/CreateMasterPotFile.js | 341 +++++++++++++++ Translations/WinMerge/CreateMasterPotFile.vbs | 393 ------------------ ...otFile.vbs => UpdatePoFilesFromPotFile.js} | 0 WinMerge.vs2017.sln | 4 +- WinMerge.vs2019.sln | 4 +- WinMerge.vs2022.sln | 4 +- 19 files changed, 385 insertions(+), 433 deletions(-) create mode 100644 ExpandEnvironmenStrings.js delete mode 100644 ExpandEnvironmenStrings.vbs rename Tools/Scripts/{CheckMenuResources.vbs => CheckMenuResources.js} (100%) rename Tools/Scripts/{CheckUnusedResources.vbs => CheckUnusedResources.js} (100%) rename Translations/ShellExtension/{CreateMasterPotFile.vbs => CreateMasterPotFile.js} (100%) create mode 100644 Translations/WinMerge/CreateMasterPotFile.js delete mode 100644 Translations/WinMerge/CreateMasterPotFile.vbs rename Translations/WinMerge/{UpdatePoFilesFromPotFile.vbs => UpdatePoFilesFromPotFile.js} (100%) diff --git a/ALL.vs2017.sln b/ALL.vs2017.sln index bd923095016..41cc5e5eea9 100644 --- a/ALL.vs2017.sln +++ b/ALL.vs2017.sln @@ -37,7 +37,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Root", "Root", "{DC3B258E-4 BuildManual.cmd = BuildManual.cmd CreateRelease.cmd = CreateRelease.cmd DownloadDeps.cmd = DownloadDeps.cmd - ExpandEnvironmenStrings.vbs = ExpandEnvironmenStrings.vbs + ExpandEnvironmenStrings.js = ExpandEnvironmenStrings.js LICENSE.md = LICENSE.md README.md = README.md runastyle.bat = runastyle.bat @@ -165,9 +165,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Batch Files", "Batch Files" Externals\winimerge\SetVersion.cmd = Externals\winimerge\SetVersion.cmd EndProjectSection EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "VBS Scripts", "VBS Scripts", "{0AB212AD-1F11-4BAB-BAD5-8BFC4435F453}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Scripts", "Scripts", "{0AB212AD-1F11-4BAB-BAD5-8BFC4435F453}" ProjectSection(SolutionItems) = preProject - Externals\winimerge\ExpandEnvironmenStrings.vbs = Externals\winimerge\ExpandEnvironmenStrings.vbs + Externals\winimerge\ExpandEnvironmenStrings.js = Externals\winimerge\ExpandEnvironmenStrings.js EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SampleStatic", "Externals\crystaledit\Sample\SampleStatic.vcxproj", "{C347D6AE-7A2B-4ED0-97AD-2595E1C5D7DD}" @@ -308,10 +308,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tools", "Tools", "{4407E7D0 EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Scripts", "Scripts", "{88571237-56AD-421A-8F88-26983BDD8D6C}" ProjectSection(SolutionItems) = preProject - Tools\Scripts\CheckMenuResources.vbs = Tools\Scripts\CheckMenuResources.vbs + Tools\Scripts\CheckMenuResources.js = Tools\Scripts\CheckMenuResources.js Tools\Scripts\CheckTranslationStrings.cmd = Tools\Scripts\CheckTranslationStrings.cmd Tools\Scripts\CheckTranslationStrings.ps1 = Tools\Scripts\CheckTranslationStrings.ps1 - Tools\Scripts\CheckUnusedResources.vbs = Tools\Scripts\CheckUnusedResources.vbs + Tools\Scripts\CheckUnusedResources.js = Tools\Scripts\CheckUnusedResources.js Tools\Scripts\README.md = Tools\Scripts\README.md Tools\Scripts\UpdateTranslations.bat = Tools\Scripts\UpdateTranslations.bat EndProjectSection diff --git a/ALL.vs2019.sln b/ALL.vs2019.sln index 6aa82fd7133..fafbae08bb6 100644 --- a/ALL.vs2019.sln +++ b/ALL.vs2019.sln @@ -37,7 +37,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Root", "Root", "{DC3B258E-4 BuildManual.cmd = BuildManual.cmd CreateRelease.cmd = CreateRelease.cmd DownloadDeps.cmd = DownloadDeps.cmd - ExpandEnvironmenStrings.vbs = ExpandEnvironmenStrings.vbs + ExpandEnvironmenStrings.js = ExpandEnvironmenStrings.js LICENSE.md = LICENSE.md README.md = README.md runastyle.bat = runastyle.bat @@ -165,9 +165,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Batch Files", "Batch Files" Externals\winimerge\SetVersion.cmd = Externals\winimerge\SetVersion.cmd EndProjectSection EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "VBS Scripts", "VBS Scripts", "{0AB212AD-1F11-4BAB-BAD5-8BFC4435F453}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Scripts", "Scripts", "{0AB212AD-1F11-4BAB-BAD5-8BFC4435F453}" ProjectSection(SolutionItems) = preProject - Externals\winimerge\ExpandEnvironmenStrings.vbs = Externals\winimerge\ExpandEnvironmenStrings.vbs + Externals\winimerge\ExpandEnvironmenStrings.js = Externals\winimerge\ExpandEnvironmenStrings.s EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SampleStatic", "Externals\crystaledit\Sample\SampleStatic.vcxproj", "{C347D6AE-7A2B-4ED0-97AD-2595E1C5D7DD}" @@ -308,10 +308,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tools", "Tools", "{4407E7D0 EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Scripts", "Scripts", "{88571237-56AD-421A-8F88-26983BDD8D6C}" ProjectSection(SolutionItems) = preProject - Tools\Scripts\CheckMenuResources.vbs = Tools\Scripts\CheckMenuResources.vbs + Tools\Scripts\CheckMenuResources.js = Tools\Scripts\CheckMenuResources.js Tools\Scripts\CheckTranslationStrings.cmd = Tools\Scripts\CheckTranslationStrings.cmd Tools\Scripts\CheckTranslationStrings.ps1 = Tools\Scripts\CheckTranslationStrings.ps1 - Tools\Scripts\CheckUnusedResources.vbs = Tools\Scripts\CheckUnusedResources.vbs + Tools\Scripts\CheckUnusedResources.js = Tools\Scripts\CheckUnusedResources.js Tools\Scripts\README.md = Tools\Scripts\README.md Tools\Scripts\UpdateTranslations.bat = Tools\Scripts\UpdateTranslations.bat EndProjectSection diff --git a/ALL.vs2022.sln b/ALL.vs2022.sln index ef5dacbcc22..20e421620ae 100644 --- a/ALL.vs2022.sln +++ b/ALL.vs2022.sln @@ -37,7 +37,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Root", "Root", "{DC3B258E-4 BuildManual.cmd = BuildManual.cmd CreateRelease.cmd = CreateRelease.cmd DownloadDeps.cmd = DownloadDeps.cmd - ExpandEnvironmenStrings.vbs = ExpandEnvironmenStrings.vbs + ExpandEnvironmenStrings.js = ExpandEnvironmenStrings.js LICENSE.md = LICENSE.md README.md = README.md runastyle.bat = runastyle.bat @@ -165,9 +165,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Batch Files", "Batch Files" Externals\winimerge\SetVersion.cmd = Externals\winimerge\SetVersion.cmd EndProjectSection EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "VBS Scripts", "VBS Scripts", "{0AB212AD-1F11-4BAB-BAD5-8BFC4435F453}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Scripts", "Scripts", "{0AB212AD-1F11-4BAB-BAD5-8BFC4435F453}" ProjectSection(SolutionItems) = preProject - Externals\winimerge\ExpandEnvironmenStrings.vbs = Externals\winimerge\ExpandEnvironmenStrings.vbs + Externals\winimerge\ExpandEnvironmenStrings.js = Externals\winimerge\ExpandEnvironmenStrings.js EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SampleStatic", "Externals\crystaledit\Sample\SampleStatic.vcxproj", "{C347D6AE-7A2B-4ED0-97AD-2595E1C5D7DD}" @@ -308,10 +308,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tools", "Tools", "{4407E7D0 EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Scripts", "Scripts", "{88571237-56AD-421A-8F88-26983BDD8D6C}" ProjectSection(SolutionItems) = preProject - Tools\Scripts\CheckMenuResources.vbs = Tools\Scripts\CheckMenuResources.vbs + Tools\Scripts\CheckMenuResources.js = Tools\Scripts\CheckMenuResources.js Tools\Scripts\CheckTranslationStrings.cmd = Tools\Scripts\CheckTranslationStrings.cmd Tools\Scripts\CheckTranslationStrings.ps1 = Tools\Scripts\CheckTranslationStrings.ps1 - Tools\Scripts\CheckUnusedResources.vbs = Tools\Scripts\CheckUnusedResources.vbs + Tools\Scripts\CheckUnusedResources.js = Tools\Scripts\CheckUnusedResources.js Tools\Scripts\README.md = Tools\Scripts\README.md Tools\Scripts\UpdateTranslations.bat = Tools\Scripts\UpdateTranslations.bat EndProjectSection diff --git a/BuildBin.vs2017.cmd b/BuildBin.vs2017.cmd index 2b0aa68c444..eee26f99503 100644 --- a/BuildBin.vs2017.cmd +++ b/BuildBin.vs2017.cmd @@ -1,7 +1,7 @@ cd /d "%~dp0" call SetVersion.cmd -cscript /nologo ExpandEnvironmenStrings.vbs Version.in > Version.h +cscript /nologo ExpandEnvironmenStrings.js Version.in > Version.h setlocal for /f "usebackq tokens=*" %%i in (`"%programfiles(x86)%\microsoft visual studio\installer\vswhere.exe" -version [15.0^,16.0^) -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath`) do ( diff --git a/BuildBin.vs2019.cmd b/BuildBin.vs2019.cmd index 95e99777169..cef25beada9 100644 --- a/BuildBin.vs2019.cmd +++ b/BuildBin.vs2019.cmd @@ -1,7 +1,7 @@ cd /d "%~dp0" call SetVersion.cmd -cscript /nologo ExpandEnvironmenStrings.vbs Version.in > Version.h +cscript /nologo ExpandEnvironmenStrings.js Version.in > Version.h setlocal for /f "usebackq tokens=*" %%i in (`"%programfiles(x86)%\microsoft visual studio\installer\vswhere.exe" -version [16.0^,17.0^) -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath`) do ( diff --git a/BuildBin.vs2022.cmd b/BuildBin.vs2022.cmd index 06b5ff8bdb7..3414b309793 100644 --- a/BuildBin.vs2022.cmd +++ b/BuildBin.vs2022.cmd @@ -1,7 +1,7 @@ cd /d "%~dp0" call SetVersion.cmd -cscript /nologo ExpandEnvironmenStrings.vbs Version.in > Version.h +cscript /nologo ExpandEnvironmenStrings.js Version.in > Version.h setlocal for /f "usebackq tokens=*" %%i in (`"%programfiles(x86)%\microsoft visual studio\installer\vswhere.exe" -version [17.0^,18.0^) -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath`) do ( diff --git a/ExpandEnvironmenStrings.js b/ExpandEnvironmenStrings.js new file mode 100644 index 00000000000..a25d5ddd7fb --- /dev/null +++ b/ExpandEnvironmenStrings.js @@ -0,0 +1,10 @@ +var fso = new ActiveXObject("Scripting.FileSystemObject"); +var sh = new ActiveXObject("WScript.Shell"); +var otf = fso.OpenTextFile(WScript.Arguments.Unnamed(0), 1); + +while (!otf.AtEndOfStream) { + WScript.Echo(sh.ExpandEnvironmentStrings(otf.ReadLine())); +} + +otf.Close(); + diff --git a/ExpandEnvironmenStrings.vbs b/ExpandEnvironmenStrings.vbs deleted file mode 100644 index 91a722fdb1f..00000000000 --- a/ExpandEnvironmenStrings.vbs +++ /dev/null @@ -1,10 +0,0 @@ -Dim fso: Set fso = CreateObject("Scripting.FileSystemObject") -Dim sh: Set sh = CreateObject("WScript.Shell") -Dim otf: Set otf = fso.OpenTextFile(WScript.Arguments.Unnamed(0), 1) - -Do Until otf.AtEndOfStream = True - WScript.Echo sh.ExpandEnvironmentStrings(otf.ReadLine) -Loop - -otf.Close - diff --git a/Src/MergeLang.vcxproj b/Src/MergeLang.vcxproj index abd07fe5d9a..3754d67bed4 100644 --- a/Src/MergeLang.vcxproj +++ b/Src/MergeLang.vcxproj @@ -183,7 +183,7 @@ date /t > MergeLang.lastbuild attrib -a English.pot del English.pot.prev English.pot.flt English.pot.prev.flt 2> NUL move English.pot English.pot.prev 2> NUL -cscript CreateMasterPotFile.vbs +cscript CreateMasterPotFile.js attrib -a English.pot findstr /v POT-Creation-Date English.pot > English.pot.flt findstr /v POT-Creation-Date English.pot.prev > English.pot.prev.flt @@ -219,7 +219,7 @@ popd - + @@ -259,7 +259,7 @@ popd - + @@ -301,7 +301,7 @@ date /t > MergeLang.lastbuild attrib -a English.pot del English.pot.prev English.pot.flt English.pot.prev.flt 2> NUL move English.pot English.pot.prev 2> NUL -cscript CreateMasterPotFile.vbs +cscript CreateMasterPotFile.js attrib -a English.pot findstr /v POT-Creation-Date English.pot > English.pot.flt findstr /v POT-Creation-Date English.pot.prev > English.pot.prev.flt diff --git a/Testing/PluginTests/PluginTests.js b/Testing/PluginTests/PluginTests.js index 04c18cf1dc7..8e1d1474971 100644 --- a/Testing/PluginTests/PluginTests.js +++ b/Testing/PluginTests/PluginTests.js @@ -14,6 +14,7 @@ try { FileSys.CreateFolder(ScriptFolder + "\\result\\patch"); FileSys.CreateFolder(ScriptFolder + "\\result\\patch\\result1"); FileSys.CreateFolder(ScriptFolder + "\\result\\patch\\result2"); + FileSys.CreateFolder(ScriptFolder + "\\result\\patch\\result3"); } catch (e) { } var PluginSettings = { @@ -532,11 +533,14 @@ function ApplyPatchTest() { PluginSettings.Files.Right.Item_0 = ScriptFolder + "\\..\\Data\\Patch\\file1.txt"; p.UnpackFile(ScriptFolder + "\\..\\Data\\Patch\\patch.diff", ScriptFolder + "\\result\\patch\\result2.txt", changed, subcode); PluginSettings.Files.Left.Item_0 = ScriptFolder + "\\..\\Data\\Patch\\dir1\\"; + PluginSettings.Files.Right.Item_0 = ScriptFolder + "\\..\\Data\\Patch\\patch2.diff"; + p.UnpackFolder(ScriptFolder + "\\..\\Data\\Patch\\patch2.diff", ScriptFolder + "\\result\\patch\\result1\\", changed, subcode); + PluginSettings.Files.Left.Item_0 = ScriptFolder + "\\..\\Data\\Patch\\dir1\\"; PluginSettings.Files.Right.Item_0 = ScriptFolder + "\\..\\Data\\Patch\\patch3.diff"; - p.UnpackFolder(ScriptFolder + "\\..\\Data\\Patch\\patch3.diff", ScriptFolder + "\\result\\patch\\result1\\", changed, subcode); + p.UnpackFolder(ScriptFolder + "\\..\\Data\\Patch\\patch3.diff", ScriptFolder + "\\result\\patch\\result2\\", changed, subcode); PluginSettings.Files.Left.Item_0 = ScriptFolder + "\\..\\Data\\Patch\\patch3.diff"; PluginSettings.Files.Right.Item_0 = ScriptFolder + "\\..\\Data\\Patch\\dir1\\subdir\\"; - p.UnpackFolder(ScriptFolder + "\\..\\Data\\Patch\\patch3.diff", ScriptFolder + "\\result\\patch\\result2\\", changed, subcode); + p.UnpackFolder(ScriptFolder + "\\..\\Data\\Patch\\patch3.diff", ScriptFolder + "\\result\\patch\\result3\\", changed, subcode); p.PluginOnEvent(1, MergeApp); } diff --git a/Tools/Scripts/CheckMenuResources.vbs b/Tools/Scripts/CheckMenuResources.js similarity index 100% rename from Tools/Scripts/CheckMenuResources.vbs rename to Tools/Scripts/CheckMenuResources.js diff --git a/Tools/Scripts/CheckUnusedResources.vbs b/Tools/Scripts/CheckUnusedResources.js similarity index 100% rename from Tools/Scripts/CheckUnusedResources.vbs rename to Tools/Scripts/CheckUnusedResources.js diff --git a/Translations/ShellExtension/CreateMasterPotFile.vbs b/Translations/ShellExtension/CreateMasterPotFile.js similarity index 100% rename from Translations/ShellExtension/CreateMasterPotFile.vbs rename to Translations/ShellExtension/CreateMasterPotFile.js diff --git a/Translations/WinMerge/CreateMasterPotFile.js b/Translations/WinMerge/CreateMasterPotFile.js new file mode 100644 index 00000000000..c926b17ad56 --- /dev/null +++ b/Translations/WinMerge/CreateMasterPotFile.js @@ -0,0 +1,341 @@ +//// +// This script creates the master POT file (English.pot). +// +// Copyright (C) 2007-2009 by Tim Gerundt +// Released under the "GNU General Public License + +var ForReading = 1; + +var NO_BLOCK = 0; +var MENU_BLOCK = 1; +var DIALOGEX_BLOCK = 2; +var STRINGTABLE_BLOCK = 3; +var VERSIONINFO_BLOCK = 4; +var ACCELERATORS_BLOCK = 5; + +var PATH_ENGLISH_POT = "English.pot"; +var PATH_MERGE_RC = "../../Src/Merge.rc"; +var PATH_PLUGIN_STRINGS_RC = "../../Plugins/Strings.rc"; + +var oFSO = new ActiveX("Scripting.FileSystemObject"); + +var bRunFromCmd = false; +if (oFSO.GetFileName(Wscript.FullName).toLowerCase() === "cscript.exe") { + bRunFromCmd = true; +} +var bInsertLineNumbers = false; +if (WScript.Arguments.Named.Exists("InsertLineNumbers")) { + bInsertLineNumbers = CBool(WScript.Arguments.Named("InsertLineNumbers")); +} + +Main(); + +//// +// ... +function Main() { + var StartTime = new Date().getTime(); + + InfoBox("Creating POT file from Merge.rc...", 3); + + var bNecessary = true; + if (oFSO.FileExists(PATH_ENGLISH_POT)) { //if the POT file exists... + bNecessary = GetArchiveBit(PATH_MERGE_RC) || GetArchiveBit(PATH_ENGLISH_POT); //RCs or POT file changed? + } + + if (bNecessary) { //If update necessary... + var oStrings = MergeDictionaries( + GetStringsFromRcFile(PATH_MERGE_RC), + GetStringsFromRcFile(PATH_PLUGIN_STRINGS_RC)); + CreateMasterPotFile(PATH_ENGLISH_POT, oStrings); + SetArchiveBit(PATH_MERGE_RC, false); + SetArchiveBit(PATH_PLUGIN_STRINGS_RC, false); + SetArchiveBit(PATH_ENGLISH_POT, false); + for (var it = new Enumerator(oFSO.GetFolder(".").Files); !it.atEnd(); it.moveNext()) { //For all files in the current folder... + var oFile = it.item(); + if (oFSO.GetExtensionName(oFile.Name).toLowerCase() === "po") { //If a PO file... + SetArchiveBit(oFile.Path, true); + } + } + + var EndTime = new Date().getTime(); + var Seconds = (EndTime - StartTime) / 1000.0; + + InfoBox("POT file created, after " + Seconds + " second(s).", 10); + } else { //If update NOT necessary... + InfoBox("POT file already up-to-date.", 10); + } +} + +//// +// ... +function MergeDictionaries(dict1, dict2) { + var mergedDict = {}; + for (var key in dict1) { + mergedDict[key] = dict1[key]; + } + + for (var key in dict2) { + if (!(key in mergedDict)) { + mergedDict[key] = dict2[key]; + } + } + return mergedDict; +} + +//// +// ... +function GetStringsFromRcFile(sRcFilePath) { + var fContinuation = false; + var oBlacklist = GetStringBlacklist("StringBlacklist.txt"); + var oStrings = {}; + if (oFSO.FileExists(sRcFilePath)) { //If the RC file exists... + var sRcFileName = oFSO.GetFileName(sRcFilePath); + var iLine = 0; + var iBlockType = NO_BLOCK; + var oRcFile = oFSO.OpenTextFile(sRcFilePath, ForReading); + while (!oRcFile.AtEndOfStream) { //For all lines... + var sLine = oRcFile.ReadLine().replace(/^\s+|\s+$/g, ""); + iLine++; + + var sReference = sRcFileName + ":" + iLine; + var sString = ""; + var sComment = ""; + var sContext = ""; + + if (fContinuation) { + // Nothing to do + } else if (sLine.indexOf(" MENU") >= 0 && sLine.indexOf("IDR_") >= 0) { //MENU... + iBlockType = MENU_BLOCK + } else if (sLine.indexOf(" DIALOGEX") >= 0) { //DIALOGEX... + iBlockType = DIALOGEX_BLOCK + } else if (sLine === "STRINGTABLE") { //STRINGTABLE... + iBlockType = STRINGTABLE_BLOCK + } else if (sLine.indexOf(" VERSIONINFO") >= 0) { //VERSIONINFO... + iBlockType = VERSIONINFO_BLOCK + } else if (sLine.indexOf(" ACCELERATORS") >= 0) { //ACCELERATORS... + iBlockType = ACCELERATORS_BLOCK + } else if (sLine === "BEGIN") { //BEGIN... + //IGNORE FOR SPEEDUP! + } else if (sLine === "END") { //END... + if (iBlockType === STRINGTABLE_BLOCK) { //If inside stringtable... + iBlockType = NO_BLOCK; + } + } else if (sLine.substring(0, 2) === "//") { //If comment line... + sLine = ""; + //IGNORE FOR SPEEDUP! + } else if (sLine !== "") { //If NOT empty line... + switch (iBlockType) { + case NO_BLOCK: + var oMatch0 = /LANGUAGE (LANG_\w*, SUBLANG_\w*)/.exec(sLine); + if (oMatch0) { //LANGUAGE... + sString = oMatch0[1]; + sComment = "LANGUAGE, SUBLANGUAGE"; + } + break; + + case MENU_BLOCK: + case DIALOGEX_BLOCK: + case STRINGTABLE_BLOCK: + if (sLine.indexOf("\"") >= 0) { //If quote found (for speedup)... + //-------------------------------------------------------------------------------- + // Replace 1st string literal only - 2nd string literal specifies control class! + //-------------------------------------------------------------------------------- + var oMatch1 = /NC_\s*\("([^"]*)"\s*,\s*"([^"]*)"\s*\)/.exec(sLine); + var oMatch2 = /"((?:""|[^"])*)"/.exec(sLine); + var sTemp; + if (oMatch1) { //String... + sContext = oMatch1[1].replace(/^\s+|\s+$/g, ""); + sTemp = oMatch1[2]; + } else if (oMatch2) { //String... + sTemp = oMatch2[1]; + } else { + sTemp = ""; + } + if (sTemp !== "" && !(sTemp in oBlacklist)) { //If NOT blacklisted... + sString = sTemp.replace(/\"\"/g, "\\\""); + var oMatch3 = /\/\/#\. (.*?)$/.exec(sLine); + var oMatch4 = /\/\/msgctxt (.*?)$/.exec(sLine); + if (oMatch3) { //If found a comment for the translators... + sComment = oMatch3[1].replace(/^\s+|\s+$/g, ""); + } else if (oMatch4) { //If found a context for the translation... + sContext = oMatch4[1].replace(/^\s+|\s+$/g, ""); + sComment = sContext; + } + } + } + break; + + case VERSIONINFO_BLOCK: + var oMatch5 = /BLOCK "([0-9A-F]+)"/.exec(sLine); + var oMatch6 = /VALUE "Comments", "(.*?)\\?0?"/.exec(sLine); + var oMatch7 = /VALUE "Translation", (.*?)$/.exec(sLine); + if (oMatch5) { //StringFileInfo.Block... + sString = oMatch5[1]; + sComment = "StringFileInfo.Block"; + } else if (oMatch6) { //StringFileInfo.Comments... + sString = oMatch6[1]; + sComment = "You should use a string like \"Translated by \" followed by the translator names for this string. It is ONLY VISIBLE in the StringFileInfo.Comments property from the final resource file!"; + } else if (oMatch7) { //VarFileInfo.Translation... + sString = oMatch7[1]; + sComment = "VarFileInfo.Translation"; + } + break; + } + } + + if (sString !== "") { + var sKey = sContext + sString; + var oString = { "Comment": "", "References": "", "Context": "", "Id": "", "Str": "" }; + if (sKey in oStrings) { //If the key is already used... + oString = oStrings[sKey]; + } + if (sComment !== "") { + oString.Comment = sComment; + } + if (bInsertLineNumbers) { + if (oString.References !== "") { + oString.References = oString.References + "\t" + sReference; + } else { + oString.References = sReference; + } + } + oString.Context = sContext; + oString.Id = sString; + oString.Str = ""; + + if (sKey in oStrings) { //If the key is already used... + oStrings[sKey] = oString; + } else { //If the key is NOT already used... + oStrings[sContext + sString] = oString; + } + } + fContinuation = (sLine !== "") && ",|".indexOf(sLine.substring(sLine.length - 1)) >= 0; + } + oRcFile.Close(); + } + return oStrings; +} + +//// +// ... +function GetStringBlacklist(sTxtFilePath) { + var oBlacklist = {}; + if (oFSO.FileExists(sTxtFilePath)) { //If the blacklist file exists... + var oTxtFile = oFSO.OpenTextFile(sTxtFilePath, ForReading); + while (!oTxtFile.AtEndOfStream) { //For all lines... + var sLine = oTxtFile.ReadLine().replace(/^\s+|\s+$/g, ""); + if (sLine !== "") { + if (!(sLine in oBlacklist)) { //If the key is NOT already used... + oBlacklist[sLine] = true; + } + } + } + oTxtFile.Close(); + } + return oBlacklist; +} + +//// +// ... +function CreateMasterPotFile(sPotPath, oStrings) { + var oPotFile = oFSO.CreateTextFile(sPotPath, true); + + oPotFile.Write("# This file is part from WinMerge \n"); + oPotFile.Write("# Released under the \"GNU General Public License\"\n"); + oPotFile.Write("#\n"); + oPotFile.Write("msgid \"\"\n"); + oPotFile.Write("msgstr \"\"\n"); + oPotFile.Write("\"Project-Id-Version: WinMerge\\n\"\n"); + oPotFile.Write("\"Report-Msgid-Bugs-To: https://bugs.winmerge.org/\\n\"\n"); + oPotFile.Write("\"POT-Creation-Date: " + GetPotCreationDate() + "\\n\"\n"); + oPotFile.Write("\"PO-Revision-Date: \\n\"\n"); + oPotFile.Write("\"Last-Translator: \\n\"\n"); + oPotFile.Write("\"Language-Team: English \\n\"\n"); + oPotFile.Write("\"MIME-Version: 1.0\\n\"\n"); + oPotFile.Write("\"Content-Type: text/plain; charset=UTF-8\\n\"\n"); + oPotFile.Write("\"Content-Transfer-Encoding: 8bit\\n\"\n"); + oPotFile.Write("\"X-Poedit-Language: English\\n\"\n"); + oPotFile.Write("\"X-Poedit-SourceCharset: UTF-8\\n\"\n"); + oPotFile.Write("\"X-Poedit-Basepath: ../../Src/\\n\"\n"); + //oPotFile.Write("""X-Generator: CreateMasterPotFile.js\\n""\n" + oPotFile.Write("\n"); + for (var sKey in oStrings) { //For all strings... + var oString = oStrings[sKey]; + if (oString.Comment !== "") { //If comment exists... + oPotFile.Write("#. " + oString.Comment + "\n"); + } + if (bInsertLineNumbers) { + var aReferences = oString.References.split("\t"); + for (var i = 0; i < aReferences.length; i++) { //For all references... + oPotFile.Write("#: " + aReferences[i] + "\n"); + } + } + if (oString.Id.indexOf("%") >= 0) { //If c-format... + oPotFile.Write("#, c-format\n"); + } + if (oString.Context !== "") { //If context exists... + oPotFile.Write("msgctxt \"" + oString.Context + "\"\n"); + } + oPotFile.Write("msgid \"" + oString.Id + "\"\n"); + oPotFile.Write("msgstr \"\"\n"); + oPotFile.Write("\n"); + } + oPotFile.Close(); +} + +//// +// ... +function GetPotCreationDate() { + var oNow = new Date(); + var sYear = oNow.getFullYear(); + var sMonth = oNow.getMonth(); + if (sMonth < 10) { sMonth = "0" + sMonth; } + var sDay = oNow.getDay(); + if (sDay < 10) { sDay = "0" + sDay; } + var sHour = oNow.getHours(); + if (sHour < 10) { sHour = "0" + sHour; } + var sMinute = oNow.getMinutes(); + if (sMinute < 10) { sMinute = "0" + sMinute; } + + return sYear + "-" + sMonth + "-" + sDay + " " + sHour + ":" + sMinute + "+0000"; +} + +//// +// ... +function InfoBox(sText, iSecondsToWait) { + if (!bRunFromCmd) { //If run from command line... + var oShell = Wscript.CreateObject("WScript.Shell"); + return oShell.Popup(sText, iSecondsToWait, Wscript.ScriptName, 64); + } else { //If NOT run from command line... + Wscript.Echo(sText); + } +} + +//// +// ... +function GetArchiveBit(sFilePath) { + if (oFSO.FileExists(sFilePath)) { //If the file exists... + var oFile = oFSO.GetFile(sFilePath); + if (oFile.Attributes & 32) { //If archive bit set... + return true; + } + } + return false; +} + +//// +// ... +function SetArchiveBit(sFilePath, bValue) { + if (oFSO.FileExists(sFilePath)) { //If the file exists... + var oFile = oFSO.GetFile(sFilePath); + if (oFile.Attributes & 32) { //If archive bit set... + if (!bValue) { + oFile.Attributes -= 32; + } + } else { //If archive bit NOT set... + if (bValue) { + oFile.Attributes += 32; + } + } + } +} diff --git a/Translations/WinMerge/CreateMasterPotFile.vbs b/Translations/WinMerge/CreateMasterPotFile.vbs deleted file mode 100644 index 7840e2a0be3..00000000000 --- a/Translations/WinMerge/CreateMasterPotFile.vbs +++ /dev/null @@ -1,393 +0,0 @@ -Option Explicit -'' -' This script creates the master POT file (English.pot). -' -' Copyright (C) 2007-2009 by Tim Gerundt -' Released under the "GNU General Public License" - -Const ForReading = 1 - -Const NO_BLOCK = 0 -Const MENU_BLOCK = 1 -Const DIALOGEX_BLOCK = 2 -Const STRINGTABLE_BLOCK = 3 -Const VERSIONINFO_BLOCK = 4 -Const ACCELERATORS_BLOCK = 5 - -Const PATH_ENGLISH_POT = "English.pot" -Const PATH_MERGE_RC = "../../Src/Merge.rc" -Const PATH_PLUGIN_STRINGS_RC = "../../Plugins/Strings.rc" - -Dim oFSO, bRunFromCmd, bInsertLineNumbers - -Set oFSO = CreateObject("Scripting.FileSystemObject") - -bRunFromCmd = False -If LCase(oFSO.GetFileName(Wscript.FullName)) = "cscript.exe" Then - bRunFromCmd = True -End If -bInsertLineNumbers = False -If WScript.Arguments.Named.Exists("InsertLineNumbers") Then - bInsertLineNumbers = CBool(WScript.Arguments.Named("InsertLineNumbers")) -End If - -Call Main - -'' -' ... -Sub Main - Dim oStrings - Dim StartTime, EndTime, Seconds - Dim bNecessary, oFile - - StartTime = Time - - InfoBox "Creating POT file from Merge.rc...", 3 - - bNecessary = True - If (oFSO.FileExists(PATH_ENGLISH_POT) = True) Then 'If the POT file exists... - bNecessary = GetArchiveBit(PATH_MERGE_RC) Or GetArchiveBit(PATH_ENGLISH_POT) 'RCs or POT file changed? - End If - - If (bNecessary = True) Then 'If update necessary... - Set oStrings = MergeDictionaries( _ - GetStringsFromRcFile(PATH_MERGE_RC), _ - GetStringsFromRcFile(PATH_PLUGIN_STRINGS_RC)) - CreateMasterPotFile PATH_ENGLISH_POT, oStrings - SetArchiveBit PATH_MERGE_RC, False - SetArchiveBit PATH_PLUGIN_STRINGS_RC, False - SetArchiveBit PATH_ENGLISH_POT, False - For Each oFile In oFSO.GetFolder(".").Files 'For all files in the current folder... - If (LCase(oFSO.GetExtensionName(oFile.Name)) = "po") Then 'If a PO file... - SetArchiveBit oFile.Path, True - End If - Next - - EndTime = Time - Seconds = DateDiff("s", StartTime, EndTime) - - InfoBox "POT file created, after " & Seconds & " second(s).", 10 - Else 'If update NOT necessary... - InfoBox "POT file already up-to-date.", 10 - End If -End Sub - -'' -' ... -Class CString - Dim Comment, References, Context, Id, Str -End Class - - -'' -' ... -Function MergeDictionaries(dict1, dict2) - Dim mergedDict - Set mergedDict = CreateObject("Scripting.Dictionary") - - Dim key - For Each key In dict1.Keys - mergedDict.Add key, dict1.Item(key) - Next - - For Each key In dict2.Keys - If Not mergedDict.Exists(key) Then - mergedDict.Add key, dict2.Item(key) - End If - Next - - Set MergeDictionaries = mergedDict -End Function - -'' -' ... -Function GetStringsFromRcFile(ByVal sRcFilePath) - Dim oBlacklist, oStrings, oString, oRcFile, sLine, iLine - Dim sRcFileName, iBlockType, sReference, sString, sComment, sContext, oMatch, sTemp, sKey - Dim fContinuation - - Set oBlacklist = GetStringBlacklist("StringBlacklist.txt") - - Set oStrings = CreateObject("Scripting.Dictionary") - - If (oFSO.FileExists(sRcFilePath) = True) Then 'If the RC file exists... - sRcFileName = oFSO.GetFileName(sRcFilePath) - iLine = 0 - iBlockType = NO_BLOCK - Set oRcFile = oFSO.OpenTextFile(sRcFilePath, ForReading) - Do Until oRcFile.AtEndOfStream = True 'For all lines... - sLine = Trim(oRcFile.ReadLine) - iLine = iLine + 1 - - sReference = sRcFileName & ":" & iLine - sString = "" - sComment = "" - sContext = "" - - If fContinuation Then - ' Nothing to do - ElseIf (InStr(sLine, " MENU") > 0) And (InStr(sLine, "IDR_") > 0) Then 'MENU... - iBlockType = MENU_BLOCK - ElseIf (InStr(sLine, " DIALOGEX") > 0) Then 'DIALOGEX... - iBlockType = DIALOGEX_BLOCK - ElseIf (sLine = "STRINGTABLE") Then 'STRINGTABLE... - iBlockType = STRINGTABLE_BLOCK - ElseIf (InStr(sLine, " VERSIONINFO") > 0) Then 'VERSIONINFO... - iBlockType = VERSIONINFO_BLOCK - ElseIf (InStr(sLine, " ACCELERATORS") > 0) Then 'ACCELERATORS... - iBlockType = ACCELERATORS_BLOCK - ElseIf (sLine = "BEGIN") Then 'BEGIN... - 'IGNORE FOR SPEEDUP! - ElseIf (sLine = "END") Then 'END... - If (iBlockType = STRINGTABLE_BLOCK) Then 'If inside stringtable... - iBlockType = NO_BLOCK - End If - ElseIf (Left(sLine, 2) = "//") Then 'If comment line... - sLine = "" - 'IGNORE FOR SPEEDUP! - ElseIf (sLine <> "") Then 'If NOT empty line... - Select Case iBlockType - Case NO_BLOCK: - If (FoundRegExpMatch(sLine, "LANGUAGE (LANG_\w*, SUBLANG_\w*)", oMatch) = True) Then 'LANGUAGE... - sString = oMatch.SubMatches(0) - sComment = "LANGUAGE, SUBLANGUAGE" - End If - - Case MENU_BLOCK, DIALOGEX_BLOCK, STRINGTABLE_BLOCK: - If (InStr(sLine, """") > 0) Then 'If quote found (for speedup)... - '-------------------------------------------------------------------------------- - ' Replace 1st string literal only - 2nd string literal specifies control class! - '-------------------------------------------------------------------------------- - If FoundRegExpMatch(sLine, "NC_\s*\(""([^""]*)""\s*,\s*""([^""]*)""\s*\)", oMatch) Then 'String... - sContext = Trim(oMatch.SubMatches(0)) - sTemp = oMatch.SubMatches(1) - ElseIf FoundRegExpMatch(sLine, """((?:""""|[^""])*)""", oMatch) Then 'String... - sTemp = oMatch.SubMatches(0) - Else - sTemp = "" - End If - If (sTemp <> "") And (oBlacklist.Exists(sTemp) = False) Then 'If NOT blacklisted... - sString = Replace(sTemp, """""", "\""") - If (FoundRegExpMatch(sLine, "//#\. (.*?)$", oMatch) = True) Then 'If found a comment for the translators... - sComment = Trim(oMatch.SubMatches(0)) - ElseIf (FoundRegExpMatch(sLine, "//msgctxt (.*?)$", oMatch) = True) Then 'If found a context for the translation... - sContext = Trim(oMatch.SubMatches(0)) - sComment = sContext - End If - End If - End If - - Case VERSIONINFO_BLOCK: - If (FoundRegExpMatch(sLine, "BLOCK ""([0-9A-F]+)""", oMatch) = True) Then 'StringFileInfo.Block... - sString = oMatch.SubMatches(0) - sComment = "StringFileInfo.Block" - ElseIf (FoundRegExpMatch(sLine, "VALUE ""Comments"", ""(.*?)\\?0?""", oMatch) = True) Then 'StringFileInfo.Comments... - sString = oMatch.SubMatches(0) - sComment = "You should use a string like ""Translated by "" followed by the translator names for this string. It is ONLY VISIBLE in the StringFileInfo.Comments property from the final resource file!" - ElseIf (FoundRegExpMatch(sLine, "VALUE ""Translation"", (.*?)$", oMatch) = True) Then 'VarFileInfo.Translation... - sString = oMatch.SubMatches(0) - sComment = "VarFileInfo.Translation" - End If - - End Select - End If - - If (sString <> "") Then - sKey = sContext & sString - Set oString = New CString - If (oStrings.Exists(sKey) = True) Then 'If the key is already used... - Set oString = oStrings(sKey) - End If - If (sComment <> "") Then - oString.Comment = sComment - End If - If bInsertLineNumbers Then - If (oString.References <> "") Then - oString.References = oString.References & vbTab & sReference - Else - oString.References = sReference - End If - End If - oString.Context = sContext - oString.Id = sString - oString.Str = "" - - If (oStrings.Exists(sKey) = True) Then 'If the key is already used... - Set oStrings(sKey) = oString - Else 'If the key is NOT already used... - oStrings.Add sContext & sString, oString - End If - End If - fContinuation = sLine <> "" And InStr(",|", Right(sLine, 1)) <> 0 - Loop - oRcFile.Close - End If - Set GetStringsFromRcFile = oStrings -End Function - -'' -' ... -Function GetStringBlacklist(ByVal sTxtFilePath) - Dim oBlacklist, oTxtFile, sLine - - Set oBlacklist = CreateObject("Scripting.Dictionary") - - If (oFSO.FileExists(sTxtFilePath) = True) Then 'If the blacklist file exists... - Set oTxtFile = oFSO.OpenTextFile(sTxtFilePath, ForReading) - Do Until oTxtFile.AtEndOfStream = True 'For all lines... - sLine = Trim(oTxtFile.ReadLine) - - If (sLine <> "") Then - If (oBlacklist.Exists(sLine) = False) Then 'If the key is NOT already used... - oBlacklist.Add sLine, True - End If - End If - Loop - oTxtFile.Close - End If - Set GetStringBlacklist = oBlacklist -End Function - -'' -' ... -Sub CreateMasterPotFile(ByVal sPotPath, ByVal oStrings) - Dim oPotFile, sKey, oString, aReferences, i - - Set oPotFile = oFSO.CreateTextFile(sPotPath, True) - - oPotFile.Write "# This file is part from WinMerge " & vbLf - oPotFile.Write "# Released under the ""GNU General Public License""" & vbLf - oPotFile.Write "#" & vbLf - oPotFile.Write "msgid """"" & vbLf - oPotFile.Write "msgstr """"" & vbLf - oPotFile.Write """Project-Id-Version: WinMerge\n""" & vbLf - oPotFile.Write """Report-Msgid-Bugs-To: https://bugs.winmerge.org/\n""" & vbLf - oPotFile.Write """POT-Creation-Date: " & GetPotCreationDate() & "\n""" & vbLf - oPotFile.Write """PO-Revision-Date: \n""" & vbLf - oPotFile.Write """Last-Translator: \n""" & vbLf - oPotFile.Write """Language-Team: English \n""" & vbLf - oPotFile.Write """MIME-Version: 1.0\n""" & vbLf - oPotFile.Write """Content-Type: text/plain; charset=UTF-8\n""" & vbLf - oPotFile.Write """Content-Transfer-Encoding: 8bit\n""" & vbLf - oPotFile.Write """X-Poedit-Language: English\n""" & vbLf - oPotFile.Write """X-Poedit-SourceCharset: UTF-8\n""" & vbLf - oPotFile.Write """X-Poedit-Basepath: ../../Src/\n""" & vbLf - 'oPotFile.Write """X-Generator: CreateMasterPotFile.vbs\n""" & vbLf - oPotFile.Write vbLf - For Each sKey In oStrings.Keys 'For all strings... - Set oString = oStrings(sKey) - If (oString.Comment <> "") Then 'If comment exists... - oPotFile.Write "#. " & oString.Comment & vbLf - End If - If bInsertLineNumbers Then - aReferences = SplitByTab(oString.References) - For i = LBound(aReferences) To UBound(aReferences) 'For all references... - oPotFile.Write "#: " & aReferences(i) & vbLf - Next - End If - If (InStr(oString.Id, "%") > 0) Then 'If c-format... - oPotFile.Write "#, c-format" & vbLf - End If - If (oString.Context <> "") Then 'If context exists... - oPotFile.Write "msgctxt """ & oString.Context & """" & vbLf - End If - oPotFile.Write "msgid """ & oString.Id & """" & vbLf - oPotFile.Write "msgstr """"" & vbLf - oPotFile.Write vbLf - Next - oPotFile.Close -End Sub - -'' -' ... -Function FoundRegExpMatch(ByVal sString, ByVal sPattern, ByRef oMatchReturn) - Dim oRegExp, oMatches - - Set oRegExp = New RegExp - oRegExp.Pattern = sPattern - oRegExp.IgnoreCase = True - - oMatchReturn = Null - FoundRegExpMatch = False - If (oRegExp.Test(sString) = True) Then - Set oMatches = oRegExp.Execute(sString) - Set oMatchReturn = oMatches(0) - FoundRegExpMatch = True - End If -End Function - -'' -' ... -Function SplitByTab(ByVal sString) - SplitByTab = Array() - If (InStr(sString, vbTab) > 0) Then - SplitByTab = Split(sString, vbTab, -1) - Else - SplitByTab = Array(sString) - End If -End Function - -'' -' ... -Function GetPotCreationDate() - Dim oNow, sYear, sMonth, sDay, sHour, sMinute - - oNow = Now() - sYear = Year(oNow) - sMonth = Month(oNow) - If (sMonth < 10) Then sMonth = "0" & sMonth - sDay = Day(oNow) - If (sDay < 10) Then sDay = "0" & sDay - sHour = Hour(oNow) - If (sHour < 10) Then sHour = "0" & sHour - sMinute = Minute(oNow) - If (sMinute < 10) Then sMinute = "0" & sMinute - - GetPotCreationDate = sYear & "-" & sMonth & "-" & sDay & " " & sHour & ":" & sMinute & "+0000" -End Function - -'' -' ... -Function InfoBox(ByVal sText, ByVal iSecondsToWait) - Dim oShell - - If (bRunFromCmd = False) Then 'If run from command line... - Set oShell = Wscript.CreateObject("WScript.Shell") - InfoBox = oShell.Popup(sText, iSecondsToWait, Wscript.ScriptName, 64) - Else 'If NOT run from command line... - Wscript.Echo sText - End If -End Function - -'' -' ... -Function GetArchiveBit(ByVal sFilePath) - Dim oFile - - GetArchiveBit = False - If (oFSO.FileExists(sFilePath) = True) Then 'If the file exists... - Set oFile = oFSO.GetFile(sFilePath) - If (oFile.Attributes AND 32) Then 'If archive bit set... - GetArchiveBit = True - End If - End If -End Function - -'' -' ... -Sub SetArchiveBit(ByVal sFilePath, ByVal bValue) - Dim oFile - - If (oFSO.FileExists(sFilePath) = True) Then 'If the file exists... - Set oFile = oFSO.GetFile(sFilePath) - If (oFile.Attributes AND 32) Then 'If archive bit set... - If (bValue = False) Then - oFile.Attributes = oFile.Attributes - 32 - End If - Else 'If archive bit NOT set... - If (bValue = True) Then - oFile.Attributes = oFile.Attributes + 32 - End If - End If - End If -End Sub diff --git a/Translations/WinMerge/UpdatePoFilesFromPotFile.vbs b/Translations/WinMerge/UpdatePoFilesFromPotFile.js similarity index 100% rename from Translations/WinMerge/UpdatePoFilesFromPotFile.vbs rename to Translations/WinMerge/UpdatePoFilesFromPotFile.js diff --git a/WinMerge.vs2017.sln b/WinMerge.vs2017.sln index bb6b3ca7134..56ceb72ddc4 100644 --- a/WinMerge.vs2017.sln +++ b/WinMerge.vs2017.sln @@ -37,9 +37,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Batch Files", "Batch Files" UploadToVirusTotal.cmd = UploadToVirusTotal.cmd EndProjectSection EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "VBS Scripts", "VBS Scripts", "{8B625EC8-5063-4336-84F9-AA7FD5348525}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Scripts", "Scripts", "{8B625EC8-5063-4336-84F9-AA7FD5348525}" ProjectSection(SolutionItems) = preProject - ExpandEnvironmenStrings.vbs = ExpandEnvironmenStrings.vbs + ExpandEnvironmenStrings.js = ExpandEnvironmenStrings.js EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GUITests", "Testing\GoogleTest\GUITests\GUITests.vcxproj", "{0A3727B1-51E7-4702-AD0C-8AEE317EA510}" diff --git a/WinMerge.vs2019.sln b/WinMerge.vs2019.sln index f90ee061cb6..33e49f5e67a 100644 --- a/WinMerge.vs2019.sln +++ b/WinMerge.vs2019.sln @@ -37,9 +37,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Batch Files", "Batch Files" UploadToVirusTotal.cmd = UploadToVirusTotal.cmd EndProjectSection EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "VBS Scripts", "VBS Scripts", "{8B625EC8-5063-4336-84F9-AA7FD5348525}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Scripts", "Scripts", "{8B625EC8-5063-4336-84F9-AA7FD5348525}" ProjectSection(SolutionItems) = preProject - ExpandEnvironmenStrings.vbs = ExpandEnvironmenStrings.vbs + ExpandEnvironmenStrings.js = ExpandEnvironmenStrings.js EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GUITests", "Testing\GoogleTest\GUITests\GUITests.vcxproj", "{0A3727B1-51E7-4702-AD0C-8AEE317EA510}" diff --git a/WinMerge.vs2022.sln b/WinMerge.vs2022.sln index 267b414bc92..408153712e7 100644 --- a/WinMerge.vs2022.sln +++ b/WinMerge.vs2022.sln @@ -37,9 +37,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Batch Files", "Batch Files" UploadToVirusTotal.cmd = UploadToVirusTotal.cmd EndProjectSection EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "VBS Scripts", "VBS Scripts", "{8B625EC8-5063-4336-84F9-AA7FD5348525}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Scripts", "Scripts", "{8B625EC8-5063-4336-84F9-AA7FD5348525}" ProjectSection(SolutionItems) = preProject - ExpandEnvironmenStrings.vbs = ExpandEnvironmenStrings.vbs + ExpandEnvironmenStrings.js = ExpandEnvironmenStrings.js EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GUITests", "Testing\GoogleTest\GUITests\GUITests.vcxproj", "{0A3727B1-51E7-4702-AD0C-8AEE317EA510}" From 811ed5b84e633bb09575dd22e233756f001a1da9 Mon Sep 17 00:00:00 2001 From: Takashi Sawanaka Date: Mon, 12 Feb 2024 11:09:42 +0900 Subject: [PATCH 39/58] WIP --- .../ShellExtension/CreateMasterPotFile.js | 478 ++++++++---------- Translations/WinMerge/CreateMasterPotFile.js | 18 +- Translations/WinMerge/English.pot | 2 +- 3 files changed, 224 insertions(+), 274 deletions(-) diff --git a/Translations/ShellExtension/CreateMasterPotFile.js b/Translations/ShellExtension/CreateMasterPotFile.js index 6a46926756a..8c92dc12fe2 100644 --- a/Translations/ShellExtension/CreateMasterPotFile.js +++ b/Translations/ShellExtension/CreateMasterPotFile.js @@ -1,308 +1,258 @@ -Option Explicit -'' -' This script creates the master POT file (English.pot) for the shell extension. -' -' Copyright (C) 2007-2009 by Tim Gerundt -' Released under the "GNU General Public License" +//// +// This script creates the master POT file (English.pot) for the shell extension. +// +// Copyright (C) 2007-2009 by Tim Gerundt +// Released under the "GNU General Public License -Const ForReading = 1 +var ForReading = 1; -Const NO_BLOCK = 0 -Const STRINGTABLE_BLOCK = 1 +var NO_BLOCK = 0; +var STRINGTABLE_BLOCK = 1; -Const PATH_ENGLISH_POT = "English.pot" -Const PATH_SHELLEXTTEMPLATE_RC = "../../ShellExtension/ShellExtension/ShellExtension.rc" +var PATH_ENGLISH_POT = "English.pot"; +var PATH_SHELLEXTTEMPLATE_RC = "../../ShellExtension/ShellExtension/ShellExtension.rc"; -Dim oFSO, bRunFromCmd +var bRunFromCmd; -Set oFSO = CreateObject("Scripting.FileSystemObject") +var oFSO = new ActiveXObject("Scripting.FileSystemObject"); -bRunFromCmd = False -If LCase(oFSO.GetFileName(Wscript.FullName)) = "cscript.exe" Then - bRunFromCmd = True -End If +var bRunFromCmd = false; +if (oFSO.GetFileName(WScript.FullName).toLowerCase() === "cscript.exe") { + bRunFromCmd = true; +} -Call Main +Main(); -'' -' ... -Sub Main - Dim oStrings, sCodePage - Dim StartTime, EndTime, Seconds - Dim bNecessary, oFile +//// +// ... +function Main() { + var StartTime = new Date().getTime(); - StartTime = Time + InfoBox("Creating POT file from ShellExtension.rc...", 3); - InfoBox "Creating POT file from ShellExtension.rc...", 3 + var bNecessary = true; + if (oFSO.FileExists(PATH_ENGLISH_POT) && oFSO.FileExists(PATH_SHELLEXTTEMPLATE_RC)) { //if the POT and RC file exists... + bNecessary = GetArchiveBit(PATH_SHELLEXTTEMPLATE_RC) || GetArchiveBit(PATH_ENGLISH_POT); //RCs or POT file changed? + } - bNecessary = True - If (oFSO.FileExists(PATH_ENGLISH_POT) = True) And (oFSO.FileExists(PATH_SHELLEXTTEMPLATE_RC) = True) Then 'If the POT and RC file exists... - bNecessary = GetArchiveBit(PATH_SHELLEXTTEMPLATE_RC) Or GetArchiveBit(PATH_ENGLISH_POT) 'RCs or POT file changed? - End If - - If (bNecessary = True) Then 'If update necessary... - Set oStrings = GetStringsFromRcFile(PATH_SHELLEXTTEMPLATE_RC, sCodePage) - CreateMasterPotFile PATH_ENGLISH_POT, oStrings, sCodePage - SetArchiveBit PATH_SHELLEXTTEMPLATE_RC, False - SetArchiveBit PATH_ENGLISH_POT, False - For Each oFile In oFSO.GetFolder(".").Files 'For all files in the current folder... - If (LCase(oFSO.GetExtensionName(oFile.Name)) = "po") Then 'If a PO file... - SetArchiveBit oFile.Path, True - End If - Next + if (bNecessary) { //if update necessary... + var oStrings = GetStringsFromRcFile(PATH_SHELLEXTTEMPLATE_RC, sCodePage); + CreateMasterPotFile(PATH_ENGLISH_POT, oStrings, sCodePage); + SetArchiveBit(PATH_SHELLEXTTEMPLATE_RC, false); + SetArchiveBit(PATH_ENGLISH_POT, false); + for (var it = new Enumerator(oFSO.GetFolder(".").Files); !it.atEnd(); it.moveNext()) { //For all files in the current folder... + var oFile = it.item(); + if (oFSO.GetExtensionName(oFile.Name).toLowerCase() === "po") { //If a PO file... + SetArchiveBit(oFile.Path, true); + } + } - EndTime = Time - Seconds = DateDiff("s", StartTime, EndTime) + var EndTime = new Date().getTime(); + var Seconds = (EndTime - StartTime) / 1000.0; - InfoBox "POT file created, after " & Seconds & " second(s).", 10 - Else 'If update NOT necessary... - InfoBox "POT file already up-to-date.", 10 - End If -End Sub - -'' -' ... -Class CString - Dim Comment, References, Context, Id, Str -End Class + InfoBox("POT file created, after " + Seconds + " second(s).", 10); + } else { //if update NOT necessary... + InfoBox("POT file already up-to-date.", 10); + } +} -'' -' ... -Function GetStringsFromRcFile(ByVal sRcFilePath, ByRef sCodePage) +//// +// ... +function GetStringsFromRcFile(ByVal sRcFilePath, ByRef sCodePage) Dim oStrings, oString, oRcFile, sLine, iLine Dim sRcFileName, iBlockType, sReference, sString, sComment, sContext, oMatch, sTemp, sKey - Set oStrings = CreateObject("Scripting.Dictionary") - - If (oFSO.FileExists(sRcFilePath) = True) Then 'If the RC file exists... - sRcFileName = oFSO.GetFileName(sRcFilePath) - iLine = 0 - iBlockType = NO_BLOCK - sCodePage = "" - Set oRcFile = oFSO.OpenTextFile(sRcFilePath, ForReading) - Do Until oRcFile.AtEndOfStream = True 'For all lines... - sLine = Trim(oRcFile.ReadLine) - iLine = iLine + 1 + var oStrings = {}; + if (oFSO.FileExists(sRcFilePath)) { //if the RC file exists... + var sRcFileName = oFSO.GetFileName(sRcFilePath); + var iLine = 0; + var iBlockType = NO_BLOCK; + var sCodePage = ""; + var oRcFile = oFSO.OpenTextFile(sRcFilePath, ForReading); + while (!oRcFile.AtEndOfStream) { //For all lines... + var sLine = oRcFile.ReadLine().replace(/^\s+|\s+$/g, ""); + iLine++; - sReference = sRcFileName & ":" & iLine - sString = "" - sComment = "" - sContext = "" + var sReference = sRcFileName + ":" + iLine; + var sString = ""; + var sComment = ""; + var sContext = ""; - If (sLine = "STRINGTABLE") Then 'STRINGTABLE... + if (sLine === "STRINGTABLE") { //STRINGTABLE... iBlockType = STRINGTABLE_BLOCK - ElseIf (sLine = "BEGIN") Then 'BEGIN... - 'IGNORE FOR SPEEDUP! - ElseIf (sLine = "END") Then 'END... - If (iBlockType = STRINGTABLE_BLOCK) Then 'If inside stringtable... - iBlockType = NO_BLOCK - End If - ElseIf (Left(sLine, 2) = "//") Then 'If comment line... - sLine = "" - 'IGNORE FOR SPEEDUP! - ElseIf (sLine <> "") Then 'If NOT empty line... - Select Case iBlockType + } else if (sLine === "BEGIN") { //BEGIN... + //IGNORE FOR SPEEDUP! + } else if (sLine === "END") { //END... + if (iBlockType === STRINGTABLE_BLOCK) { //If inside stringtable... + iBlockType = NO_BLOCK; + } + } else if (sLine.substring(0, 2) === "//") { //If comment line... + sLine = ""; + //IGNORE FOR SPEEDUP! + } else if (sLine !== "") { //if NOT empty line... + switch (iBlockType) { Case NO_BLOCK: - If (FoundRegExpMatch(sLine, "defined\((AFX_TARG_\w*)\)", oMatch) = True) Then 'AFX_TARG_*... + if (FoundRegExpMatch(sLine, "defined\((AFX_TARG_\w*)\)", oMatch)) { //AFX_TARG_*... sString = oMatch.SubMatches(0) sComment = "AFX_TARG_*" - ElseIf (FoundRegExpMatch(sLine, "LANGUAGE (LANG_\w*, SUBLANG_\w*)", oMatch) = True) Then 'LANGUAGE... + } else if (FoundRegExpMatch(sLine, "LANGUAGE (LANG_\w*, function LANG_\w*)", oMatch)) { //LANGUAGE... sString = oMatch.SubMatches(0) - sComment = "LANGUAGE, SUBLANGUAGE" - ElseIf (FoundRegExpMatch(sLine, "code_page\(([\d]+)\)", oMatch) = True) Then 'code_page... + sComment = "LANGUAGE, function LANGUAGE" + } else if (FoundRegExpMatch(sLine, "code_page\(([\d]+)\)", oMatch)) { //code_page... sString = oMatch.SubMatches(0) sComment = "Codepage" sCodePage = oMatch.SubMatches(0) - End If + } Case STRINGTABLE_BLOCK: - If (InStr(sLine, """") > 0) Then 'If quote found (for speedup)... - '-------------------------------------------------------------------------------- - ' Replace 1st string literal only - 2nd string literal specifies control class! - '-------------------------------------------------------------------------------- - If FoundRegExpMatch(sLine, """((?:""""|[^""])*)""", oMatch) Then 'String... + if (sLine.indexOf("\"") >= 0) { //If quote found (for speedup)... + //-------------------------------------------------------------------------------- + // Replace 1st string literal only - 2nd string literal specifies control class! + //-------------------------------------------------------------------------------- + if FoundRegExpMatch(sLine, """((?:""""|[^""])*)""", oMatch) { //String... sTemp = oMatch.SubMatches(0) - If (sTemp <> "") Then 'If NOT empty... + if (sTemp !== "") { //if NOT empty... sString = Replace(sTemp, """""", "\""") - If (FoundRegExpMatch(sLine, "//#\. (.*?)$", oMatch) = True) Then 'If found a comment for the translators... + if (FoundRegExpMatch(sLine, "//#\. (.*?)$", oMatch)) { //if found a comment for the translators... sComment = Trim(oMatch.SubMatches(0)) - ElseIf (FoundRegExpMatch(sLine, "//msgctxt (.*?)$", oMatch) = True) Then 'If found a context for the translation... + } else if (FoundRegExpMatch(sLine, "//msgctxt (.*?)$", oMatch)) { //if found a context for the translation... sContext = Trim(oMatch.SubMatches(0)) sComment = sContext - End If - End If - End If - End If + } + } + } + } - End Select - End If + } + } - If (sString <> "") Then - sKey = sContext & sString - Set oString = New CString - If (oStrings.Exists(sKey) = True) Then 'If the key is already used... - Set oString = oStrings(sKey) - End If - If (sComment <> "") Then - oString.Comment = sComment - End If - If (oString.References <> "") Then - oString.References = oString.References & vbTab & sReference - Else - oString.References = sReference - End If - oString.Context = sContext - oString.Id = sString - oString.Str = "" + if (sString !== "") { + var sKey = sContext + sString; + var oString = { "Comment": "", "References": "", "Context": "", "Id": "", "Str": "" }; + if (sKey in oStrings) { //If the key is already used... + oString = oStrings[sKey]; + } + if (sComment !== "") { + oString.Comment = sComment; + } + if (oString.References !== "") { + oString.References = oString.References + "\t" + sReference + } else { + oString.References = sReference; + } + oString.Context = sContext; + oString.Id = sString; + oString.Str = ""; - If (oStrings.Exists(sKey) = True) Then 'If the key is already used... - Set oStrings(sKey) = oString - Else 'If the key is NOT already used... - oStrings.Add sContext & sString, oString - End If - End If - Loop - oRcFile.Close - End If - Set GetStringsFromRcFile = oStrings -End Function - -'' -' ... -Sub CreateMasterPotFile(ByVal sPotPath, ByVal oStrings, ByVal sCodePage) - Dim oPotFile, sKey, oString, aReferences, i - - Set oPotFile = oFSO.CreateTextFile(sPotPath, True) - - oPotFile.WriteLine "# This file is part from WinMerge " - oPotFile.WriteLine "# Released under the ""GNU General Public License""" - oPotFile.WriteLine "#" - oPotFile.WriteLine "msgid """"" - oPotFile.WriteLine "msgstr """"" - oPotFile.WriteLine """Project-Id-Version: WinMerge Shell Extension\n""" - oPotFile.WriteLine """Report-Msgid-Bugs-To: https://bugs.winmerge.org/\n""" - oPotFile.WriteLine """POT-Creation-Date: " & GetPotCreationDate() & "\n""" - oPotFile.WriteLine """PO-Revision-Date: \n""" - oPotFile.WriteLine """Last-Translator: \n""" - oPotFile.WriteLine """Language-Team: English \n""" - oPotFile.WriteLine """MIME-Version: 1.0\n""" - oPotFile.WriteLine """Content-Type: text/plain; charset=CP" & sCodePage & "\n""" - oPotFile.WriteLine """Content-Transfer-Encoding: 8bit\n""" - oPotFile.WriteLine """X-Poedit-Language: English\n""" - oPotFile.WriteLine """X-Poedit-SourceCharset: CP" & sCodePage & "\n""" - oPotFile.WriteLine """X-Poedit-Basepath: ../../ShellExtension/Languages/\n""" - 'oPotFile.WriteLine """X-Generator: CreateMasterPotFile.vbs\n""" - oPotFile.WriteLine - For Each sKey In oStrings.Keys 'For all strings... - Set oString = oStrings(sKey) - If (oString.Comment <> "") Then 'If comment exists... - oPotFile.WriteLine "#. " & oString.Comment - End If - aReferences = SplitByTab(oString.References) - For i = LBound(aReferences) To UBound(aReferences) 'For all references... - oPotFile.WriteLine "#: " & aReferences(i) - Next - oPotFile.WriteLine "#, c-format" - If (oString.Context <> "") Then 'If context exists... - oPotFile.WriteLine "msgctxt """ & oString.Context & """" - End If - oPotFile.WriteLine "msgid """ & oString.Id & """" - oPotFile.WriteLine "msgstr """"" - oPotFile.WriteLine - Next - oPotFile.Close -End Sub + if (sKey in oStrings) { //If the key is already used... + oStrings[sKey] = oString; + } else { //if the key is NOT already used... + oStrings[sContext + sString] = oString; + } + } + } + oRcFile.Close(); + } + return oStrings; +} -'' -' ... -Function FoundRegExpMatch(ByVal sString, ByVal sPattern, ByRef oMatchReturn) - Dim oRegExp, oMatches +//// +// ... +function CreateMasterPotFile(sPotPath, oStrings, sCodePage) { + var oPotFile = oFSO.CreateTextFile(sPotPath, true); - Set oRegExp = New RegExp - oRegExp.Pattern = sPattern - oRegExp.IgnoreCase = True - - oMatchReturn = Null - FoundRegExpMatch = False - If (oRegExp.Test(sString) = True) Then - Set oMatches = oRegExp.Execute(sString) - Set oMatchReturn = oMatches(0) - FoundRegExpMatch = True - End If -End Function - -'' -' ... -Function SplitByTab(ByVal sString) - SplitByTab = Array() - If (InStr(sString, vbTab) > 0) Then - SplitByTab = Split(sString, vbTab, -1) - Else - SplitByTab = Array(sString) - End If -End Function + oPotFile.WriteLine("# This file is part from WinMerge "); + oPotFile.WriteLine("# Released under the \"GNU General Public License\""); + oPotFile.WriteLine("#"); + oPotFile.WriteLine("msgid \"\""); + oPotFile.WriteLine("msgstr \"\""); + oPotFile.WriteLine("\"Project-Id-Version: WinMerge Shell Extension\n\""); + oPotFile.WriteLine("\"Report-Msgid-Bugs-To: https://bugs.winmerge.org/\n\""); + oPotFile.WriteLine("\"POT-Creation-Date: " + GetPotCreationDate() + "\n\""); + oPotFile.WriteLine("\"PO-Revision-Date: \n\""); + oPotFile.WriteLine("\"Last-Translator: \n\""); + oPotFile.WriteLine("\"Language-Team: English \n\""); + oPotFile.WriteLine("\"MIME-Version: 1.0\n\""); + oPotFile.WriteLine("\"Content-Type: text/plain; charset=CP" + sCodePage + "\n\""); + oPotFile.WriteLine("\"Content-Transfer-Encoding: 8bit\n\""); + oPotFile.WriteLine("\"X-Poedit-Language: English\n\""); + oPotFile.WriteLine("\"X-Poedit-SourceCharset: CP" + sCodePage + "\n\""); + oPotFile.WriteLine("\"X-Poedit-Basepath: ../../ShellExtension/Languages/\n\""); + //oPotFile.WriteLine("\"X-Generator: CreateMasterPotFile.js\n\""); + oPotFile.WriteLine(""); + For (var sKey In oStrings) { //For all strings... + var oString = oStrings[sKey]; + if (oString.Comment !== "") { //if comment exists... + oPotFile.WriteLine("#. " + oString.Comment); + } + var aReferences = oString.References.split("\t"); + for (var i = 0; i < aReferences.length; i++) { //For all references... + oPotFile.WriteLine("#: " + aReferences[i]); + } + oPotFile.WriteLine("#, c-format"); + if (oString.Context !== "") { //if context exists... + oPotFile.WriteLine("msgctxt \"" + oString.Context + "\""); + } + oPotFile.WriteLine("msgid \"" + oString.Id + "\""); + oPotFile.WriteLine("msgstr \"\""); + oPotFile.WriteLine(""); + } + oPotFile.Close(); +} -'' -' ... -Function GetPotCreationDate() - Dim oNow, sYear, sMonth, sDay, sHour, sMinute - - oNow = Now() - sYear = Year(oNow) - sMonth = Month(oNow) - If (sMonth < 10) Then sMonth = "0" & sMonth - sDay = Day(oNow) - If (sDay < 10) Then sDay = "0" & sDay - sHour = Hour(oNow) - If (sHour < 10) Then sHour = "0" & sHour - sMinute = Minute(oNow) - If (sMinute < 10) Then sMinute = "0" & sMinute +//// +// ... +function GetPotCreationDate() { + var oNow = new Date(); + var sYear = oNow.getFullYear(); + var sMonth = oNow.getMonth() + 1; + if (sMonth < 10) { sMonth = "0" + sMonth; } + var sDay = oNow.getDate(); + if (sDay < 10) { sDay = "0" + sDay; } + var sHour = oNow.getHours(); + if (sHour < 10) { sHour = "0" + sHour; } + var sMinute = oNow.getMinutes(); + if (sMinute < 10) { sMinute = "0" + sMinute; } - GetPotCreationDate = sYear & "-" & sMonth & "-" & sDay & " " & sHour & ":" & sMinute & "+0000" -End Function + return sYear + "-" + sMonth + "-" + sDay + " " + sHour + ":" + sMinute + "+0000"; +} -'' -' ... -Function InfoBox(ByVal sText, ByVal iSecondsToWait) - Dim oShell - - If (bRunFromCmd = False) Then 'If run from command line... - Set oShell = Wscript.CreateObject("WScript.Shell") - InfoBox = oShell.Popup(sText, iSecondsToWait, Wscript.ScriptName, 64) - Else 'If NOT run from command line... - Wscript.Echo sText - End If -End Function +//// +// ... +function InfoBox(sText, iSecondsToWait) { + if (!bRunFromCmd) { //if run from command line... + var oShell = WScript.CreateObject("WScript.Shell"); + return oShell.Popup(sText, iSecondsToWait, WScript.ScriptName, 64); + } else { //if NOT run from command line... + WScript.Echo(sText); + } +} -'' -' ... -Function GetArchiveBit(ByVal sFilePath) - Dim oFile - - GetArchiveBit = False - If (oFSO.FileExists(sFilePath) = True) Then 'If the file exists... - Set oFile = oFSO.GetFile(sFilePath) - If (oFile.Attributes AND 32) Then 'If archive bit set... - GetArchiveBit = True - End If - End If -End Function +//// +// ... +function GetArchiveBit(sFilePath) { + if (oFSO.FileExists(sFilePath)) { //if the file exists... + var oFile = oFSO.GetFile(sFilePath); + if (oFile.Attributes & 32) { //if archive bit set... + return true; + } + } + return false; +} -'' -' ... -Sub SetArchiveBit(ByVal sFilePath, ByVal bValue) - Dim oFile - - If (oFSO.FileExists(sFilePath) = True) Then 'If the file exists... - Set oFile = oFSO.GetFile(sFilePath) - If (oFile.Attributes AND 32) Then 'If archive bit set... - If (bValue = False) Then - oFile.Attributes = oFile.Attributes - 32 - End If - Else 'If archive bit NOT set... - If (bValue = True) Then - oFile.Attributes = oFile.Attributes + 32 - End If - End If - End If -End Sub +//// +// ... +function SetArchiveBit(sFilePath, bValue) { + if (oFSO.FileExists(sFilePath)) { //if the file exists... + var oFile = oFSO.GetFile(sFilePath); + if (oFile.Attributes & 32) { //if archive bit set... + if (!bValue) { + oFile.Attributes -= 32; + } + } else { //if archive bit NOT set... + if (bValue) { + oFile.Attributes += 32; + } + } + } +} diff --git a/Translations/WinMerge/CreateMasterPotFile.js b/Translations/WinMerge/CreateMasterPotFile.js index c926b17ad56..002768c3163 100644 --- a/Translations/WinMerge/CreateMasterPotFile.js +++ b/Translations/WinMerge/CreateMasterPotFile.js @@ -1,4 +1,4 @@ -//// +//// // This script creates the master POT file (English.pot). // // Copyright (C) 2007-2009 by Tim Gerundt @@ -17,10 +17,10 @@ var PATH_ENGLISH_POT = "English.pot"; var PATH_MERGE_RC = "../../Src/Merge.rc"; var PATH_PLUGIN_STRINGS_RC = "../../Plugins/Strings.rc"; -var oFSO = new ActiveX("Scripting.FileSystemObject"); +var oFSO = new ActiveXObject("Scripting.FileSystemObject"); var bRunFromCmd = false; -if (oFSO.GetFileName(Wscript.FullName).toLowerCase() === "cscript.exe") { +if (oFSO.GetFileName(WScript.FullName).toLowerCase() === "cscript.exe") { bRunFromCmd = true; } var bInsertLineNumbers = false; @@ -257,7 +257,7 @@ function CreateMasterPotFile(sPotPath, oStrings) { oPotFile.Write("\"X-Poedit-Language: English\\n\"\n"); oPotFile.Write("\"X-Poedit-SourceCharset: UTF-8\\n\"\n"); oPotFile.Write("\"X-Poedit-Basepath: ../../Src/\\n\"\n"); - //oPotFile.Write("""X-Generator: CreateMasterPotFile.js\\n""\n" + //oPotFile.Write("\"X-Generator: CreateMasterPotFile.js\\n""\n" oPotFile.Write("\n"); for (var sKey in oStrings) { //For all strings... var oString = oStrings[sKey]; @@ -288,9 +288,9 @@ function CreateMasterPotFile(sPotPath, oStrings) { function GetPotCreationDate() { var oNow = new Date(); var sYear = oNow.getFullYear(); - var sMonth = oNow.getMonth(); + var sMonth = oNow.getMonth() + 1; if (sMonth < 10) { sMonth = "0" + sMonth; } - var sDay = oNow.getDay(); + var sDay = oNow.getDate(); if (sDay < 10) { sDay = "0" + sDay; } var sHour = oNow.getHours(); if (sHour < 10) { sHour = "0" + sHour; } @@ -304,10 +304,10 @@ function GetPotCreationDate() { // ... function InfoBox(sText, iSecondsToWait) { if (!bRunFromCmd) { //If run from command line... - var oShell = Wscript.CreateObject("WScript.Shell"); - return oShell.Popup(sText, iSecondsToWait, Wscript.ScriptName, 64); + var oShell = WScript.CreateObject("WScript.Shell"); + return oShell.Popup(sText, iSecondsToWait, WScript.ScriptName, 64); } else { //If NOT run from command line... - Wscript.Echo(sText); + WScript.Echo(sText); } } diff --git a/Translations/WinMerge/English.pot b/Translations/WinMerge/English.pot index e0b9aacd8db..cd8111133bc 100644 --- a/Translations/WinMerge/English.pot +++ b/Translations/WinMerge/English.pot @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: WinMerge\n" "Report-Msgid-Bugs-To: https://bugs.winmerge.org/\n" -"POT-Creation-Date: 2023-12-30 17:35+0000\n" +"POT-Creation-Date: 2024-02-12 10:05+0000\n" "PO-Revision-Date: \n" "Last-Translator: \n" "Language-Team: English \n" From afb459959216d6ac18c1ddf00ccc59fa10e28290 Mon Sep 17 00:00:00 2001 From: Takashi Sawanaka Date: Mon, 12 Feb 2024 16:29:09 +0900 Subject: [PATCH 40/58] WIP --- Translations/ShellExtension/Arabic.po | 6 - Translations/ShellExtension/Basque.po | 6 - Translations/ShellExtension/Brazilian.po | 6 - Translations/ShellExtension/Bulgarian.po | 6 - Translations/ShellExtension/Catalan.po | 6 - .../ShellExtension/ChineseSimplified.po | 6 - .../ShellExtension/ChineseTraditional.po | 6 - Translations/ShellExtension/Corsican.po | 6 - .../ShellExtension/CreateMasterPotFile.js | 118 +++++++++--------- Translations/ShellExtension/Croatian.po | 6 - Translations/ShellExtension/Czech.po | 6 - Translations/ShellExtension/Danish.po | 6 - Translations/ShellExtension/Dutch.po | 6 - Translations/ShellExtension/English.pot | 12 +- Translations/ShellExtension/Finnish.po | 6 - Translations/ShellExtension/French.po | 6 - Translations/ShellExtension/Galician.po | 6 - Translations/ShellExtension/German.po | 6 - Translations/ShellExtension/Greek.po | 6 - Translations/ShellExtension/Hungarian.po | 6 - Translations/ShellExtension/Italian.po | 6 - Translations/ShellExtension/Japanese.po | 6 - Translations/ShellExtension/Korean.po | 6 - Translations/ShellExtension/Lithuanian.po | 6 - Translations/ShellExtension/Norwegian.po | 6 - Translations/ShellExtension/Persian.po | 6 - Translations/ShellExtension/Polish.po | 6 - Translations/ShellExtension/Portuguese.po | 6 - Translations/ShellExtension/Romanian.po | 6 - Translations/ShellExtension/Russian.po | 6 - Translations/ShellExtension/Serbian.po | 6 - Translations/ShellExtension/Sinhala.po | 6 - Translations/ShellExtension/Slovak.po | 6 - Translations/ShellExtension/Slovenian.po | 6 - Translations/ShellExtension/Spanish.po | 6 - Translations/ShellExtension/Swedish.po | 6 - Translations/ShellExtension/Tamil.po | 6 - Translations/ShellExtension/Turkish.po | 6 - Translations/ShellExtension/Ukrainian.po | 6 - 39 files changed, 61 insertions(+), 291 deletions(-) diff --git a/Translations/ShellExtension/Arabic.po b/Translations/ShellExtension/Arabic.po index 2ee91550b69..90b77c27846 100644 --- a/Translations/ShellExtension/Arabic.po +++ b/Translations/ShellExtension/Arabic.po @@ -29,12 +29,6 @@ msgstr "AFX_TARG_ARA" msgid "LANG_ENGLISH, SUBLANG_ENGLISH_US" msgstr "LANG_ARABIC, SUBLANG_ARABIC_SAUDI_ARABIA" -#. Codepage -#: ShellExtension.rc:21 -#, c-format -msgid "1252" -msgstr "65001" - #: ShellExtension.rc:111 #, c-format msgid "ShellExtension" diff --git a/Translations/ShellExtension/Basque.po b/Translations/ShellExtension/Basque.po index 4341b16c33c..633c8b25155 100644 --- a/Translations/ShellExtension/Basque.po +++ b/Translations/ShellExtension/Basque.po @@ -29,12 +29,6 @@ msgstr "AFX_TARG_EUQ" msgid "LANG_ENGLISH, SUBLANG_ENGLISH_US" msgstr "LANG_BASQUE, SUBLANG_DEFAULT" -#. Codepage -#: ShellExtension.rc:21 -#, c-format -msgid "1252" -msgstr "65001" - #: ShellExtension.rc:111 #, c-format msgid "ShellExtension" diff --git a/Translations/ShellExtension/Brazilian.po b/Translations/ShellExtension/Brazilian.po index 88042308319..d5f5fd92219 100644 --- a/Translations/ShellExtension/Brazilian.po +++ b/Translations/ShellExtension/Brazilian.po @@ -29,12 +29,6 @@ msgstr "AFX_TARG_PTB" msgid "LANG_ENGLISH, SUBLANG_ENGLISH_US" msgstr "LANG_PORTUGUESE, SUBLANG_PORTUGUESE_BRAZILIAN" -#. Codepage -#: ShellExtension.rc:21 -#, c-format -msgid "1252" -msgstr "65001" - #: ShellExtension.rc:111 #, c-format msgid "ShellExtension" diff --git a/Translations/ShellExtension/Bulgarian.po b/Translations/ShellExtension/Bulgarian.po index 5a20dcd50c8..caeb7e38c45 100644 --- a/Translations/ShellExtension/Bulgarian.po +++ b/Translations/ShellExtension/Bulgarian.po @@ -28,12 +28,6 @@ msgstr "AFX_TARG_BGR" msgid "LANG_ENGLISH, SUBLANG_ENGLISH_US" msgstr "LANG_BULGARIAN, SUBLANG_DEFAULT" -#. Codepage -#: ShellExtension.rc:21 -#, c-format -msgid "1252" -msgstr "65001" - #: ShellExtension.rc:111 #, c-format msgid "ShellExtension" diff --git a/Translations/ShellExtension/Catalan.po b/Translations/ShellExtension/Catalan.po index ae2d48ba229..4ae617e5225 100644 --- a/Translations/ShellExtension/Catalan.po +++ b/Translations/ShellExtension/Catalan.po @@ -29,12 +29,6 @@ msgstr "AFX_TARG_CAT" msgid "LANG_ENGLISH, SUBLANG_ENGLISH_US" msgstr "LANG_CATALAN, SUBLANG_DEFAULT" -#. Codepage -#: ShellExtension.rc:21 -#, c-format -msgid "1252" -msgstr "65001" - #: ShellExtension.rc:111 #, c-format msgid "ShellExtension" diff --git a/Translations/ShellExtension/ChineseSimplified.po b/Translations/ShellExtension/ChineseSimplified.po index ae0c42b8a9b..8085d960d80 100644 --- a/Translations/ShellExtension/ChineseSimplified.po +++ b/Translations/ShellExtension/ChineseSimplified.po @@ -30,12 +30,6 @@ msgstr "AFX_TARG_CHS" msgid "LANG_ENGLISH, SUBLANG_ENGLISH_US" msgstr "LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED" -#. Codepage -#: ShellExtension.rc:21 -#, c-format -msgid "1252" -msgstr "65001" - #: ShellExtension.rc:111 #, c-format msgid "ShellExtension" diff --git a/Translations/ShellExtension/ChineseTraditional.po b/Translations/ShellExtension/ChineseTraditional.po index c7c0fee1bc7..29b05272a1e 100644 --- a/Translations/ShellExtension/ChineseTraditional.po +++ b/Translations/ShellExtension/ChineseTraditional.po @@ -30,12 +30,6 @@ msgstr "AFX_TARG_CHT" msgid "LANG_ENGLISH, SUBLANG_ENGLISH_US" msgstr "LANG_CHINESE, SUBLANG_CHINESE_TRADITIONAL" -#. Codepage -#: ShellExtension.rc:21 -#, c-format -msgid "1252" -msgstr "65001" - #: ShellExtension.rc:111 #, c-format msgid "ShellExtension" diff --git a/Translations/ShellExtension/Corsican.po b/Translations/ShellExtension/Corsican.po index 674b2ca6807..fceaaa25b30 100644 --- a/Translations/ShellExtension/Corsican.po +++ b/Translations/ShellExtension/Corsican.po @@ -36,12 +36,6 @@ msgstr "AFX_TARG_COS" msgid "LANG_ENGLISH, SUBLANG_ENGLISH_US" msgstr "LANG_CORSICAN, SUBLANG_DEFAULT" -#. Codepage -#: ShellExtension.rc:21 -#, c-format -msgid "1252" -msgstr "65001" - #: ShellExtension.rc:111 #, c-format msgid "ShellExtension" diff --git a/Translations/ShellExtension/CreateMasterPotFile.js b/Translations/ShellExtension/CreateMasterPotFile.js index 8c92dc12fe2..dd72012a097 100644 --- a/Translations/ShellExtension/CreateMasterPotFile.js +++ b/Translations/ShellExtension/CreateMasterPotFile.js @@ -31,13 +31,13 @@ function Main() { InfoBox("Creating POT file from ShellExtension.rc...", 3); var bNecessary = true; - if (oFSO.FileExists(PATH_ENGLISH_POT) && oFSO.FileExists(PATH_SHELLEXTTEMPLATE_RC)) { //if the POT and RC file exists... + if (oFSO.FileExists(PATH_ENGLISH_POT) && oFSO.FileExists(PATH_SHELLEXTTEMPLATE_RC)) { //If the POT and RC file exists... bNecessary = GetArchiveBit(PATH_SHELLEXTTEMPLATE_RC) || GetArchiveBit(PATH_ENGLISH_POT); //RCs or POT file changed? } - if (bNecessary) { //if update necessary... - var oStrings = GetStringsFromRcFile(PATH_SHELLEXTTEMPLATE_RC, sCodePage); - CreateMasterPotFile(PATH_ENGLISH_POT, oStrings, sCodePage); + if (bNecessary) { //If update necessary... + var oStrings = GetStringsFromRcFile(PATH_SHELLEXTTEMPLATE_RC); + CreateMasterPotFile(PATH_ENGLISH_POT, oStrings); SetArchiveBit(PATH_SHELLEXTTEMPLATE_RC, false); SetArchiveBit(PATH_ENGLISH_POT, false); for (var it = new Enumerator(oFSO.GetFolder(".").Files); !it.atEnd(); it.moveNext()) { //For all files in the current folder... @@ -51,23 +51,19 @@ function Main() { var Seconds = (EndTime - StartTime) / 1000.0; InfoBox("POT file created, after " + Seconds + " second(s).", 10); - } else { //if update NOT necessary... + } else { //If update NOT necessary... InfoBox("POT file already up-to-date.", 10); } } //// // ... -function GetStringsFromRcFile(ByVal sRcFilePath, ByRef sCodePage) - Dim oStrings, oString, oRcFile, sLine, iLine - Dim sRcFileName, iBlockType, sReference, sString, sComment, sContext, oMatch, sTemp, sKey - +function GetStringsFromRcFile(sRcFilePath) { var oStrings = {}; - if (oFSO.FileExists(sRcFilePath)) { //if the RC file exists... + if (oFSO.FileExists(sRcFilePath)) { //If the RC file exists... var sRcFileName = oFSO.GetFileName(sRcFilePath); var iLine = 0; var iBlockType = NO_BLOCK; - var sCodePage = ""; var oRcFile = oFSO.OpenTextFile(sRcFilePath, ForReading); while (!oRcFile.AtEndOfStream) { //For all lines... var sLine = oRcFile.ReadLine().replace(/^\s+|\s+$/g, ""); @@ -89,40 +85,42 @@ function GetStringsFromRcFile(ByVal sRcFilePath, ByRef sCodePage) } else if (sLine.substring(0, 2) === "//") { //If comment line... sLine = ""; //IGNORE FOR SPEEDUP! - } else if (sLine !== "") { //if NOT empty line... + } else if (sLine !== "") { //If NOT empty line... switch (iBlockType) { - Case NO_BLOCK: - if (FoundRegExpMatch(sLine, "defined\((AFX_TARG_\w*)\)", oMatch)) { //AFX_TARG_*... - sString = oMatch.SubMatches(0) - sComment = "AFX_TARG_*" - } else if (FoundRegExpMatch(sLine, "LANGUAGE (LANG_\w*, function LANG_\w*)", oMatch)) { //LANGUAGE... - sString = oMatch.SubMatches(0) - sComment = "LANGUAGE, function LANGUAGE" - } else if (FoundRegExpMatch(sLine, "code_page\(([\d]+)\)", oMatch)) { //code_page... - sString = oMatch.SubMatches(0) - sComment = "Codepage" - sCodePage = oMatch.SubMatches(0) + case NO_BLOCK: + var oMatch0 = /defined\((AFX_TARG_\w*)\)/.exec(sLine); + var oMatch1 = /LANGUAGE (LANG_\w*, SUBLANG_\w*)/.exec(sLine); + if (oMatch0) { //AFX_TARG_*... + sString = oMatch0[1]; + sComment = "AFX_TARG_*"; + } else if (oMatch1) { //LANGUAGE... + sString = oMatch1[1]; + sComment = "LANGUAGE, SUBLANGUAGE"; } - - Case STRINGTABLE_BLOCK: + break; + + case STRINGTABLE_BLOCK: if (sLine.indexOf("\"") >= 0) { //If quote found (for speedup)... //-------------------------------------------------------------------------------- // Replace 1st string literal only - 2nd string literal specifies control class! //-------------------------------------------------------------------------------- - if FoundRegExpMatch(sLine, """((?:""""|[^""])*)""", oMatch) { //String... - sTemp = oMatch.SubMatches(0) - if (sTemp !== "") { //if NOT empty... - sString = Replace(sTemp, """""", "\""") - if (FoundRegExpMatch(sLine, "//#\. (.*?)$", oMatch)) { //if found a comment for the translators... - sComment = Trim(oMatch.SubMatches(0)) - } else if (FoundRegExpMatch(sLine, "//msgctxt (.*?)$", oMatch)) { //if found a context for the translation... - sContext = Trim(oMatch.SubMatches(0)) + var oMatch2 = /"((?:""|[^"])*)"/.exec(sLine); + if (oMatch2) { //String... + var sTemp = oMatch2[1]; + if (sTemp !== "") { //If NOT empty... + sString = sTemp.replace(/\"\"/g, "\\\""); + var oMatch3 = /\/\/#\. (.*?)$/.exec(sLine); + var oMatch4 = /\/\/msgctxt (.*?)$/.exec(sLine); + if (oMatch3) { //If found a comment for the translators... + sComment = oMatch3[1].replace(/^\s+|\s+$/g, ""); + } else if (oMatch4) { //If found a context for the translation... + sContext = oMatch4[1].replace(/^\s+|\s+$/g, ""); sComment = sContext } } } } - + break; } } @@ -136,7 +134,7 @@ function GetStringsFromRcFile(ByVal sRcFilePath, ByRef sCodePage) oString.Comment = sComment; } if (oString.References !== "") { - oString.References = oString.References + "\t" + sReference + oString.References = oString.References + "\t" + sReference; } else { oString.References = sReference; } @@ -146,7 +144,7 @@ function GetStringsFromRcFile(ByVal sRcFilePath, ByRef sCodePage) if (sKey in oStrings) { //If the key is already used... oStrings[sKey] = oString; - } else { //if the key is NOT already used... + } else { //If the key is NOT already used... oStrings[sContext + sString] = oString; } } @@ -158,7 +156,7 @@ function GetStringsFromRcFile(ByVal sRcFilePath, ByRef sCodePage) //// // ... -function CreateMasterPotFile(sPotPath, oStrings, sCodePage) { +function CreateMasterPotFile(sPotPath, oStrings) { var oPotFile = oFSO.CreateTextFile(sPotPath, true); oPotFile.WriteLine("# This file is part from WinMerge "); @@ -166,23 +164,23 @@ function CreateMasterPotFile(sPotPath, oStrings, sCodePage) { oPotFile.WriteLine("#"); oPotFile.WriteLine("msgid \"\""); oPotFile.WriteLine("msgstr \"\""); - oPotFile.WriteLine("\"Project-Id-Version: WinMerge Shell Extension\n\""); - oPotFile.WriteLine("\"Report-Msgid-Bugs-To: https://bugs.winmerge.org/\n\""); - oPotFile.WriteLine("\"POT-Creation-Date: " + GetPotCreationDate() + "\n\""); - oPotFile.WriteLine("\"PO-Revision-Date: \n\""); - oPotFile.WriteLine("\"Last-Translator: \n\""); - oPotFile.WriteLine("\"Language-Team: English \n\""); - oPotFile.WriteLine("\"MIME-Version: 1.0\n\""); - oPotFile.WriteLine("\"Content-Type: text/plain; charset=CP" + sCodePage + "\n\""); - oPotFile.WriteLine("\"Content-Transfer-Encoding: 8bit\n\""); - oPotFile.WriteLine("\"X-Poedit-Language: English\n\""); - oPotFile.WriteLine("\"X-Poedit-SourceCharset: CP" + sCodePage + "\n\""); - oPotFile.WriteLine("\"X-Poedit-Basepath: ../../ShellExtension/Languages/\n\""); - //oPotFile.WriteLine("\"X-Generator: CreateMasterPotFile.js\n\""); + oPotFile.WriteLine("\"Project-Id-Version: WinMerge Shell Extension\\n\""); + oPotFile.WriteLine("\"Report-Msgid-Bugs-To: https://bugs.winmerge.org/\\n\""); + oPotFile.WriteLine("\"POT-Creation-Date: " + GetPotCreationDate() + "\\n\""); + oPotFile.WriteLine("\"PO-Revision-Date: \\n\""); + oPotFile.WriteLine("\"Last-Translator: \\n\""); + oPotFile.WriteLine("\"Language-Team: English \\n\""); + oPotFile.WriteLine("\"MIME-Version: 1.0\\n\""); + oPotFile.WriteLine("\"Content-Type: text/plain; charset=UTF-8\\n\""); + oPotFile.WriteLine("\"Content-Transfer-Encoding: 8bit\\n\""); + oPotFile.WriteLine("\"X-Poedit-Language: English\\n\""); + oPotFile.WriteLine("\"X-Poedit-SourceCharset: UTF-8\\n\""); + oPotFile.WriteLine("\"X-Poedit-Basepath: ../../ShellExtension/Languages/\\n\""); + //oPotFile.WriteLine("\"X-Generator: CreateMasterPotFile.js\\n\""); oPotFile.WriteLine(""); - For (var sKey In oStrings) { //For all strings... + for (var sKey in oStrings) { //For all strings... var oString = oStrings[sKey]; - if (oString.Comment !== "") { //if comment exists... + if (oString.Comment !== "") { //If comment exists... oPotFile.WriteLine("#. " + oString.Comment); } var aReferences = oString.References.split("\t"); @@ -190,7 +188,7 @@ function CreateMasterPotFile(sPotPath, oStrings, sCodePage) { oPotFile.WriteLine("#: " + aReferences[i]); } oPotFile.WriteLine("#, c-format"); - if (oString.Context !== "") { //if context exists... + if (oString.Context !== "") { //If context exists... oPotFile.WriteLine("msgctxt \"" + oString.Context + "\""); } oPotFile.WriteLine("msgid \"" + oString.Id + "\""); @@ -220,10 +218,10 @@ function GetPotCreationDate() { //// // ... function InfoBox(sText, iSecondsToWait) { - if (!bRunFromCmd) { //if run from command line... + if (!bRunFromCmd) { //If run from command line... var oShell = WScript.CreateObject("WScript.Shell"); return oShell.Popup(sText, iSecondsToWait, WScript.ScriptName, 64); - } else { //if NOT run from command line... + } else { //If NOT run from command line... WScript.Echo(sText); } } @@ -231,9 +229,9 @@ function InfoBox(sText, iSecondsToWait) { //// // ... function GetArchiveBit(sFilePath) { - if (oFSO.FileExists(sFilePath)) { //if the file exists... + if (oFSO.FileExists(sFilePath)) { //If the file exists... var oFile = oFSO.GetFile(sFilePath); - if (oFile.Attributes & 32) { //if archive bit set... + if (oFile.Attributes & 32) { //If archive bit set... return true; } } @@ -243,13 +241,13 @@ function GetArchiveBit(sFilePath) { //// // ... function SetArchiveBit(sFilePath, bValue) { - if (oFSO.FileExists(sFilePath)) { //if the file exists... + if (oFSO.FileExists(sFilePath)) { //If the file exists... var oFile = oFSO.GetFile(sFilePath); - if (oFile.Attributes & 32) { //if archive bit set... + if (oFile.Attributes & 32) { //If archive bit set... if (!bValue) { oFile.Attributes -= 32; } - } else { //if archive bit NOT set... + } else { //If archive bit NOT set... if (bValue) { oFile.Attributes += 32; } diff --git a/Translations/ShellExtension/Croatian.po b/Translations/ShellExtension/Croatian.po index 1d60fdcedab..d949acd12f4 100644 --- a/Translations/ShellExtension/Croatian.po +++ b/Translations/ShellExtension/Croatian.po @@ -29,12 +29,6 @@ msgstr "AFX_TARG_HRV" msgid "LANG_ENGLISH, SUBLANG_ENGLISH_US" msgstr "LANG_CROATIAN, SUBLANG_DEFAULT" -#. Codepage -#: ShellExtension.rc:21 -#, c-format -msgid "1252" -msgstr "65001" - #: ShellExtension.rc:111 #, c-format msgid "ShellExtension" diff --git a/Translations/ShellExtension/Czech.po b/Translations/ShellExtension/Czech.po index 2d832188e6c..8e70ca0ebc9 100644 --- a/Translations/ShellExtension/Czech.po +++ b/Translations/ShellExtension/Czech.po @@ -29,12 +29,6 @@ msgstr "AFX_TARG_CSY" msgid "LANG_ENGLISH, SUBLANG_ENGLISH_US" msgstr "LANG_CZECH, SUBLANG_DEFAULT" -#. Codepage -#: ShellExtension.rc:21 -#, c-format -msgid "1252" -msgstr "65001" - #: ShellExtension.rc:111 #, c-format msgid "ShellExtension" diff --git a/Translations/ShellExtension/Danish.po b/Translations/ShellExtension/Danish.po index 41b7e5d0e56..9861021e2bb 100644 --- a/Translations/ShellExtension/Danish.po +++ b/Translations/ShellExtension/Danish.po @@ -29,12 +29,6 @@ msgstr "AFX_TARG_DAN" msgid "LANG_ENGLISH, SUBLANG_ENGLISH_US" msgstr "LANG_DANISH, SUBLANG_DEFAULT" -#. Codepage -#: ShellExtension.rc:21 -#, c-format -msgid "1252" -msgstr "65001" - #: ShellExtension.rc:111 #, c-format msgid "ShellExtension" diff --git a/Translations/ShellExtension/Dutch.po b/Translations/ShellExtension/Dutch.po index 36c66ba004e..fb4825e5bfc 100644 --- a/Translations/ShellExtension/Dutch.po +++ b/Translations/ShellExtension/Dutch.po @@ -32,12 +32,6 @@ msgstr "AFX_TARG_NLB" msgid "LANG_ENGLISH, SUBLANG_ENGLISH_US" msgstr "LANG_DUTCH, SUBLANG_DUTCH" -#. Codepage -#: ShellExtension.rc:21 -#, c-format -msgid "1252" -msgstr "1252" - #: ShellExtension.rc:111 #, c-format msgid "ShellExtension" diff --git a/Translations/ShellExtension/English.pot b/Translations/ShellExtension/English.pot index 0a08583dd6b..503538f3843 100644 --- a/Translations/ShellExtension/English.pot +++ b/Translations/ShellExtension/English.pot @@ -5,15 +5,15 @@ msgid "" msgstr "" "Project-Id-Version: WinMerge Shell Extension\n" "Report-Msgid-Bugs-To: https://bugs.winmerge.org/\n" -"POT-Creation-Date: 2023-02-19 00:07+0000\n" +"POT-Creation-Date: 2024-02-12 16:24+0000\n" "PO-Revision-Date: \n" "Last-Translator: \n" "Language-Team: English \n" "MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=CP1252\n" +"Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Poedit-Language: English\n" -"X-Poedit-SourceCharset: CP1252\n" +"X-Poedit-SourceCharset: UTF-8\n" "X-Poedit-Basepath: ../../ShellExtension/Languages/\n" #. AFX_TARG_* @@ -28,12 +28,6 @@ msgstr "" msgid "LANG_ENGLISH, SUBLANG_ENGLISH_US" msgstr "" -#. Codepage -#: ShellExtension.rc:21 -#, c-format -msgid "1252" -msgstr "" - #: ShellExtension.rc:111 #, c-format msgid "ShellExtension" diff --git a/Translations/ShellExtension/Finnish.po b/Translations/ShellExtension/Finnish.po index ff0620a95b3..2195c98398b 100644 --- a/Translations/ShellExtension/Finnish.po +++ b/Translations/ShellExtension/Finnish.po @@ -29,12 +29,6 @@ msgstr "AFX_TARG_FIN" msgid "LANG_ENGLISH, SUBLANG_ENGLISH_US" msgstr "LANG_FINNISH, SUBLANG_DEFAULT" -#. Codepage -#: ShellExtension.rc:21 -#, c-format -msgid "1252" -msgstr "65001" - #: ShellExtension.rc:111 #, c-format msgid "ShellExtension" diff --git a/Translations/ShellExtension/French.po b/Translations/ShellExtension/French.po index 225ccb2470a..e8bcb21e1ce 100644 --- a/Translations/ShellExtension/French.po +++ b/Translations/ShellExtension/French.po @@ -36,12 +36,6 @@ msgstr "AFX_TARG_FRA" msgid "LANG_ENGLISH, SUBLANG_ENGLISH_US" msgstr "LANG_FRENCH, SUBLANG_FRENCH" -#. Codepage -#: ShellExtension.rc:21 -#, c-format -msgid "1252" -msgstr "65001" - #: ShellExtension.rc:111 #, c-format msgid "ShellExtension" diff --git a/Translations/ShellExtension/Galician.po b/Translations/ShellExtension/Galician.po index 20d17e4ffb7..f101ff626ba 100644 --- a/Translations/ShellExtension/Galician.po +++ b/Translations/ShellExtension/Galician.po @@ -29,12 +29,6 @@ msgstr "AFX_TARG_ESN" msgid "LANG_ENGLISH, SUBLANG_ENGLISH_US" msgstr "LANG_GALICIAN, SUBLANG_DEFAULT" -#. Codepage -#: ShellExtension.rc:21 -#, c-format -msgid "1252" -msgstr "65001" - #: ShellExtension.rc:111 #, c-format msgid "ShellExtension" diff --git a/Translations/ShellExtension/German.po b/Translations/ShellExtension/German.po index 6d4c442774c..0940552ac97 100644 --- a/Translations/ShellExtension/German.po +++ b/Translations/ShellExtension/German.po @@ -32,12 +32,6 @@ msgstr "AFX_TARG_DEU" msgid "LANG_ENGLISH, SUBLANG_ENGLISH_US" msgstr "LANG_GERMAN, SUBLANG_GERMAN" -#. Codepage -#: ShellExtension.rc:21 -#, c-format -msgid "1252" -msgstr "65001" - #: ShellExtension.rc:111 #, c-format msgid "ShellExtension" diff --git a/Translations/ShellExtension/Greek.po b/Translations/ShellExtension/Greek.po index 48ac7b7f360..a7ed34551c3 100644 --- a/Translations/ShellExtension/Greek.po +++ b/Translations/ShellExtension/Greek.po @@ -29,12 +29,6 @@ msgstr "AFX_TARG_ELL" msgid "LANG_ENGLISH, SUBLANG_ENGLISH_US" msgstr "LANG_GREEK, SUBLANG_DEFAULT" -#. Codepage -#: ShellExtension.rc:21 -#, c-format -msgid "1252" -msgstr "65001" - #: ShellExtension.rc:111 #, c-format msgid "ShellExtension" diff --git a/Translations/ShellExtension/Hungarian.po b/Translations/ShellExtension/Hungarian.po index a1b6bb69e96..116e3060dd9 100644 --- a/Translations/ShellExtension/Hungarian.po +++ b/Translations/ShellExtension/Hungarian.po @@ -29,12 +29,6 @@ msgstr "AFX_TARG_HUN" msgid "LANG_ENGLISH, SUBLANG_ENGLISH_US" msgstr "LANG_HUNGARIAN, SUBLANG_DEFAULT" -#. Codepage -#: ShellExtension.rc:21 -#, c-format -msgid "1252" -msgstr "65001" - #: ShellExtension.rc:111 #, c-format msgid "ShellExtension" diff --git a/Translations/ShellExtension/Italian.po b/Translations/ShellExtension/Italian.po index 98ec1bbea60..245601d4c40 100644 --- a/Translations/ShellExtension/Italian.po +++ b/Translations/ShellExtension/Italian.po @@ -29,12 +29,6 @@ msgstr "AFX_TARG_ITA" msgid "LANG_ENGLISH, SUBLANG_ENGLISH_US" msgstr "LANG_ITALIAN, SUBLANG_ITALIAN" -#. Codepage -#: ShellExtension.rc:21 -#, c-format -msgid "1252" -msgstr "65001" - #: ShellExtension.rc:111 #, c-format msgid "ShellExtension" diff --git a/Translations/ShellExtension/Japanese.po b/Translations/ShellExtension/Japanese.po index 70b0ac21b7a..ab7f7eba0e1 100644 --- a/Translations/ShellExtension/Japanese.po +++ b/Translations/ShellExtension/Japanese.po @@ -29,12 +29,6 @@ msgstr "AFX_TARG_JPN" msgid "LANG_ENGLISH, SUBLANG_ENGLISH_US" msgstr "LANG_JAPANESE, SUBLANG_DEFAULT" -#. Codepage -#: ShellExtension.rc:21 -#, c-format -msgid "1252" -msgstr "65001" - #: ShellExtension.rc:111 #, c-format msgid "ShellExtension" diff --git a/Translations/ShellExtension/Korean.po b/Translations/ShellExtension/Korean.po index ad968df49fd..1c8c9f8fcf6 100644 --- a/Translations/ShellExtension/Korean.po +++ b/Translations/ShellExtension/Korean.po @@ -30,12 +30,6 @@ msgstr "AFX_TARG_KOR" msgid "LANG_ENGLISH, SUBLANG_ENGLISH_US" msgstr "LANG_KOREAN, SUBLANG_DEFAULT" -#. Codepage -#: ShellExtension.rc:21 -#, c-format -msgid "1252" -msgstr "65001" - #: ShellExtension.rc:111 #, c-format msgid "ShellExtension" diff --git a/Translations/ShellExtension/Lithuanian.po b/Translations/ShellExtension/Lithuanian.po index 779c8ff49e2..85033c90dee 100644 --- a/Translations/ShellExtension/Lithuanian.po +++ b/Translations/ShellExtension/Lithuanian.po @@ -32,12 +32,6 @@ msgstr "AFX_TARG_LIT" msgid "LANG_ENGLISH, SUBLANG_ENGLISH_US" msgstr "LANG_LITHUANIAN, SUBLANG_DEFAULT" -#. Codepage -#: ShellExtension.rc:21 -#, c-format -msgid "1252" -msgstr "65001" - #: ShellExtension.rc:111 #, c-format msgid "ShellExtension" diff --git a/Translations/ShellExtension/Norwegian.po b/Translations/ShellExtension/Norwegian.po index 8a6f5e32e0c..cd1623e32e6 100644 --- a/Translations/ShellExtension/Norwegian.po +++ b/Translations/ShellExtension/Norwegian.po @@ -29,12 +29,6 @@ msgstr "AFX_TARG_NOR" msgid "LANG_ENGLISH, SUBLANG_ENGLISH_US" msgstr "LANG_NORWEGIAN, SUBLANG_DEFAULT" -#. Codepage -#: ShellExtension.rc:21 -#, c-format -msgid "1252" -msgstr "65001" - #: ShellExtension.rc:111 #, c-format msgid "ShellExtension" diff --git a/Translations/ShellExtension/Persian.po b/Translations/ShellExtension/Persian.po index 95c36a3bd3e..02d6a751a12 100644 --- a/Translations/ShellExtension/Persian.po +++ b/Translations/ShellExtension/Persian.po @@ -32,12 +32,6 @@ msgstr "AFX_TARG_FAR" msgid "LANG_ENGLISH, SUBLANG_ENGLISH_US" msgstr "LANG_FARSI, SUBLANG_NEUTRAL" -#. Codepage -#: ShellExtension.rc:21 -#, c-format -msgid "1252" -msgstr "65001" - #: ShellExtension.rc:111 #, c-format msgid "ShellExtension" diff --git a/Translations/ShellExtension/Polish.po b/Translations/ShellExtension/Polish.po index 0755da65d03..0253bcf7376 100644 --- a/Translations/ShellExtension/Polish.po +++ b/Translations/ShellExtension/Polish.po @@ -31,12 +31,6 @@ msgstr "AFX_TARG_PLK" msgid "LANG_ENGLISH, SUBLANG_ENGLISH_US" msgstr "LANG_POLISH, SUBLANG_DEFAULT" -#. Codepage -#: ShellExtension.rc:21 -#, c-format -msgid "1252" -msgstr "65001" - #: ShellExtension.rc:111 #, c-format msgid "ShellExtension" diff --git a/Translations/ShellExtension/Portuguese.po b/Translations/ShellExtension/Portuguese.po index 070f0444131..9d42426ec95 100644 --- a/Translations/ShellExtension/Portuguese.po +++ b/Translations/ShellExtension/Portuguese.po @@ -33,12 +33,6 @@ msgstr "AFX_TARG_PTG" msgid "LANG_ENGLISH, SUBLANG_ENGLISH_US" msgstr "LANG_PORTUGUESE, SUBLANG_PORTUGUESE" -#. Codepage -#: ShellExtension.rc:21 -#, c-format -msgid "1252" -msgstr "65001" - #: ShellExtension.rc:111 #, c-format msgid "ShellExtension" diff --git a/Translations/ShellExtension/Romanian.po b/Translations/ShellExtension/Romanian.po index 067efe93e05..8188ed4521e 100644 --- a/Translations/ShellExtension/Romanian.po +++ b/Translations/ShellExtension/Romanian.po @@ -32,12 +32,6 @@ msgstr "AFX_TARG_ROM" msgid "LANG_ENGLISH, SUBLANG_ENGLISH_US" msgstr "LANG_ROMANIAN, SUBLANG_DEFAULT" -#. Codepage -#: ShellExtension.rc:21 -#, c-format -msgid "1252" -msgstr "65001" - #: ShellExtension.rc:111 #, c-format msgid "ShellExtension" diff --git a/Translations/ShellExtension/Russian.po b/Translations/ShellExtension/Russian.po index a3afb15c5c4..85a4383120f 100644 --- a/Translations/ShellExtension/Russian.po +++ b/Translations/ShellExtension/Russian.po @@ -30,12 +30,6 @@ msgstr "AFX_TARG_RUS" msgid "LANG_ENGLISH, SUBLANG_ENGLISH_US" msgstr "LANG_RUSSIAN, SUBLANG_DEFAULT" -#. Codepage -#: ShellExtension.rc:21 -#, c-format -msgid "1252" -msgstr "1252" - #: ShellExtension.rc:111 #, c-format msgid "ShellExtension" diff --git a/Translations/ShellExtension/Serbian.po b/Translations/ShellExtension/Serbian.po index da7ea8a179c..deb3d4017e4 100644 --- a/Translations/ShellExtension/Serbian.po +++ b/Translations/ShellExtension/Serbian.po @@ -29,12 +29,6 @@ msgstr "AFX_TARG_SER" msgid "LANG_ENGLISH, SUBLANG_ENGLISH_US" msgstr "LANG_SERBIAN, SUBLANG_SERBIAN_CYRILLIC" -#. Codepage -#: ShellExtension.rc:21 -#, c-format -msgid "1252" -msgstr "65001" - #: ShellExtension.rc:111 #, c-format msgid "ShellExtension" diff --git a/Translations/ShellExtension/Sinhala.po b/Translations/ShellExtension/Sinhala.po index 50f8d3bedda..125fc1cefb3 100644 --- a/Translations/ShellExtension/Sinhala.po +++ b/Translations/ShellExtension/Sinhala.po @@ -29,12 +29,6 @@ msgstr "AFX_TARG_LKA" msgid "LANG_ENGLISH, SUBLANG_ENGLISH_US" msgstr "LANG_SINHALESE, SUBLANG_DEFAULT" -#. Codepage -#: ShellExtension.rc:21 -#, c-format -msgid "1252" -msgstr "65001" - #: ShellExtension.rc:111 #, c-format msgid "ShellExtension" diff --git a/Translations/ShellExtension/Slovak.po b/Translations/ShellExtension/Slovak.po index 1e0e00f7027..c18f2f205d0 100644 --- a/Translations/ShellExtension/Slovak.po +++ b/Translations/ShellExtension/Slovak.po @@ -29,12 +29,6 @@ msgstr "AFX_TARG_SKY" msgid "LANG_ENGLISH, SUBLANG_ENGLISH_US" msgstr "LANG_SLOVAK, SUBLANG_DEFAULT" -#. Codepage -#: ShellExtension.rc:21 -#, c-format -msgid "1252" -msgstr "65001" - #: ShellExtension.rc:111 #, c-format msgid "ShellExtension" diff --git a/Translations/ShellExtension/Slovenian.po b/Translations/ShellExtension/Slovenian.po index bb1c3d9f66a..e37d6e3a26e 100644 --- a/Translations/ShellExtension/Slovenian.po +++ b/Translations/ShellExtension/Slovenian.po @@ -33,12 +33,6 @@ msgstr "AFX_TARG_SLV" msgid "LANG_ENGLISH, SUBLANG_ENGLISH_US" msgstr "LANG_SLOVENIAN, SUBLANG_DEFAULT" -#. Codepage -#: ShellExtension.rc:21 -#, c-format -msgid "1252" -msgstr "65001" - #: ShellExtension.rc:111 #, c-format msgid "ShellExtension" diff --git a/Translations/ShellExtension/Spanish.po b/Translations/ShellExtension/Spanish.po index fb0ffe7e85d..bfa53353cdf 100644 --- a/Translations/ShellExtension/Spanish.po +++ b/Translations/ShellExtension/Spanish.po @@ -29,12 +29,6 @@ msgstr "AFX_TARG_ESN" msgid "LANG_ENGLISH, SUBLANG_ENGLISH_US" msgstr "LANG_SPANISH, SUBLANG_SPANISH_MODERN" -#. Codepage -#: ShellExtension.rc:21 -#, c-format -msgid "1252" -msgstr "65001" - #: ShellExtension.rc:111 #, c-format msgid "ShellExtension" diff --git a/Translations/ShellExtension/Swedish.po b/Translations/ShellExtension/Swedish.po index 9ce761b5f0f..7cff5ce9c50 100644 --- a/Translations/ShellExtension/Swedish.po +++ b/Translations/ShellExtension/Swedish.po @@ -29,12 +29,6 @@ msgstr "AFX_TARG_SVE" msgid "LANG_ENGLISH, SUBLANG_ENGLISH_US" msgstr "LANG_SWEDISH, SUBLANG_DEFAULT" -#. Codepage -#: ShellExtension.rc:21 -#, c-format -msgid "1252" -msgstr "65001" - #: ShellExtension.rc:111 #, c-format msgid "ShellExtension" diff --git a/Translations/ShellExtension/Tamil.po b/Translations/ShellExtension/Tamil.po index 5c25bf38b92..3e2609ff18a 100644 --- a/Translations/ShellExtension/Tamil.po +++ b/Translations/ShellExtension/Tamil.po @@ -35,12 +35,6 @@ msgstr "AFX_TARG_TAM" msgid "LANG_ENGLISH, SUBLANG_ENGLISH_US" msgstr "LANG_TAMIL, SUBLANG_TAMIL" -#. Codepage -#: ShellExtension.rc:21 -#, c-format -msgid "1252" -msgstr "65001" - #: ShellExtension.rc:111 #, c-format msgid "ShellExtension" diff --git a/Translations/ShellExtension/Turkish.po b/Translations/ShellExtension/Turkish.po index 91a8bc6de46..03bdae0ea02 100644 --- a/Translations/ShellExtension/Turkish.po +++ b/Translations/ShellExtension/Turkish.po @@ -32,12 +32,6 @@ msgstr "AFX_TARG_TRK" msgid "LANG_ENGLISH, SUBLANG_ENGLISH_US" msgstr "LANG_TURKISH, SUBLANG_DEFAULT" -#. Codepage -#: ShellExtension.rc:21 -#, c-format -msgid "1252" -msgstr "65001" - #: ShellExtension.rc:111 #, c-format msgid "ShellExtension" diff --git a/Translations/ShellExtension/Ukrainian.po b/Translations/ShellExtension/Ukrainian.po index dedb59c3f29..5d4c527be08 100644 --- a/Translations/ShellExtension/Ukrainian.po +++ b/Translations/ShellExtension/Ukrainian.po @@ -29,12 +29,6 @@ msgstr "AFX_TARG_UKR" msgid "LANG_ENGLISH, SUBLANG_ENGLISH_US" msgstr "LANG_UKRAINIAN, SUBLANG_DEFAULT" -#. Codepage -#: ShellExtension.rc:21 -#, c-format -msgid "1252" -msgstr "65001" - #: ShellExtension.rc:111 #, c-format msgid "ShellExtension" From afccc2fa228b8c90fef25ebde6d9fbc9660177b3 Mon Sep 17 00:00:00 2001 From: Takashi Sawanaka Date: Mon, 12 Feb 2024 21:48:24 +0900 Subject: [PATCH 41/58] WIP --- Tools/Scripts/CheckMenuResources.js | 354 +++++++-------- Tools/Scripts/CheckUnusedResources.js | 407 ++++++++---------- .../ShellExtension/CreateMasterPotFile.js | 2 +- Translations/WinMerge/CreateMasterPotFile.js | 2 +- 4 files changed, 341 insertions(+), 424 deletions(-) diff --git a/Tools/Scripts/CheckMenuResources.js b/Tools/Scripts/CheckMenuResources.js index cae3fe64f1f..6f8b5e23c3b 100644 --- a/Tools/Scripts/CheckMenuResources.js +++ b/Tools/Scripts/CheckMenuResources.js @@ -1,211 +1,167 @@ -Option Explicit -'' -' This script checks the menu resources. -' -' Copyright (C) 2008 by Tim Gerundt -' Released under the "GNU General Public License" +//// +// This script checks the menu resources. +// +// Copyright (C) 2008 by Tim Gerundt +// Released under the "GNU General Public License" -Const ForReading = 1 +var ForReading = 1; -Const NO_BLOCK = 0 -Const MENU_BLOCK = 1 -Const DIALOGEX_BLOCK = 2 -Const STRINGTABLE_BLOCK = 3 -Const VERSIONINFO_BLOCK = 4 -Const ACCELERATORS_BLOCK = 5 +var NO_BLOCK = 0; +var MENU_BLOCK = 1; +var DIALOGEX_BLOCK = 2; +var STRINGTABLE_BLOCK = 3; +var VERSIONINFO_BLOCK = 4; +var ACCELERATORS_BLOCK = 5; -Dim oFSO, bRunFromCmd -Set oFSO = CreateObject("Scripting.FileSystemObject") +var oFSO = new ActiveXObject("Scripting.FileSystemObject"); -bRunFromCmd = False -If LCase(oFSO.GetFileName(Wscript.FullName)) = "cscript.exe" Then - bRunFromCmd = True -End If +var bRunFromCmd = false; +if (oFSO.GetFileName(WScript.FullName).toLowerCase() === "cscript.exe") { + bRunFromCmd = true; +} -Call Main +Main(); -'' -' ... -Sub Main - Dim oMenuItems, oMenuItem, oIds, sKey, oTxtFile - Dim StartTime, EndTime, Seconds - - StartTime = Time - - InfoBox "Checking menu resources....", 3 - - Set oMenuItems = GetMenuItemsFromRcFile("..\..\Src\Merge.rc") - Set oIds = GetIdsFromRcFile("..\..\Src\Merge.rc") - - Set oTxtFile = oFSO.CreateTextFile("MenuResources.txt", True) - - oTxtFile.WriteLine "----------------------------------------" - oTxtFile.WriteLine "NO MNEMONIC CHAR" - oTxtFile.WriteLine "----------------------------------------" - For Each sKey In oMenuItems.Keys 'For all menu items... - Set oMenuItem = oMenuItems(sKey) - If (InStr(oMenuItem.Str, "&") = 0) Then 'If WITHOUT mnemonic... - oTxtFile.WriteLine oMenuItem.Str + " (" + oMenuItem.Menu + " -> " + oMenuItem.Id + ")" - End If - Next - - oTxtFile.WriteLine "" - oTxtFile.WriteLine "----------------------------------------" - oTxtFile.WriteLine "NO DESCRIPTION TEXT" - oTxtFile.WriteLine "----------------------------------------" - For Each sKey In oMenuItems.Keys 'For all menu items... - Set oMenuItem = oMenuItems(sKey) - If (oMenuItem.Id <> "") Then 'If NOT empty... - If (oIds.Exists(oMenuItem.Id) = False) Then 'If WITHOUT description... - oTxtFile.WriteLine oMenuItem.Str + " (" + oMenuItem.Menu + " -> " + oMenuItem.Id + ")" - End If - End If - Next - - oTxtFile.Close - - EndTime = Time - Seconds = DateDiff("s", StartTime, EndTime) - - InfoBox "File ""MenuResources.txt"" created, after " & Seconds & " second(s).", 10 -End Sub +//// +// ... +function Main() { + var StartTime = new Date().getTime(); + + InfoBox("Checking menu resources....", 3); + + var oMenuItems = GetMenuItemsFromRcFile("..\\..\\Src\\Merge.rc"); + var oIds = GetIdsFromRcFile("..\\..\\Src\\Merge.rc"); + + var oTxtFile = oFSO.CreateTextFile("MenuResources.txt", true); + + oTxtFile.WriteLine("----------------------------------------"); + oTxtFile.WriteLine("NO MNEMONIC CHAR"); + oTxtFile.WriteLine("----------------------------------------"); + for (var sKey in oMenuItems) { //For all menu items... + var oMenuItem = oMenuItems[sKey]; + if (oMenuItem.Str.indexOf("&") === -1) { //If WITHOUT mnemonic... + oTxtFile.WriteLine(oMenuItem.Str + " (" + oMenuItem.Menu + " -> " + oMenuItem.Id + ")"); + } + } + + oTxtFile.WriteLine(""); + oTxtFile.WriteLine("----------------------------------------"); + oTxtFile.WriteLine("NO DESCRIPTION TEXT"); + oTxtFile.WriteLine("----------------------------------------"); + for (var sKey in oMenuItems) { //For all menu items... + var oMenuItem = oMenuItems[sKey]; + if (oMenuItem.Id !== "") { //If NOT empty... + if (!(oMenuItem.Id in oIds)) { //If WITHOUT description... + oTxtFile.WriteLine(oMenuItem.Str + " (" + oMenuItem.Menu + " -> " + oMenuItem.Id + ")"); + } + } + } + + oTxtFile.Close(); + + var EndTime = new Date().getTime(); + var Seconds = (EndTime - StartTime) / 1000.0; + + InfoBox("File \"MenuResources.txt\" created, after " + Seconds + " second(s).", 10); +} -'' -' ... -Class CMenuItem - Dim Menu, Str, Id -End Class - -'' -' ... -Function GetMenuItemsFromRcFile(ByVal sRcFilePath) - Dim oMenuItems, oMenuItem, oRcFile, sLine, iCount - Dim iBlockType, sMenu, sString, sId, oMatch - - Set oMenuItems = CreateObject("Scripting.Dictionary") - - If (oFSO.FileExists(sRcFilePath) = True) Then 'If the RC file exists... - iCount = 0 - iBlockType = NO_BLOCK - sMenu = "" - Set oRcFile = oFSO.OpenTextFile(sRcFilePath, ForReading) - Do Until oRcFile.AtEndOfStream = True 'For all lines... - sLine = Trim(oRcFile.ReadLine) - - sString = "" - sId = "" - - If (FoundRegExpMatch(sLine, "(IDR_\w+) MENU", oMatch) = True) Then 'MENU... - iBlockType = MENU_BLOCK - sMenu = oMatch.SubMatches(0) - ElseIf (InStr(sLine, " DIALOGEX") > 0) Then 'DIALOGEX... - iBlockType = DIALOGEX_BLOCK - ElseIf (sLine = "STRINGTABLE") Then 'STRINGTABLE... - iBlockType = STRINGTABLE_BLOCK - ElseIf (InStr(sLine, " VERSIONINFO") > 0) Then 'VERSIONINFO... - iBlockType = VERSIONINFO_BLOCK - ElseIf (InStr(sLine, " ACCELERATORS") > 0) Then 'ACCELERATORS... - iBlockType = ACCELERATORS_BLOCK - ElseIf (sLine = "BEGIN") Then 'BEGIN... - 'IGNORE FOR SPEEDUP! - ElseIf (sLine = "END") Then 'END... - If (iBlockType = STRINGTABLE_BLOCK) Then 'If inside stringtable... - iBlockType = NO_BLOCK - End If - ElseIf (Left(sLine, 2) = "//") Then 'If comment line... - sLine = "" - 'IGNORE FOR SPEEDUP! - ElseIf (sLine <> "") Then 'If NOT empty line... - If (iBlockType = MENU_BLOCK) Then - If (InStr(sLine, """") > 0) Then 'If quote found (for speedup)... - If (FoundRegExpMatch(sLine, """(.*)""", oMatch) = True) And (InStr(sLine, "_POPUP_") = 0) Then 'If "string"... - sString = oMatch.SubMatches(0) - If (sString <> "") Then 'If NOT empty... - If (FoundRegExpMatch(sLine, "(ID_\w+)", oMatch) = True) Then 'If ID... - sId = oMatch.SubMatches(0) - End If - iCount = iCount + 1 - End If - End If - End If - End If - End If +//// +// ... +function GetMenuItemsFromRcFile(sRcFilePath) { + var oMenuItems = {}; + if (oFSO.FileExists(sRcFilePath)) { //If the RC file exists... + var iCount = 0; + var iBlockType = NO_BLOCK; + var sMenu = ""; + var oRcFile = oFSO.OpenTextFile(sRcFilePath, ForReading); + while (!oRcFile.AtEndOfStream) { //For all lines... + var sLine = oRcFile.ReadLine().replace(/^\s+|\s+$/g, ""); + var sString = ""; + var sId = ""; + var oMatch = /(IDR_\w+) MENU/.exec(sLine); + if (oMatch) { //MENU... + iBlockType = MENU_BLOCK; + sMenu = oMatch[1]; + } else if (sLine.indexOf(" DIALOGEX") >= 0) { //DIALOGEX... + iBlockType = DIALOGEX_BLOCK; + } else if (sLine === "STRINGTABLE") { //STRINGTABLE... + iBlockType = STRINGTABLE_BLOCK; + } else if (sLine.indexOf(" VERSIONINFO") >= 0) { //VERSIONINFO... + iBlockType = VERSIONINFO_BLOCK; + } else if (sLine.indexOf(" ACCELERATORS") >= 0) { //ACCELERATORS... + iBlockType = ACCELERATORS_BLOCK; + } else if (sLine === "BEGIN") { //BEGIN... + //IGNORE FOR SPEEDUP! + } else if (sLine === "END") { //END... + if (iBlockType === STRINGTABLE_BLOCK) { //If inside stringtable... + iBlockType = NO_BLOCK; + } + } else if (sLine.substring(0, 2) === "//") { //If comment line... + sLine = ""; + //IGNORE FOR SPEEDUP! + } else if (sLine !== "") { //If NOT empty line... + if (iBlockType === MENU_BLOCK) { + if (sLine.indexOf("\"") >= 0) { //If quote found (for speedup)... + var oMatch = /"(.*)"/.exec(sLine); + if (oMatch && sLine.indexOf("_POPUP_") === -1) { //If "string"... + sString = oMatch[1]; + oMatch = /(ID_\w+)/.exec(sLine); + if (sString !== "") { //If NOT empty... + if (oMatch) { //If ID... + sId = oMatch[1]; + } + iCount++; + } + } + } + } + } - If (sString <> "") Then - Set oMenuItem = New CMenuItem - oMenuItem.Menu = sMenu - oMenuItem.Str = sString - oMenuItem.Id = sId - oMenuItems.Add iCount, oMenuItem - End If - Loop - oRcFile.Close - End If - Set GetMenuItemsFromRcFile = oMenuItems -End Function + if (sString !== "") { + var oMenuItem = { "Menu": "", "Str": "", "Id": "" }; + oMenuItem.Menu = sMenu; + oMenuItem.Str = sString; + oMenuItem.Id = sId; + oMenuItems[iCount] = oMenuItem; + } + } + oRcFile.Close(); + } + return oMenuItems; +} -'' -' ... -Function GetIdsFromRcFile(ByVal sRcPath) - Dim oIds, oTextFile, sLine - Dim reId, oMatch, sId, sString - - Set oIds = CreateObject("Scripting.Dictionary") - - Set reId = New RegExp - reId.Pattern = "(ID_\w+)\s+""(.*)""" - reId.IgnoreCase = False - - If (oFSO.FileExists(sRcPath) = True) Then 'If the RC file exists... - Set oTextFile = oFSO.OpenTextFile(sRcPath, ForReading) - Do Until oTextFile.AtEndOfStream = True 'For all lines... - sLine = Trim(oTextFile.ReadLine) - - sId = "" - sString = "" - If reId.Test(sLine) Then 'If ID... - Set oMatch = reId.Execute(sLine)(0) - sId = oMatch.SubMatches(0) - sString = oMatch.SubMatches(1) - - If (oIds.Exists(sId) = False) Then 'If the key is NOT already used... - oIds.Add sId, sString - End If - End If - Loop - oTextFile.Close - End If - Set GetIdsFromRcFile = oIds -End Function +//// +// ... +function GetIdsFromRcFile(sRcPath) { + var oIds = {}; + var reId = /(ID_\w+)\s+\"(.*)\"/; + if (oFSO.FileExists(sRcPath)) { //If the RC file exists... + var oTextFile = oFSO.OpenTextFile(sRcPath, ForReading); + while (!oTextFile.AtEndOfStream) { //For all lines... + var sLine = oTextFile.ReadLine().replace(/^\s+|\s+$/g, ""); + var oMatch = reId.exec(sLine); //If ID... + if (oMatch) { + var sId = oMatch[1]; + var sString = oMatch[2]; + if (!(sId in oIds)) { //If the key is NOT already used... + oIds[sId] = sString; + } + } + } + oTextFile.Close(); + } + return oIds; +} -'' -' ... -Function FoundRegExpMatch(ByVal sString, ByVal sPattern, ByRef oMatchReturn) - Dim oRegExp, oMatches - - Set oRegExp = New RegExp - oRegExp.Pattern = sPattern - oRegExp.IgnoreCase = True - - oMatchReturn = Null - FoundRegExpMatch = False - If (oRegExp.Test(sString) = True) Then - Set oMatches = oRegExp.Execute(sString) - Set oMatchReturn = oMatches(0) - FoundRegExpMatch = True - End If -End Function +//// +// ... +function InfoBox(sText, iSecondsToWait) { + if (!bRunFromCmd) { //If run from command line... + var oShell = WScript.CreateObject("WScript.Shell"); + return oShell.Popup(sText, iSecondsToWait, WScript.ScriptName, 64); + } else { //If NOT run from command line... + WScript.Echo(sText); + } +} -'' -' ... -Function InfoBox(ByVal sText, ByVal iSecondsToWait) - Dim oShell - - If (bRunFromCmd = False) Then 'If run from command line... - Set oShell = Wscript.CreateObject("WScript.Shell") - InfoBox = oShell.Popup(sText, iSecondsToWait, Wscript.ScriptName, 64) - Else 'If NOT run from command line... - Wscript.Echo sText - End If -End Function diff --git a/Tools/Scripts/CheckUnusedResources.js b/Tools/Scripts/CheckUnusedResources.js index 048257d7f74..5c519a03def 100644 --- a/Tools/Scripts/CheckUnusedResources.js +++ b/Tools/Scripts/CheckUnusedResources.js @@ -1,236 +1,197 @@ -Option Explicit -'' -' This script creates a list of (hopefully) unused resource IDs. -' -' Copyright (C) 2008 by Tim Gerundt -' Released under the "GNU General Public License" +//// +// This script creates a list of (hopefully) unused resource IDs. +// +// Copyright (C) 2008 by Tim Gerundt +// Released under the "GNU General Public License" -Const ForReading = 1 +var ForReading = 1; -Const NO_BLOCK = 0 -Const MENU_BLOCK = 1 -Const DIALOGEX_BLOCK = 2 -Const STRINGTABLE_BLOCK = 3 -Const VERSIONINFO_BLOCK = 4 -Const ACCELERATORS_BLOCK = 5 +var NO_BLOCK = 0; +var MENU_BLOCK = 1; +var DIALOGEX_BLOCK = 2; +var STRINGTABLE_BLOCK = 3; +var VERSIONINFO_BLOCK = 4; +var ACCELERATORS_BLOCK = 5; -Dim oFSO, bRunFromCmd -Set oFSO = CreateObject("Scripting.FileSystemObject") +var oFSO = new ActiveXObject("Scripting.FileSystemObject"); -bRunFromCmd = False -If LCase(oFSO.GetFileName(Wscript.FullName)) = "cscript.exe" Then - bRunFromCmd = True -End If +var bRunFromCmd = false; +if (oFSO.GetFileName(WScript.FullName).toLowerCase() === "cscript.exe") { + bRunFromCmd = true; +} -Call Main +Main(); -'' -' ... -Sub Main - Dim oHIds, oRcIds, oRc2Ids, oCppIds, sKey, oTxtFile - Dim StartTime, EndTime, Seconds - - StartTime = Time - - InfoBox "Creating list of unused resource IDs...", 3 - - Set oHIds = GetIdsFromHeaderFile("..\..\Src\resource.h") - Set oRcIds = GetIdsFromResourceFile("..\..\Src\Merge.rc") - Set oRc2Ids = GetIdsFromResourceFile("..\..\Src\Merge2.rc") - - Set oCppIds = CreateObject("Scripting.Dictionary") - GetIdsFromCppFiles "..\..\Src\", oCppIds - GetIdsFromCppFiles "..\..\Externals\crystaledit\editlib\", oCppIds - - Set oTxtFile = oFSO.CreateTextFile("UnusedResources.txt", True) - - oTxtFile.WriteLine "----------------------------------------" - oTxtFile.WriteLine "ONLY IN RESOURCE.H FILE" - oTxtFile.WriteLine "----------------------------------------" - For Each sKey In oHIds.Keys 'For all header IDs... - If (oRcIds.Exists(sKey) = False) And (oRc2Ids.Exists(sKey) = False) And (oCppIds.Exists(sKey) = False) Then 'If header ID is NOT used... - oTxtFile.WriteLine sKey - End If - Next - - oTxtFile.WriteLine "" - oTxtFile.WriteLine "----------------------------------------" - oTxtFile.WriteLine "NOT USED IN *.CPP/*.H FILES" - oTxtFile.WriteLine "----------------------------------------" - For Each sKey In oRcIds.Keys 'For all RC IDs... - If (oCppIds.Exists(sKey) = False) Then 'If RC ID is NOT used... - oTxtFile.WriteLine sKey - End If - Next - For Each sKey In oRc2Ids.Keys 'For all RC2 IDs... - If (oCppIds.Exists(sKey) = False) Then 'If RC2 ID is NOT used... - oTxtFile.WriteLine sKey - End If - Next - - oTxtFile.Close - - EndTime = Time - Seconds = DateDiff("s", StartTime, EndTime) - - InfoBox "File ""UnusedResources.txt"" created, after " & Seconds & " second(s).", 10 -End Sub +//// +// ... +function Main() { + var StartTime = new Date().getTime(); + + InfoBox("Creating list of unused resource IDs...", 3); + + var oHIds = GetIdsFromHeaderFile("..\\..\\Src\\resource.h"); + var oRcIds = GetIdsFromResourceFile("..\\..\\Src\\Merge.rc"); + var oRc2Ids = GetIdsFromResourceFile("..\\..\\Src\\Merge2.rc"); + + var oCppIds = {}; + oCppIds = GetIdsFromCppFiles("..\\..\\Src\\", oCppIds); + oCppIds = GetIdsFromCppFiles("..\\..\\Externals\\crystaledit\\editlib\\", oCppIds); + + var oTxtFile = oFSO.CreateTextFile("UnusedResources.txt", true); + + oTxtFile.WriteLine("----------------------------------------"); + oTxtFile.WriteLine("ONLY IN RESOURCE.H FILE"); + oTxtFile.WriteLine("----------------------------------------"); + for (var sKey in oHIds) { //For all header IDs... + if (!(sKey in oRcIds) && !(sKey in oRc2Ids) && !(sKey in oCppIds)) { //If header ID is NOT used... + oTxtFile.WriteLine(sKey); + } + } + + oTxtFile.WriteLine(""); + oTxtFile.WriteLine("----------------------------------------"); + oTxtFile.WriteLine("NOT USED IN *.CPP/*.H FILES"); + oTxtFile.WriteLine("----------------------------------------"); + for (var sKey in oRcIds) { //For all RC IDs... + if (!(sKey in oCppIds)) { //If RC ID is NOT used... + oTxtFile.WriteLine(sKey); + } + } + for (var sKey in oRc2Ids) { //For all RC2 IDs... + if (!(sKey in oCppIds)) { //If RC2 ID is NOT used... + oTxtFile.WriteLine(sKey); + } + } + + oTxtFile.Close(); + + var EndTime = new Date().getTime(); + var Seconds = (EndTime - StartTime) / 1000.0; + + InfoBox("File \"UnusedResources.txt\" created, after " + Seconds + " second(s).", 10); +} -'' -' ... -Function GetIdsFromHeaderFile(ByVal sHPath) - Dim oIds, oTextFile, sLine - Dim reDefineId, oMatch, sId, sResource - - Set oIds = CreateObject("Scripting.Dictionary") - - Set reDefineId = New RegExp - reDefineId.Pattern = "^#define (ID\w+)\s+(\d+)$" - reDefineId.IgnoreCase = False - - If (oFSO.FileExists(sHPath) = True) Then 'If the Header file exists... - Set oTextFile = oFSO.OpenTextFile(sHPath, ForReading) - Do Until oTextFile.AtEndOfStream = True 'For all lines... - sLine = Trim(oTextFile.ReadLine) - - sId = "" - sResource = "" - If reDefineId.Test(sLine) Then 'If ID... - Set oMatch = reDefineId.Execute(sLine)(0) - sId = oMatch.SubMatches(0) - sResource = oMatch.SubMatches(1) - - oIds.Add sId, sResource - End If - Loop - oTextFile.Close - End If - Set GetIdsFromHeaderFile = oIds -End Function +//// +// ... +function GetIdsFromHeaderFile(sHPath) { + var oIds = {}; + var reDefineId = /^#define (ID\w+)\s+(\d+)$/; + if (oFSO.FileExists(sHPath)) { //If the Header file exists... + var oTextFile = oFSO.OpenTextFile(sHPath, ForReading); + while (!oTextFile.AtEndOfStream) { //For all lines... + var sLine = oTextFile.ReadLine().replace(/^\s+|\s+$/g, ""); + var oMatch = reDefineId.exec(sLine); //If ID... + if (oMatch) { + var sId = oMatch[1]; + var sResource = oMatch[2]; + oIds[sId] = sResource; + } + } + oTextFile.Close(); + } + return oIds; +} -'' -' ... -Function GetIdsFromResourceFile(ByVal sRcPath) - Dim oIds, oTextFile, sLine, iLine, iBlockType - Dim reId, oMatch, sId - - Set oIds = CreateObject("Scripting.Dictionary") - - Set reId = New RegExp - reId.Pattern = "(AFX_ID[A-Z]?_\w+|ID[A-Z]?_\w+)" - reId.IgnoreCase = False - - If (oFSO.FileExists(sRcPath) = True) Then 'If the RC file exists... - iLine = 0 - iBlockType = NO_BLOCK - Set oTextFile = oFSO.OpenTextFile(sRcPath, ForReading) - Do Until oTextFile.AtEndOfStream = True 'For all lines... - sLine = Trim(oTextFile.ReadLine) - iLine = iLine + 1 - - If (InStr(sLine, " MENU") > 0) Then 'MENU... - iBlockType = MENU_BLOCK - ElseIf (InStr(sLine, " DIALOGEX") > 0) Then 'DIALOGEX... - iBlockType = DIALOGEX_BLOCK - ElseIf (sLine = "STRINGTABLE") Then 'STRINGTABLE... - iBlockType = STRINGTABLE_BLOCK - ElseIf (InStr(sLine, " VERSIONINFO") > 0) Then 'VERSIONINFO... - iBlockType = VERSIONINFO_BLOCK - ElseIf (InStr(sLine, " ACCELERATORS") > 0) Then 'ACCELERATORS... - iBlockType = ACCELERATORS_BLOCK - ElseIf (sLine = "BEGIN") Then 'BEGIN... - 'IGNORE FOR SPEEDUP! - ElseIf (sLine = "END") Then 'END... - If (iBlockType = STRINGTABLE_BLOCK) Then 'If inside stringtable... - iBlockType = NO_BLOCK - End If - ElseIf (Left(sLine, 2) = "//") Then 'If comment line... - sLine = "" - 'IGNORE FOR SPEEDUP! - ElseIf (sLine <> "") Then 'If NOT empty line... - 'If (iBlockType = MENU_BLOCK) Or (iBlockType = DIALOGEX_BLOCK) Then - ' sLine = "" - 'End If - End If +//// +// ... +function GetIdsFromResourceFile(sRcPath) { + var reId = /(AFX_ID[A-Z]?_\w+|ID[A-Z]?_\w+)/g; + var oIds = {}; + if (oFSO.FileExists(sRcPath)) { //If the RC file exists... + var iLine = 0; + var iBlockType = NO_BLOCK; + var oTextFile = oFSO.OpenTextFile(sRcPath, ForReading); + while (!oTextFile.AtEndOfStream) { //For all lines... + var sLine = oTextFile.ReadLine().replace(/^\s+|\s+$/g, ""); + iLine++; + if (sLine.indexOf(" MENU") >= 0) { //MENU... + iBlockType = MENU_BLOCK; + } else if (sLine.indexOf(" DIALOGEX") >= 0) { //DIALOGEX... + iBlockType = DIALOGEX_BLOCK; + } else if (sLine === "STRINGTABLE") { //STRINGTABLE... + iBlockType = STRINGTABLE_BLOCK; + } else if (sLine.indexOf(" VERSIONINFO") >= 0) { //VERSIONINFO... + iBlockType = VERSIONINFO_BLOCK; + } else if (sLine.indexOf(" ACCELERATORS") >= 0) { //ACCELERATORS... + iBlockType = ACCELERATORS_BLOCK; + } else if (sLine === "BEGIN") { //BEGIN... + //IGNORE FOR SPEEDUP! + } else if (sLine === "END") { //END... + if (iBlockType === STRINGTABLE_BLOCK) { //If inside stringtable... + iBlockType = NO_BLOCK; + } + } else if (sLine.substring(0, 2) === "//") { //If comment line... + sLine = ""; + //IGNORE FOR SPEEDUP! + } else if (sLine !== "") { //If NOT empty line... + //if (iBlockType === MENU_BLOCK || iBlockType === DIALOGEX_BLOCK) { + // sLine = ""; + //} + } - sId = "" - - If reId.Test(sLine) Then 'If ID... - Set oMatch = reId.Execute(sLine)(0) - sId = oMatch.SubMatches(0) - - If (oIds.Exists(sId) = True) Then 'If the key is already used... - oIds(sId) = oIds(sId) & vbTab & iLine - Else 'If the key is NOT already used... - oIds.Add sId, iLine - End If - End If - Loop - oTextFile.Close - End If - Set GetIdsFromResourceFile = oIds -End Function + var oMatch; + while (oMatch = reId.exec(sLine)) { //If ID... + var sId = oMatch[1]; + if (sId in oIds) { //If the key is already used... + oIds[sId] = oIds[sId] + "\t" + iLine; + } else { //If the key is NOT already used... + oIds[sId] = iLine; + } + } + } + oTextFile.Close(); + } + return oIds; +} -'' -' ... -Function GetIdsFromCppFiles(ByVal sFolderPath, ByRef oIds) - Dim oFolder, oFile, oSubFolder, sExtension - Dim oTextFile, sLine, iLine - Dim reId, oMatches, oMatch, sId - - Set reId = New RegExp - reId.Pattern = "(AFX_ID[A-Z]?_\w+|ID[A-Z]?_\w+)" - reId.IgnoreCase = False - reId.Global = True - - If (oFSO.FolderExists(sFolderPath) = True) Then 'If the folder exists... - Set oFolder = oFSO.GetFolder(sFolderPath) +//// +// ... +function GetIdsFromCppFiles(sFolderPath, oIds) { + var reId = /(AFX_ID[A-Z]?_\w+|ID[A-Z]?_\w+)/g; + if (oFSO.FolderExists(sFolderPath)) { //If the folder exists... + var oFolder = oFSO.GetFolder(sFolderPath); + for (var it = new Enumerator(oFolder.Files); !it.atEnd(); it.moveNext()) { //For all files... + var oFile = it.item(); + var sExtension = oFSO.GetExtensionName(oFile.Name).toLowerCase(); + if (sExtension === "cpp" || (sExtension == "h" && oFile.Name !== "resource.h")) { //If a CPP/H file... + var iLine = 0; + var oTextFile = oFSO.OpenTextFile(oFile.Path, ForReading); + while (!oTextFile.AtEndOfStream) { //For all lines... + var sLine = oTextFile.ReadLine().replace(/^\s+|\s+$/g, ""); + iLine++; + var oMatch; + while (oMatch = reId.exec(sLine)) { //For all results... + var sId = oMatch[1]; + if (sId in oIds) { //If the key is already used... + oIds[sId] = oIds[sId] + "\t" + oFile.Name + ":" + iLine; + } else { //If the key is NOT already used... + oIds[sId] = oFile.Name + ":" + iLine; + } + } + } + oTextFile.Close(); + } + } - For Each oFile In oFolder.Files 'For all files... - sExtension = LCase(oFSO.GetExtensionName(oFile.Name)) - If (sExtension = "cpp") Or (sExtension = "h") And (oFile.Name <> "resource.h") Then 'If a CPP/H file... - iLine = 0 - Set oTextFile = oFSO.OpenTextFile(oFile.Path, ForReading) - Do Until oTextFile.AtEndOfStream = True 'For all lines... - sLine = Trim(oTextFile.ReadLine) - iLine = iLine + 1 - - sId = "" - If reId.Test(sLine) Then 'If ID... - Set oMatches = reId.Execute(sLine) - For Each oMatch In oMatches 'For all results... - sId = oMatch.SubMatches(0) - - If (oIds.Exists(sId) = True) Then 'If the key is already used... - oIds(sId) = oIds(sId) & vbTab & oFile.Name & ":" & iLine - Else 'If the key is NOT already used... - oIds.Add sId, oFile.Name & ":" & iLine - End If - Next - End If - Loop - oTextFile.Close - End If - Next - - For Each oSubFolder In oFolder.SubFolders 'For all folders... - If (oSubFolder.Name <> ".svn") And (oSubFolder.Name <> ".hg") And (oSubFolder.Name <> ".git") Then 'If NOT a SVN folder... - GetIdsFromCppFiles oSubFolder.Path, oIds - End If - Next - End If -End Function + for (var it = new Enumerator(oFolder.SubFolders); !it.atEnd(); it.moveNext()) { //For all folders... + var oSubFolder = it.item(); + if (oSubFolder.Name !== ".svn" && oSubFolder.Name !== ".hg" && oSubFolder.Name !== ".git") { //If NOT a SVN folder... + oIds = GetIdsFromCppFiles(oSubFolder.Path, oIds); + } + } + } + return oIds; +} + +//// +// ... +function InfoBox(sText, iSecondsToWait) { + if (!bRunFromCmd) { //If run from command line... + var oShell = WScript.CreateObject("WScript.Shell"); + return oShell.Popup(sText, iSecondsToWait, WScript.ScriptName, 64); + } else { //If NOT run from command line... + WScript.Echo(sText); + } +} -'' -' ... -Function InfoBox(ByVal sText, ByVal iSecondsToWait) - Dim oShell - - If (bRunFromCmd = False) Then 'If run from command line... - Set oShell = Wscript.CreateObject("WScript.Shell") - InfoBox = oShell.Popup(sText, iSecondsToWait, Wscript.ScriptName, 64) - Else 'If NOT run from command line... - Wscript.Echo sText - End If -End Function diff --git a/Translations/ShellExtension/CreateMasterPotFile.js b/Translations/ShellExtension/CreateMasterPotFile.js index dd72012a097..0d0af357101 100644 --- a/Translations/ShellExtension/CreateMasterPotFile.js +++ b/Translations/ShellExtension/CreateMasterPotFile.js @@ -2,7 +2,7 @@ // This script creates the master POT file (English.pot) for the shell extension. // // Copyright (C) 2007-2009 by Tim Gerundt -// Released under the "GNU General Public License +// Released under the "GNU General Public License" var ForReading = 1; diff --git a/Translations/WinMerge/CreateMasterPotFile.js b/Translations/WinMerge/CreateMasterPotFile.js index 002768c3163..8614b36b85d 100644 --- a/Translations/WinMerge/CreateMasterPotFile.js +++ b/Translations/WinMerge/CreateMasterPotFile.js @@ -2,7 +2,7 @@ // This script creates the master POT file (English.pot). // // Copyright (C) 2007-2009 by Tim Gerundt -// Released under the "GNU General Public License +// Released under the "GNU General Public License" var ForReading = 1; From d0a13fd24d11aaffdc0fe897d4c5538b4dde633b Mon Sep 17 00:00:00 2001 From: Takashi Sawanaka Date: Tue, 13 Feb 2024 08:39:36 +0900 Subject: [PATCH 42/58] WIP --- Translations/ShellExtension/CreateMasterPotFile.js | 2 -- Translations/WinMerge/CreateMasterPotFile.js | 12 ++++++------ 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/Translations/ShellExtension/CreateMasterPotFile.js b/Translations/ShellExtension/CreateMasterPotFile.js index 0d0af357101..1b85dd71f9d 100644 --- a/Translations/ShellExtension/CreateMasterPotFile.js +++ b/Translations/ShellExtension/CreateMasterPotFile.js @@ -12,8 +12,6 @@ var STRINGTABLE_BLOCK = 1; var PATH_ENGLISH_POT = "English.pot"; var PATH_SHELLEXTTEMPLATE_RC = "../../ShellExtension/ShellExtension/ShellExtension.rc"; -var bRunFromCmd; - var oFSO = new ActiveXObject("Scripting.FileSystemObject"); var bRunFromCmd = false; diff --git a/Translations/WinMerge/CreateMasterPotFile.js b/Translations/WinMerge/CreateMasterPotFile.js index 8614b36b85d..5783d3e4cea 100644 --- a/Translations/WinMerge/CreateMasterPotFile.js +++ b/Translations/WinMerge/CreateMasterPotFile.js @@ -105,15 +105,15 @@ function GetStringsFromRcFile(sRcFilePath) { if (fContinuation) { // Nothing to do } else if (sLine.indexOf(" MENU") >= 0 && sLine.indexOf("IDR_") >= 0) { //MENU... - iBlockType = MENU_BLOCK + iBlockType = MENU_BLOCK; } else if (sLine.indexOf(" DIALOGEX") >= 0) { //DIALOGEX... - iBlockType = DIALOGEX_BLOCK + iBlockType = DIALOGEX_BLOCK; } else if (sLine === "STRINGTABLE") { //STRINGTABLE... - iBlockType = STRINGTABLE_BLOCK + iBlockType = STRINGTABLE_BLOCK; } else if (sLine.indexOf(" VERSIONINFO") >= 0) { //VERSIONINFO... - iBlockType = VERSIONINFO_BLOCK + iBlockType = VERSIONINFO_BLOCK; } else if (sLine.indexOf(" ACCELERATORS") >= 0) { //ACCELERATORS... - iBlockType = ACCELERATORS_BLOCK + iBlockType = ACCELERATORS_BLOCK; } else if (sLine === "BEGIN") { //BEGIN... //IGNORE FOR SPEEDUP! } else if (sLine === "END") { //END... @@ -257,7 +257,7 @@ function CreateMasterPotFile(sPotPath, oStrings) { oPotFile.Write("\"X-Poedit-Language: English\\n\"\n"); oPotFile.Write("\"X-Poedit-SourceCharset: UTF-8\\n\"\n"); oPotFile.Write("\"X-Poedit-Basepath: ../../Src/\\n\"\n"); - //oPotFile.Write("\"X-Generator: CreateMasterPotFile.js\\n""\n" + //oPotFile.Write("\"X-Generator: CreateMasterPotFile.js\\n\"\n"); oPotFile.Write("\n"); for (var sKey in oStrings) { //For all strings... var oString = oStrings[sKey]; From 630708d2d2832541a58d72dc6da2addfc7a3d96f Mon Sep 17 00:00:00 2001 From: Takashi Sawanaka Date: Wed, 14 Feb 2024 07:45:13 +0900 Subject: [PATCH 43/58] WIP --- BuildArc.cmd | 2 +- Plugins/Plugins.xml | 16 ++++++++-------- ShellExtension/Register.bat | 6 +++--- Src/MergeLang.vcxproj.filters | 4 ++-- Tools/Scripts/README.md | 4 ++-- Tools/Scripts/UpdateTranslations.bat | 2 +- Translations/WinMerge/English.pot | 2 +- 7 files changed, 18 insertions(+), 18 deletions(-) diff --git a/BuildArc.cmd b/BuildArc.cmd index 684ca9c53a7..8f53ed741f2 100644 --- a/BuildArc.cmd +++ b/BuildArc.cmd @@ -25,7 +25,7 @@ if "%1" == "" ( del "%DISTDIR%\winmerge-%SAFEAPPVER%-full-src.7z" 2> NUL -7z.exe a -t7z -xr!*.gcno -xr!*.gcda -xr!*.gcov -xr!*.orig -xr!*.o -xr!*.a -xr!.dep -xr!*.asm -xr!*.out -xr!debug_static* -xr!debug_shared* -xr!release_static* -xr!release_shared* -xr!*.bak -xr!*.lang -xr!*.db -xr!*.ncb -xr!*.sdf -xr!*.bsc -xr!*.opt -xr!*.plg -xr!*.suo -xr!*.obj -xr!*.ilk -xr!*.pdb -xr!*.pch -xr!*.res -xr!*.exe -xr!*.sbr -xr!.vs -xr!*.VC.db-* -xr!*.zip -xr!WinMergeSplash.psd -xr!*.lib -xr!*.exp -xr!*.idb -xr!*.%COMPUTERNAME%.%USERNAME%.user -xr!BuildLog.htm -xr!ipch -xr!*.tlb -xr!*.tlog -xr!*.*~ -xr!CVS -xr!.svn -xr!.hg -xr!*.log -xr!*.lastbuildstate -xr!FreeImage*.dll -xr!WinIMergeLib.dll -xr!WinIMerge.exe -xr!WinWebDiff.dll -xr!WinWebDiff.exe -xr!BuildTmp -xr!Docs\Manual\Tools "%DISTDIR%\winmerge-%SAFEAPPVER%-full-src.7z" ArchiveSupport ColorSchemes Docs Externals Filters Installer Plugins ShellExtension Src Testing Tools Translations Web readme.txt Version.h Version.in *.cmd *.bat *.inf *.sln *.vbs +7z.exe a -t7z -xr!*.gcno -xr!*.gcda -xr!*.gcov -xr!*.orig -xr!*.o -xr!*.a -xr!.dep -xr!*.asm -xr!*.out -xr!debug_static* -xr!debug_shared* -xr!release_static* -xr!release_shared* -xr!*.bak -xr!*.lang -xr!*.db -xr!*.ncb -xr!*.sdf -xr!*.bsc -xr!*.opt -xr!*.plg -xr!*.suo -xr!*.obj -xr!*.ilk -xr!*.pdb -xr!*.pch -xr!*.res -xr!*.exe -xr!*.sbr -xr!.vs -xr!*.VC.db-* -xr!*.zip -xr!WinMergeSplash.psd -xr!*.lib -xr!*.exp -xr!*.idb -xr!*.%COMPUTERNAME%.%USERNAME%.user -xr!BuildLog.htm -xr!ipch -xr!*.tlb -xr!*.tlog -xr!*.*~ -xr!CVS -xr!.svn -xr!.hg -xr!*.log -xr!*.lastbuildstate -xr!FreeImage*.dll -xr!WinIMergeLib.dll -xr!WinIMerge.exe -xr!WinWebDiff.dll -xr!WinWebDiff.exe -xr!BuildTmp -xr!Docs\Manual\Tools "%DISTDIR%\winmerge-%SAFEAPPVER%-full-src.7z" ArchiveSupport ColorSchemes Docs Externals Filters Installer Plugins ShellExtension Src Testing Tools Translations Web readme.txt Version.h Version.in *.cmd *.bat *.inf *.sln *.js ( echo "%DISTDIR%\WinMerge-%SAFEAPPVER%-Setup.exe" diff --git a/Plugins/Plugins.xml b/Plugins/Plugins.xml index 8e822245735..9b893d55622 100644 --- a/Plugins/Plugins.xml +++ b/Plugins/Plugins.xml @@ -216,24 +216,24 @@