summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--FL/Fl_PSfile_Device.H4
-rw-r--r--src/Fl_PS_Printer.cxx5
2 files changed, 5 insertions, 4 deletions
diff --git a/FL/Fl_PSfile_Device.H b/FL/Fl_PSfile_Device.H
index b8e571fb9..247cb2a2f 100644
--- a/FL/Fl_PSfile_Device.H
+++ b/FL/Fl_PSfile_Device.H
@@ -265,7 +265,7 @@ class FL_EXPORT Fl_PSfile_Device : public Fl_Abstract_Printer {
@param pagecount The total number of pages to be created.
@param format Desired page format.
@param layout Desired page layout.
- @return 0 iff OK
+ @return 0 iff OK, 1 if user cancelled the file dialog, 2 if fopen failed on user-selected output file.
*/
int start_job(int pagecount, enum Page_Format format = A4, enum Page_Layout layout = PORTRAIT);
@@ -276,7 +276,7 @@ class FL_EXPORT Fl_PSfile_Device : public Fl_Abstract_Printer {
@param pagecount The total number of pages to be created.
@param format Desired page format.
@param layout Desired page layout.
- @return 0 iff OK
+ @return 0 iff OK, 1 if fopen(fname, "w") call failed.
*/
int start_job(const char *fname, int pagecount, enum Page_Format format = A4, enum Page_Layout layout = PORTRAIT);
diff --git a/src/Fl_PS_Printer.cxx b/src/Fl_PS_Printer.cxx
index d981ee2c9..cdc3545a4 100644
--- a/src/Fl_PS_Printer.cxx
+++ b/src/Fl_PS_Printer.cxx
@@ -1204,9 +1204,10 @@ int Fl_PSfile_Device::start_job (int pagecount, enum Page_Format format, enum Pa
// Show native chooser
if ( fnfc.show() ) return 1;
output = fopen(fnfc.filename(), "w");
- if(output == NULL) return 1;
+ if(output == NULL) return 2;
ps_filename_ = strdup(fnfc.filename());
- return start_postscript(pagecount, format, layout);
+ start_postscript(pagecount, format, layout);
+ return 0;
}
int Fl_PSfile_Device::start_job (const char *fname, int pagecount, enum Page_Format format, enum Page_Layout layout)