Author: manolo
Date: 2010-03-23 11:41:30 -0700 (Tue, 23 Mar 2010)
New Revision: 7323
Log:
Better error return codes for Fl_PSfile_Device::start_job()

Modified:
   branches/branch-1.3/FL/Fl_PSfile_Device.H
   branches/branch-1.3/src/Fl_PS_Printer.cxx

Modified: branches/branch-1.3/FL/Fl_PSfile_Device.H
===================================================================
--- branches/branch-1.3/FL/Fl_PSfile_Device.H   2010-03-23 18:09:38 UTC (rev 
7322)
+++ branches/branch-1.3/FL/Fl_PSfile_Device.H   2010-03-23 18:41:30 UTC (rev 
7323)
@@ -265,7 +265,7 @@
    @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 @@
    @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);
   

Modified: branches/branch-1.3/src/Fl_PS_Printer.cxx
===================================================================
--- branches/branch-1.3/src/Fl_PS_Printer.cxx   2010-03-23 18:09:38 UTC (rev 
7322)
+++ branches/branch-1.3/src/Fl_PS_Printer.cxx   2010-03-23 18:41:30 UTC (rev 
7323)
@@ -1204,9 +1204,10 @@
   // 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)

_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit

Reply via email to