Skip to content

Commit

Permalink
Merge pull request #703 from RaiKoHoff/Dev_1002
Browse files Browse the repository at this point in the history
Optimized Settings-File handling and internal enhancements
  • Loading branch information
RaiKoHoff authored Oct 2, 2018
2 parents fc4e44d + e53be87 commit e8df961
Show file tree
Hide file tree
Showing 72 changed files with 3,873 additions and 3,200 deletions.
Binary file modified Build/Notepad3.ini
Binary file not shown.
2 changes: 1 addition & 1 deletion Versions/build.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1113
1116
11 changes: 4 additions & 7 deletions crypto/crypto.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@ see ecryption-doc.txt for details
#include "rijndael-api-fst.h"
#include "crypto.h"

extern HMODULE g_hLngResContainer;
extern HICON g_hDlgIcon;

#define WKEY_LEN 256
#define KEY_LEN 512
#define PAD_SLOP 16
Expand Down Expand Up @@ -115,7 +112,7 @@ INT_PTR CALLBACK SetKeysDlgProc(HWND hDlg, UINT umsg, WPARAM wParam, LPARAM lPar

case WM_INITDIALOG:
{
if (g_hDlgIcon) { SendMessage(hDlg, WM_SETICON, ICON_SMALL, (LPARAM)g_hDlgIcon); }
if (Globals.hDlgIcon) { SendMessage(hDlg, WM_SETICON, ICON_SMALL, (LPARAM)Globals.hDlgIcon); }
SetDlgItemText(hDlg, IDC_PWD_EDIT1, unicodeFileKey);
SetDlgItemText(hDlg, IDC_PWD_EDIT2, unicodeMasterKey);
ShowWindow(GetDlgItem(hDlg, IDC_PWD_CHECK3), hasMasterFileKey);
Expand Down Expand Up @@ -240,7 +237,7 @@ INT_PTR CALLBACK GetKeysDlgProc(HWND hDlg, UINT umsg, WPARAM wParam, LPARAM lPar

case WM_INITDIALOG:
{
if (g_hDlgIcon) { SendMessage(hDlg, WM_SETICON, ICON_SMALL, (LPARAM)g_hDlgIcon); }
if (Globals.hDlgIcon) { SendMessage(hDlg, WM_SETICON, ICON_SMALL, (LPARAM)Globals.hDlgIcon); }
int vis = masterKeyAvailable ? SW_SHOW : SW_HIDE;
ShowWindow(GetDlgItem(hDlg, IDC_PWD_STATMPW), vis);
ShowWindow(GetDlgItem(hDlg, IDC_PWD_CHECK3), vis);
Expand Down Expand Up @@ -306,15 +303,15 @@ INT_PTR CALLBACK GetKeysDlgProc(HWND hDlg, UINT umsg, WPARAM wParam, LPARAM lPar
// set passphrases for output
bool GetFileKey(HWND hwnd)
{
return (IDOK == DialogBoxParam(g_hLngResContainer, MAKEINTRESOURCE(IDD_MUI_PASSWORDS),
return (IDOK == DialogBoxParam(Globals.hLngResContainer, MAKEINTRESOURCE(IDD_MUI_PASSWORDS),
GetParent(hwnd), SetKeysDlgProc, (LPARAM)hwnd));
}

// set passphrases for file being input
bool ReadFileKey(HWND hwnd, bool master)
{
masterKeyAvailable = master;
return (IDOK == DialogBoxParam(g_hLngResContainer, MAKEINTRESOURCE(IDD_MUI_READPW),
return (IDOK == DialogBoxParam(Globals.hLngResContainer, MAKEINTRESOURCE(IDD_MUI_READPW),
GetParent(hwnd), GetKeysDlgProc, (LPARAM)hwnd));
}

Expand Down
2 changes: 1 addition & 1 deletion minipath/src/minipath.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ UINT16 g_uWinVer;
HINSTANCE g_hInstance = NULL;
HMODULE g_hLngResContainer = NULL;

WCHAR g_tchPrefLngLocName[64];
WCHAR g_tchPrefLngLocName[LOCALE_NAME_MAX_LENGTH + 1];
LANGID g_iPrefLANGID = MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US);
static WCHAR* const g_tchAvailableLanguages = L"af-ZA de-DE es-ES en-GB fr-FR ja-JP nl-NL zh-CN"; // en-US internal

Expand Down
Binary file not shown.
2 changes: 1 addition & 1 deletion res/Notepad3.exe.manifest.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<assemblyIdentity
name="Notepad3"
processorArchitecture="*"
version="4.18.920.1113"
version="4.18.921.1116"
type="win32"
/>
<description>Notepad3 TinyExpr</description>
Expand Down
1 change: 1 addition & 0 deletions scintilla/cppcheck.suppress
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ variableScope:scintilla/lexers/LexErlang.cxx
variableScope:scintilla/lexers/LexGui4Cli.cxx
variableScope:scintilla/lexers/LexInno.cxx
variableScope:scintilla/lexers/LexLaTeX.cxx
copyCtorAndEqOperator:scintilla/lexers/LexLaTeX.cxx
variableScope:scintilla/lexers/LexMetapost.cxx
variableScope:scintilla/lexers/LexModula.cxx
variableScope:scintilla/lexers/LexNimrod.cxx
Expand Down
9 changes: 9 additions & 0 deletions scintilla/doc/ScintillaHistory.html
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,7 @@ <h3>
<td>Luke Rasmussen</td>
</tr><tr>
<td>maboroshin</td>
<td>Gokul Krishnan</td>
</tr>
</table>
<p>
Expand All @@ -554,8 +555,16 @@ <h3>
Released 9 September 2018.
</li>
<li>
C++ lexer fixes evaluation of "#elif".
<a href="https://sourceforge.net/p/scintilla/bugs/2045/">Bug #2045</a>.
</li>
<li>
Markdown lexer fixes highlighting of non-ASCII characters in links.
</li>
<li>
SciTE on Win32 makes Del key work again in find and replace strips.
<a href="https://sourceforge.net/p/scintilla/bugs/2044/">Bug #2044</a>.
</li>
</ul>
<h3>
<a href="https://www.scintilla.org/scite411.zip">Release 4.1.1</a>
Expand Down
2 changes: 1 addition & 1 deletion scintilla/lexers/LexCPP.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1279,7 +1279,7 @@ void SCI_METHOD LexerCPP::Lex(Sci_PositionU startPos, Sci_Position length, int i
// Ensure only one chosen out of #if .. #elif .. #elif .. #else .. #endif
if (!preproc.CurrentIfTaken()) {
// Similar to #if
std::string restOfLine = GetRestOfLine(styler, sc.currentPos + 2, true);
std::string restOfLine = GetRestOfLine(styler, sc.currentPos + 4, true);
const bool ifGood = EvaluateExpression(restOfLine, preprocessorDefinitions);
if (ifGood) {
preproc.InvertCurrentLevel();
Expand Down
17 changes: 10 additions & 7 deletions src/ChooseFont/ChooseFont.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,17 @@
#include "ChooseFont.h"
#include "FontEnumeration.h"
#include "GdiTextRenderer.h"

extern "C" {
#include "../resource.h"
#include "TypeDefs.h"
}

//----------------------------------------------------------------------------

IDWriteFactory* g_dwrite = nullptr;

static HINSTANCE g_hInstanceNP3;
extern "C" HMODULE g_hLngResContainer;

extern "C" void CenterDlgInParent(HWND hDlg);

Expand All @@ -29,7 +32,7 @@ extern "C" void CenterDlgInParent(HWND hDlg);
//
static int LoadLngStringW(UINT uID, LPWSTR lpBuffer, int nBufferMax)
{
const int nLen = LoadStringW(g_hLngResContainer, uID, lpBuffer, nBufferMax);
const int nLen = LoadStringW(Globals.hLngResContainer, uID, lpBuffer, nBufferMax);
return (nLen != 0) ? nLen : LoadStringW(g_hInstanceNP3, uID, lpBuffer, nBufferMax);
}

Expand Down Expand Up @@ -170,8 +173,8 @@ HRESULT ChooseFontDialog::GetTextFormat(IDWriteTextFormat** textFormat)
// Open the dialog
if (SUCCEEDED(hr))
{
if (g_hLngResContainer) {
hr = (HRESULT)DialogBoxParam(g_hLngResContainer, MAKEINTRESOURCE(IDD_MUI_CHOOSEFONT), m_parent, CFDialogProc, (LPARAM)this);
if (Globals.hLngResContainer) {
hr = (HRESULT)DialogBoxParam(Globals.hLngResContainer, MAKEINTRESOURCE(IDD_MUI_CHOOSEFONT), m_parent, CFDialogProc, (LPARAM)this);
}
else {
hr = (HRESULT)DialogBoxParam(g_hInstanceNP3, MAKEINTRESOURCE(IDD_MUI_CHOOSEFONT), m_parent, CFDialogProc, (LPARAM)this);
Expand Down Expand Up @@ -215,8 +218,8 @@ HRESULT ChooseFontDialog::GetTextFormat(IDWriteTextFormat* textFormatIn, IDWrite
// Open the dialog
if (SUCCEEDED(hr))
{
if (g_hLngResContainer) {
hr = (HRESULT)DialogBoxParam(g_hLngResContainer, MAKEINTRESOURCE(IDD_MUI_CHOOSEFONT), m_parent, CFDialogProc, (LPARAM)this);
if (Globals.hLngResContainer) {
hr = (HRESULT)DialogBoxParam(Globals.hLngResContainer, MAKEINTRESOURCE(IDD_MUI_CHOOSEFONT), m_parent, CFDialogProc, (LPARAM)this);
}
else {
hr = (HRESULT)DialogBoxParam(g_hInstanceNP3, MAKEINTRESOURCE(IDD_MUI_CHOOSEFONT), m_parent, CFDialogProc, (LPARAM)this);
Expand Down Expand Up @@ -801,7 +804,7 @@ void ChooseFontDialog::OnDrawItem(HWND hwnd, const DRAWITEMSTRUCT* lpDrawItem)
// ############################################################################


static void __fastcall SetChosenFontFromTextFormat(
static void SetChosenFontFromTextFormat(
IDWriteTextFormat* textFormat,
LPCHOOSEFONT lpCF, const UINT dpi)
{
Expand Down
Loading

0 comments on commit e8df961

Please sign in to comment.