Author: ekohl
Date: Sun Dec 1 14:22:29 2013
New Revision: 61173
URL:
http://svn.reactos.org/svn/reactos?rev=61173&view=rev
Log:
[NOTEPAD]
Improve print argument flag. Patch by Lee Schroeder.
CORE-7514 #resolve
Modified:
trunk/reactos/base/applications/notepad/main.c
Modified: trunk/reactos/base/applications/notepad/main.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/notepad/…
==============================================================================
--- trunk/reactos/base/applications/notepad/main.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/notepad/main.c [iso-8859-1] Sun Dec 1 14:22:29 2013
@@ -462,9 +462,9 @@
return(nResult);
}
-static void HandleCommandLine(LPTSTR cmdline)
-{
- int opt_print=0;
+static BOOL HandleCommandLine(LPTSTR cmdline)
+{
+ int opt_print = 0;
while (*cmdline == _T(' ') || *cmdline == _T('-') || *cmdline ==
_T('/'))
{
@@ -480,7 +480,7 @@
{
case 'p':
case 'P':
- opt_print=1;
+ opt_print = 1;
break;
}
}
@@ -526,7 +526,10 @@
DoOpenFile(file_name);
InvalidateRect(Globals.hMainWnd, NULL, FALSE);
if (opt_print)
+ {
DIALOG_FilePrint();
+ return FALSE;
+ }
}
else
{
@@ -539,7 +542,9 @@
break;
}
}
- }
+ }
+
+ return TRUE;
}
/***********************************************************************
@@ -554,10 +559,10 @@
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 @@
DIALOG_ViewStatusBar();
- HandleCommandLine(cmdline);
+ if (!HandleCommandLine(cmdline))
+ {
+ return 0;
+ }
hAccel = LoadAccelerators( hInstance, MAKEINTRESOURCE(ID_ACCEL) );