diff --git a/Notepad3.sln b/Notepad3.sln index 79c1a793f..d4fb8bdae 100644 --- a/Notepad3.sln +++ b/Notepad3.sln @@ -44,6 +44,11 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "np3_en_us", "language\np3_e EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "np3_af_za", "language\np3_af_za\np3_af_za.vcxproj", "{C8E80B4C-C0FD-4119-A05A-AB372A61007F}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "np3_nl_nl", "language\np3_nl_nl\np3_nl_nl.vcxproj", "{9B31015C-CB08-4B4B-A957-313A93F862F5}" + ProjectSection(ProjectDependencies) = postProject + {9DC82B0D-2484-4925-92AD-1237C64CCB78} = {9DC82B0D-2484-4925-92AD-1237C64CCB78} + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -144,6 +149,14 @@ Global {C8E80B4C-C0FD-4119-A05A-AB372A61007F}.Release|Win32.Build.0 = Release|Win32 {C8E80B4C-C0FD-4119-A05A-AB372A61007F}.Release|x64.ActiveCfg = Release|x64 {C8E80B4C-C0FD-4119-A05A-AB372A61007F}.Release|x64.Build.0 = Release|x64 + {9B31015C-CB08-4B4B-A957-313A93F862F5}.Debug|Win32.ActiveCfg = Debug|Win32 + {9B31015C-CB08-4B4B-A957-313A93F862F5}.Debug|Win32.Build.0 = Debug|Win32 + {9B31015C-CB08-4B4B-A957-313A93F862F5}.Debug|x64.ActiveCfg = Debug|x64 + {9B31015C-CB08-4B4B-A957-313A93F862F5}.Debug|x64.Build.0 = Debug|x64 + {9B31015C-CB08-4B4B-A957-313A93F862F5}.Release|Win32.ActiveCfg = Release|Win32 + {9B31015C-CB08-4B4B-A957-313A93F862F5}.Release|Win32.Build.0 = Release|Win32 + {9B31015C-CB08-4B4B-A957-313A93F862F5}.Release|x64.ActiveCfg = Release|x64 + {9B31015C-CB08-4B4B-A957-313A93F862F5}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/language/np3_de_de/menu_de_de.rc b/language/np3_de_de/menu_de_de.rc index 96844fefe..56f2d6ed7 100644 Binary files a/language/np3_de_de/menu_de_de.rc and b/language/np3_de_de/menu_de_de.rc differ diff --git a/language/np3_de_de/strings_de_de.rc b/language/np3_de_de/strings_de_de.rc index 72bf10960..693d1aefc 100644 Binary files a/language/np3_de_de/strings_de_de.rc and b/language/np3_de_de/strings_de_de.rc differ diff --git a/language/np3_en_us/strings_en_us.rc b/language/np3_en_us/strings_en_us.rc index 97835d463..7f8ed6e41 100644 Binary files a/language/np3_en_us/strings_en_us.rc and b/language/np3_en_us/strings_en_us.rc differ diff --git a/language/np3_nl_nl/dialogs_nl_nl.rc b/language/np3_nl_nl/dialogs_nl_nl.rc new file mode 100644 index 000000000..2d1cae34e Binary files /dev/null and b/language/np3_nl_nl/dialogs_nl_nl.rc differ diff --git a/language/np3_nl_nl/dllmain.cpp b/language/np3_nl_nl/dllmain.cpp new file mode 100644 index 000000000..fa05c50f9 Binary files /dev/null and b/language/np3_nl_nl/dllmain.cpp differ diff --git a/language/np3_nl_nl/encode_nl_nl.rc b/language/np3_nl_nl/encode_nl_nl.rc new file mode 100644 index 000000000..93f625917 Binary files /dev/null and b/language/np3_nl_nl/encode_nl_nl.rc differ diff --git a/language/np3_nl_nl/lexer_nl_nl.rc b/language/np3_nl_nl/lexer_nl_nl.rc new file mode 100644 index 000000000..5edfca5f7 Binary files /dev/null and b/language/np3_nl_nl/lexer_nl_nl.rc differ diff --git a/language/np3_nl_nl/menu_nl_nl.rc b/language/np3_nl_nl/menu_nl_nl.rc new file mode 100644 index 000000000..0261e6e9b Binary files /dev/null and b/language/np3_nl_nl/menu_nl_nl.rc differ diff --git a/language/np3_nl_nl/np3_nl_nl.cpp b/language/np3_nl_nl/np3_nl_nl.cpp new file mode 100644 index 000000000..19c98c70a Binary files /dev/null and b/language/np3_nl_nl/np3_nl_nl.cpp differ diff --git a/language/np3_nl_nl/np3_nl_nl.rc b/language/np3_nl_nl/np3_nl_nl.rc new file mode 100644 index 000000000..7ac04f456 Binary files /dev/null and b/language/np3_nl_nl/np3_nl_nl.rc differ diff --git a/language/np3_nl_nl/np3_nl_nl.vcxproj b/language/np3_nl_nl/np3_nl_nl.vcxproj new file mode 100644 index 000000000..42dff1851 --- /dev/null +++ b/language/np3_nl_nl/np3_nl_nl.vcxproj @@ -0,0 +1,259 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 15.0 + {9B31015C-CB08-4B4B-A957-313A93F862F5} + Win32Proj + np3enus + 10.0.17134.0 + + + + DynamicLibrary + true + v141 + Unicode + + + DynamicLibrary + false + v141 + true + Unicode + + + DynamicLibrary + true + v141 + Unicode + + + DynamicLibrary + false + v141 + true + Unicode + + + + + + + + + + + + + + + + + + + + + true + ..\..\Bin\$(Configuration)_$(PlatformShortName)_$(PlatformToolset)\lng\ + ..\..\Bin\$(Configuration)_$(PlatformShortName)_$(PlatformToolset)\obj\$(ProjectName)\ + false + + + true + ..\..\Bin\$(Configuration)_$(PlatformShortName)_$(PlatformToolset)\lng\ + ..\..\Bin\$(Configuration)_$(PlatformShortName)_$(PlatformToolset)\obj\$(ProjectName)\ + false + + + false + ..\..\Bin\$(Configuration)_$(PlatformShortName)_$(PlatformToolset)\lng\ + ..\..\Bin\$(Configuration)_$(PlatformShortName)_$(PlatformToolset)\obj\$(ProjectName)\ + false + + + false + ..\..\Bin\$(Configuration)_$(PlatformShortName)_$(PlatformToolset)\lng\ + ..\..\Bin\$(Configuration)_$(PlatformShortName)_$(PlatformToolset)\obj\$(ProjectName)\ + false + + + + Use + Level3 + Disabled + true + _DEBUG;NP3ENUS_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + true + + + Windows + true + + + mkdir "$(TargetDir)..\nl-NL" +"$(UCRTContentRoot)bin\$(WindowsTargetPlatformVersion)\x86\muirct.exe" -q "$(SolutionDir)language\DoReverseMuiLoc.rcconfig" -v 2 -x 0x0413 -g 0x0409 "$(TargetDir)$(TargetFileName)" "$(TargetDir)..\np3lng.dll" "$(TargetDir)..\nl-NL\np3lng.dll.mui" + + + MUI Split + + + 0x0413 + $(ProjectDir)..\..\res;%(AdditionalIncludeDirectories) + + + + + Use + Level3 + Disabled + true + WIN32;_DEBUG;NP3ENUS_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + true + + + Windows + true + + + mkdir "$(TargetDir)..\nl-NL" +"$(UCRTContentRoot)bin\$(WindowsTargetPlatformVersion)\x86\muirct.exe" -q "$(SolutionDir)language\DoReverseMuiLoc.rcconfig" -v 2 -x 0x0413 -g 0x0409 "$(TargetDir)$(TargetFileName)" "$(TargetDir)..\np3lng.dll" "$(TargetDir)..\nl-NL\np3lng.dll.mui" + + + MUI Split + + + 0x0413 + $(ProjectDir)..\..\res;%(AdditionalIncludeDirectories) + + + + + Use + Level3 + MaxSpeed + true + true + true + WIN32;NDEBUG;NP3ENUS_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + true + + + Windows + true + true + true + + + mkdir "$(TargetDir)..\nl-NL" +"$(UCRTContentRoot)bin\$(WindowsTargetPlatformVersion)\x86\muirct.exe" -q "$(SolutionDir)language\DoReverseMuiLoc.rcconfig" -v 2 -x 0x0413 -g 0x0409 "$(TargetDir)$(TargetFileName)" "$(TargetDir)..\np3lng.dll" "$(TargetDir)..\nl-NL\np3lng.dll.mui" + + + MUI Split + + + 0x0413 + $(ProjectDir)..\..\res;%(AdditionalIncludeDirectories) + + + + + Use + Level3 + MaxSpeed + true + true + true + NDEBUG;NP3ENUS_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + true + + + Windows + true + true + true + + + mkdir "$(TargetDir)..\nl-NL" +"$(UCRTContentRoot)bin\$(WindowsTargetPlatformVersion)\x86\muirct.exe" -q "$(SolutionDir)language\DoReverseMuiLoc.rcconfig" -v 2 -x 0x0413 -g 0x0409 "$(TargetDir)$(TargetFileName)" "$(TargetDir)..\np3lng.dll" "$(TargetDir)..\nl-NL\np3lng.dll.mui" + + + MUI Split + + + 0x0413 + $(ProjectDir)..\..\res;%(AdditionalIncludeDirectories) + + + + + + + + + + + + Create + Create + Create + Create + + + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + + true + true + true + true + + + + + + + + + \ No newline at end of file diff --git a/language/np3_nl_nl/np3_nl_nl.vcxproj.filters b/language/np3_nl_nl/np3_nl_nl.vcxproj.filters new file mode 100644 index 000000000..e96fcadef --- /dev/null +++ b/language/np3_nl_nl/np3_nl_nl.vcxproj.filters @@ -0,0 +1,64 @@ + + + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;hm;inl;inc;ipp;xsd + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + + + Header Files + + + Header Files + + + Header Files + + + + + Source Files + + + Source Files + + + Source Files + + + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + + + Resource Files + + + \ No newline at end of file diff --git a/language/np3_nl_nl/resource.h b/language/np3_nl_nl/resource.h new file mode 100644 index 000000000..fc04190be --- /dev/null +++ b/language/np3_nl_nl/resource.h @@ -0,0 +1,16 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by strings_nl_nl.rc +// +#define ID__XXX 40607 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 50001 +#define _APS_NEXT_COMMAND_VALUE 40607 +#define _APS_NEXT_CONTROL_VALUE 1001 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/language/np3_nl_nl/stdafx.cpp b/language/np3_nl_nl/stdafx.cpp new file mode 100644 index 000000000..410df7213 Binary files /dev/null and b/language/np3_nl_nl/stdafx.cpp differ diff --git a/language/np3_nl_nl/stdafx.h b/language/np3_nl_nl/stdafx.h new file mode 100644 index 000000000..4ca98c3b3 Binary files /dev/null and b/language/np3_nl_nl/stdafx.h differ diff --git a/language/np3_nl_nl/strings_nl_nl.rc b/language/np3_nl_nl/strings_nl_nl.rc new file mode 100644 index 000000000..6d557dbaf Binary files /dev/null and b/language/np3_nl_nl/strings_nl_nl.rc differ diff --git a/language/np3_nl_nl/targetver.h b/language/np3_nl_nl/targetver.h new file mode 100644 index 000000000..6fcbd5af9 Binary files /dev/null and b/language/np3_nl_nl/targetver.h differ diff --git a/src/Dialogs.c b/src/Dialogs.c index b74d30da7..7c6e4656b 100644 --- a/src/Dialogs.c +++ b/src/Dialogs.c @@ -288,9 +288,12 @@ void DisplayCmdLineHelp(HWND hwnd) mbp.lpszIcon = MAKEINTRESOURCE(IDR_MAINWND); mbp.dwContextHelpId = 0; mbp.lpfnMsgBoxCallback = NULL; - mbp.dwLanguageId = MAKELANGID(LANG_NEUTRAL,SUBLANG_NEUTRAL); + mbp.dwLanguageId = g_iPrefLngLocID; + + hhkMsgBox = SetWindowsHookEx(WH_CBT, &_MsgBoxProc, 0, GetCurrentThreadId()); MessageBoxIndirect(&mbp); + //MsgBoxLng(MBINFO, IDS_MUI_CMDLINEHELP); } diff --git a/src/Edit.c b/src/Edit.c index 8a8f1c8f8..f454170c2 100644 --- a/src/Edit.c +++ b/src/Edit.c @@ -3679,7 +3679,7 @@ void EditRemoveDuplicateLines(HWND hwnd, bool bRemoveEmptyLines) if (iSelEnd <= SciCall_PositionFromLine(iEndLine)) { --iEndLine; } } else { - iEndLine = SciCall_GetLineCount() - 1; // last line + iEndLine = Sci_GetLastDocLine(); } if ((iEndLine - iStartLine) <= 1) { return; } @@ -3700,22 +3700,26 @@ void EditRemoveDuplicateLines(HWND hwnd, bool bRemoveEmptyLines) for (DocLn iCurLine = iStartLine; iCurLine < iEndLine; ++iCurLine) { - const DocPos iCurLnLen = SciCall_GetLine(iCurLine, pCurrentLine); + SciCall_GetLine(iCurLine, pCurrentLine); + const DocPos iCurLnLen = Sci_GetNetLineLength(iCurLine); + pCurrentLine[iCurLnLen] = '\0'; + if (bRemoveEmptyLines || (iCurLnLen > iEmptyLnLen)) { - for (DocLn iCompareLine = iCurLine + 1; iCompareLine < iEndLine; ++iCompareLine) + for (DocLn iCompareLine = iCurLine + 1; iCompareLine <= iEndLine; ++iCompareLine) { - const DocPos iCmpLnLen = SciCall_GetLine(iCompareLine, NULL); + const DocPos iCmpLnLen = Sci_GetNetLineLength(iCompareLine); if (bRemoveEmptyLines || (iCmpLnLen > iEmptyLnLen)) { const DocPos iBegCmpLine = SciCall_PositionFromLine(iCompareLine); - const char* pCompareLine = SciCall_GetRangePointer(iBegCmpLine, iCmpLnLen + 2); + const char* pCompareLine = SciCall_GetRangePointer(iBegCmpLine, iCmpLnLen + 1); if (iCurLnLen == iCmpLnLen) { if (StringCchCompareNA(pCurrentLine, iCurLnLen, pCompareLine, iCmpLnLen) == 0) { - SciCall_SetTargetRange(iBegCmpLine, iBegCmpLine + iCmpLnLen); + const DocPos iLenToDel = (iCompareLine != Sci_GetLastDocLine() ? SciCall_GetLine(iCompareLine, NULL) : iCmpLnLen); + SciCall_SetTargetRange(iBegCmpLine, iBegCmpLine + iLenToDel); SciCall_ReplaceTarget(0, ""); --iCompareLine; // proactive preventing progress to avoid comparison line skip --iEndLine; diff --git a/src/Helpers.c b/src/Helpers.c index 666da15b7..8c313ba65 100644 --- a/src/Helpers.c +++ b/src/Helpers.c @@ -1197,6 +1197,21 @@ bool IsCmdEnabled(HWND hwnd,UINT uId) } + +//============================================================================= +// +// LoadLngString() +// + +int LoadLngString(UINT uID, LPTSTR lpBuffer, int nBufferMax) +{ + const int nLen = LoadString(g_hLngResContainer, uID, lpBuffer, nBufferMax); + + return (nLen != 0) ? nLen : LoadString(g_hInstance, uID, lpBuffer, nBufferMax); +} + + + //============================================================================= // // FormatLngString() @@ -1206,7 +1221,7 @@ int FormatLngString(LPWSTR lpOutput, int nOutput, UINT uIdFormat, ...) static WCHAR pBuffer[XHUGE_BUFFER]; pBuffer[0] = L'\0'; - if (GetLngString(uIdFormat, pBuffer, nOutput)) + if (LoadLngString(uIdFormat, pBuffer, nOutput)) { StringCchVPrintf(lpOutput, nOutput, pBuffer, (LPVOID)((PUINT_PTR)&uIdFormat + 1)); } diff --git a/src/Helpers.h b/src/Helpers.h index 7feb71e1e..c44a00432 100644 --- a/src/Helpers.h +++ b/src/Helpers.h @@ -190,8 +190,9 @@ bool IsCmdEnabled(HWND, UINT); #define StrEnd(pStart) (pStart + lstrlen(pStart)) -#define GetLngString(id,pb,cb) LoadString(g_hLngResContainer,(id),(pb),(cb)) +#define GetLngString(id,pb,cb) LoadLngString((id),(pb),(cb)) +int LoadLngString(UINT uID, LPWSTR lpBuffer, int nBufferMax); int FormatLngString(LPWSTR, int, UINT, ...); diff --git a/src/Notepad3.c b/src/Notepad3.c index 49688ab64..92c1a7907 100644 --- a/src/Notepad3.c +++ b/src/Notepad3.c @@ -133,8 +133,9 @@ bool g_bFindReplCopySelOrClip = true; WCHAR g_tchPrefLngLocName[MINI_BUFFER]; LANGID g_iPrefLngLocID = MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT); HMODULE g_hLngResContainer = NULL; -static WCHAR* const g_tchAvailableLanguages = L"af-ZA fr-FR de-DE es-ES en-UK"; // en-US internal -static LANGID const g_iAvailableLanguages[5] = { 1078, 1036, 1031, 3082, 2057 }; // 1033 internal +#define LNG_AVAILABLE_COUNT 6 +static WCHAR* const g_tchAvailableLanguages = L"af-ZA de-DE es-ES en-UK fr-FR nl-NL"; // en-US internal +static LANGID const g_iAvailableLanguages[LNG_AVAILABLE_COUNT] = { 1078, 1031, 3082, 2057, 1036, 1043 }; // 1033 internal WCHAR g_tchFileDlgFilters[XXXL_BUFFER] = { L'\0' }; @@ -851,7 +852,7 @@ static bool __fastcall _LngStrToMultiLngStr(WCHAR* pLngStr, WCHAR* pLngMultiStr, static HMODULE __fastcall _LoadLanguageResources(LANGID const langID) { bool bLngAvailable = false; - for (int i = 0; i < 5; ++i) { + for (int i = 0; i < COUNTOF(g_iAvailableLanguages); ++i) { if (g_iAvailableLanguages[i] == langID) { bLngAvailable = true; break; diff --git a/src/SciCall.h b/src/SciCall.h index 259c76d0b..9aebf496b 100644 --- a/src/SciCall.h +++ b/src/SciCall.h @@ -390,6 +390,7 @@ DeclareSciCallR0(IsSelectionRectangle, SELECTIONISRECTANGLE, bool) #define Sci_GetEOLLen() ((SciCall_GetEOLMode() == SC_EOL_CRLF) ? 2 : 1) #define Sci_GetCurrentLine() SciCall_LineFromPosition(SciCall_GetCurrentPos()) +#define Sci_GetLastDocLine() (SciCall_GetLineCount() - 1) // length of line w/o line-end chars (full use SciCall_LineLength() #define Sci_GetNetLineLength(line) (SciCall_GetLineEndPosition(line) - SciCall_PositionFromLine(line)) @@ -397,6 +398,7 @@ DeclareSciCallR0(IsSelectionRectangle, SELECTIONISRECTANGLE, bool) ///~#define Sci_GetDocEndPosition() (SciCall_GetTextLength() - 1) #define Sci_GetDocEndPosition() SciCall_GetTextLength() + //============================================================================= #endif //_NP3_SCICALL_H_ diff --git a/themes/Flat/48/Toolbar.bmp b/themes/Flat/48/Toolbar.bmp new file mode 100644 index 000000000..889fc5117 Binary files /dev/null and b/themes/Flat/48/Toolbar.bmp differ diff --git a/themes/professional/32/Toolbar.bmp b/themes/professional/32/Toolbar.bmp new file mode 100644 index 000000000..82612dede Binary files /dev/null and b/themes/professional/32/Toolbar.bmp differ