[NOTEPAD]

Improve print argument flag. Patch by Lee Schroeder.
CORE-7514 #resolve

svn path=/trunk/; revision=61173
This commit is contained in:
Eric Kohl 2013-12-01 14:22:29 +00:00
parent bcbc26ebd2
commit abbea26543

View file

@ -462,9 +462,9 @@ static int AlertFileDoesNotExist(LPCTSTR szFileName)
return(nResult);
}
static void HandleCommandLine(LPTSTR cmdline)
static BOOL HandleCommandLine(LPTSTR cmdline)
{
int opt_print=0;
int opt_print = 0;
while (*cmdline == _T(' ') || *cmdline == _T('-') || *cmdline == _T('/'))
{
@ -480,7 +480,7 @@ static void HandleCommandLine(LPTSTR cmdline)
{
case 'p':
case 'P':
opt_print=1;
opt_print = 1;
break;
}
}
@ -526,7 +526,10 @@ static void HandleCommandLine(LPTSTR cmdline)
DoOpenFile(file_name);
InvalidateRect(Globals.hMainWnd, NULL, FALSE);
if (opt_print)
{
DIALOG_FilePrint();
return FALSE;
}
}
else
{
@ -539,7 +542,9 @@ static void HandleCommandLine(LPTSTR cmdline)
break;
}
}
}
}
return TRUE;
}
/***********************************************************************
@ -554,10 +559,10 @@ int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE prev, LPTSTR cmdline, int sh
HMONITOR monitor;
MONITORINFO info;
INT x, y;
static const TCHAR className[] = _T("NPClass");
static const TCHAR winName[] = _T("Notepad");
switch (GetUserDefaultUILanguage())
{
case MAKELANGID(LANG_HEBREW, SUBLANG_DEFAULT):
@ -626,7 +631,10 @@ int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE prev, LPTSTR cmdline, int sh
DIALOG_ViewStatusBar();
HandleCommandLine(cmdline);
if (!HandleCommandLine(cmdline))
{
return 0;
}
hAccel = LoadAccelerators( hInstance, MAKEINTRESOURCE(ID_ACCEL) );