Make printing work again on OpenVMS.
b=136884 r=rods sr=attinasi git-svn-id: svn://10.0.0.236/trunk@119019 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -201,6 +201,12 @@ nsPostScriptObj::~nsPostScriptObj()
|
||||
if (mPrintSetup->out) {
|
||||
fclose(mPrintSetup->out);
|
||||
mPrintSetup->out = nsnull;
|
||||
#ifdef VMS
|
||||
// if the file was still open and we have a print command, then it was
|
||||
// a print preview operation and so we need to delete the temp file.
|
||||
if (mPrintSetup->print_cmd)
|
||||
remove(mPrintSetup->filename);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2057,20 +2063,28 @@ nsPostScriptObj::end_document()
|
||||
fprintf(f, "%%%%Pages: %d\n", (int) mPageNumber - 1);
|
||||
fprintf(f, "%%%%EOF\n");
|
||||
|
||||
#ifdef VMS
|
||||
if ( mPrintSetup->print_cmd != nsnull ) {
|
||||
char VMSPrintCommand[1024];
|
||||
if (mPrintSetup->out) {
|
||||
fclose(mPrintSetup->out);
|
||||
mPrintSetup->out = nsnull;
|
||||
}
|
||||
PR_snprintf(VMSPrintCommand, sizeof(VMSPrintCommand), "%s %s.",
|
||||
mPrintSetup->print_cmd, mPrintSetup->filename);
|
||||
PR_LOG(nsPostScriptObjLM, PR_LOG_DEBUG, ("VMS print command '%s'\n", VMSPrintCommand));
|
||||
// FixMe: Check for error and return one of NS_ERROR_GFX_PRINTER_* on demand
|
||||
system(VMSPrintCommand);
|
||||
free((void *)mPrintSetup->filename);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (mPrintSetup->filename) {
|
||||
PR_LOG(nsPostScriptObjLM, PR_LOG_DEBUG, ("print to file completed.\n"));
|
||||
}
|
||||
else {
|
||||
PR_LOG(nsPostScriptObjLM, PR_LOG_DEBUG, ("piping job to '%s'\n", mPrintSetup->print_cmd));
|
||||
|
||||
#ifdef VMS
|
||||
char VMSPrintCommand[1024];
|
||||
PR_snprintf(VMSPrintCommand, sizeof(VMSPrintCommand), "%s %s.",
|
||||
mPrintSetup->print_cmd, mPrintSetup->filename);
|
||||
// FixMe: Check for error and return one of NS_ERROR_GFX_PRINTER_* on demand
|
||||
system(VMSPrintCommand);
|
||||
free((void *)mPrintSetup->filename);
|
||||
#else
|
||||
FILE *pipe;
|
||||
char buf[256];
|
||||
size_t len;
|
||||
@@ -2095,7 +2109,6 @@ nsPostScriptObj::end_document()
|
||||
|
||||
pclose(pipe);
|
||||
PR_LOG(nsPostScriptObjLM, PR_LOG_DEBUG, ("piping done, copied %ld bytes.\n", job_size));
|
||||
#endif /* VMS */
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
|
||||
@@ -54,6 +54,7 @@ pref("applications.rlogin_with_user", "create /term /detach \"rlogin %h -l %u\""
|
||||
/* PostScript module specific (see unix.js for additional configuration details) */
|
||||
pref("print.postscript.print_command", "print /delete");
|
||||
/* Print module independant */
|
||||
pref("print.print_command", "print /delete");
|
||||
pref("print.print_color", false);
|
||||
|
||||
pref("browser.cache.disk.capacity", 4000);
|
||||
|
||||
Reference in New Issue
Block a user