mirror of
https://github.com/reactos/reactos.git
synced 2025-07-31 08:22:15 +00:00
[NOTEPAD] Make "UTF-8 without BOM" default (#5081)
- Define a constant ENCODING_DEFAULT that is equal to ENCODING_UTF8. - Initialize Globals.encFile as ENCODING_DEFAULT. - Reset encoding and line ending in DIALOG_FileNew. - AnalyzeEncoding returns ENCODING_DEFAULT for non-zero ASCII text. - Remove unnecessary DIALOG_StatusBarAlignParts calls. CORE-18837
This commit is contained in:
parent
b2cac5cd6c
commit
f7f2ed201a
4 changed files with 25 additions and 26 deletions
|
@ -167,7 +167,6 @@ static VOID DIALOG_StatusBarUpdateEncoding(VOID)
|
|||
|
||||
static VOID DIALOG_StatusBarUpdateAll(VOID)
|
||||
{
|
||||
DIALOG_StatusBarAlignParts();
|
||||
DIALOG_StatusBarUpdateCaretPos();
|
||||
DIALOG_StatusBarUpdateLineEndings();
|
||||
DIALOG_StatusBarUpdateEncoding();
|
||||
|
@ -405,8 +404,6 @@ BOOL DoCloseFile(VOID)
|
|||
break;
|
||||
|
||||
case IDCANCEL:
|
||||
return FALSE;
|
||||
|
||||
default:
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -463,24 +460,26 @@ VOID DoOpenFile(LPCTSTR szFileName)
|
|||
SetFileName(szFileName);
|
||||
UpdateWindowCaption(TRUE);
|
||||
NOTEPAD_EnableSearchMenu();
|
||||
DIALOG_StatusBarUpdateAll();
|
||||
|
||||
done:
|
||||
if (hFile != INVALID_HANDLE_VALUE)
|
||||
CloseHandle(hFile);
|
||||
|
||||
DIALOG_StatusBarUpdateAll();
|
||||
}
|
||||
|
||||
VOID DIALOG_FileNew(VOID)
|
||||
{
|
||||
/* Close any files and prompt to save changes */
|
||||
if (DoCloseFile()) {
|
||||
SetWindowText(Globals.hEdit, empty_str);
|
||||
SendMessage(Globals.hEdit, EM_EMPTYUNDOBUFFER, 0, 0);
|
||||
SetFocus(Globals.hEdit);
|
||||
NOTEPAD_EnableSearchMenu();
|
||||
DIALOG_StatusBarUpdateAll();
|
||||
}
|
||||
if (!DoCloseFile())
|
||||
return;
|
||||
|
||||
SetWindowText(Globals.hEdit, NULL);
|
||||
SendMessage(Globals.hEdit, EM_EMPTYUNDOBUFFER, 0, 0);
|
||||
Globals.iEoln = EOLN_CRLF;
|
||||
Globals.encFile = ENCODING_DEFAULT;
|
||||
|
||||
NOTEPAD_EnableSearchMenu();
|
||||
DIALOG_StatusBarUpdateAll();
|
||||
}
|
||||
|
||||
VOID DIALOG_FileNewWindow(VOID)
|
||||
|
@ -930,7 +929,7 @@ VOID DoShowHideStatusBar(VOID)
|
|||
}
|
||||
|
||||
/* Update layout of controls */
|
||||
PostMessageW(Globals.hMainWnd, WM_SIZE, 0, 0);
|
||||
SendMessageW(Globals.hMainWnd, WM_SIZE, 0, 0);
|
||||
|
||||
if (Globals.hStatusBar == NULL)
|
||||
return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue