* CanContinue() should obviously return "true" before there is a reason to stop,

ie. also before BeginJob() has been called.
* This fixes BePDF and Gobe Productive not being able to print under Haiku.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34446 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2009-12-02 14:10:17 +00:00
parent e90df81946
commit f331ce2464
+6 -2
View File
@@ -144,9 +144,10 @@ BPrintJob::BPrintJob(const char* jobName)
: :
fPrintJobName(NULL), fPrintJobName(NULL),
fSpoolFile(NULL), fSpoolFile(NULL),
fError(B_ERROR), fError(B_NO_INIT),
fSetupMessage(NULL), fSetupMessage(NULL),
fDefaultSetupMessage(NULL), fDefaultSetupMessage(NULL),
fAbort(0),
fCurrentPageHeader(NULL) fCurrentPageHeader(NULL)
{ {
memset(&fSpoolFileHeader, 0, sizeof(print_file_header)); memset(&fSpoolFileHeader, 0, sizeof(print_file_header));
@@ -200,6 +201,7 @@ BPrintJob::ConfigJob()
if (!_HandlePrintSetup(fSetupMessage)) if (!_HandlePrintSetup(fSetupMessage))
return B_ERROR; return B_ERROR;
fError = B_OK;
return B_OK; return B_OK;
} }
@@ -207,6 +209,8 @@ BPrintJob::ConfigJob()
void void
BPrintJob::BeginJob() BPrintJob::BeginJob()
{ {
fError = B_ERROR;
// can not start a new job until it has been commited or cancelled // can not start a new job until it has been commited or cancelled
if (fSpoolFile != NULL || fCurrentPageHeader == NULL) if (fSpoolFile != NULL || fCurrentPageHeader == NULL)
return; return;
@@ -253,7 +257,7 @@ BPrintJob::BeginJob()
fSpoolFileHeader.first_page = (off_t)-1; fSpoolFileHeader.first_page = (off_t)-1;
if (fSpoolFile->Write(&fSpoolFileHeader, sizeof(print_file_header)) if (fSpoolFile->Write(&fSpoolFileHeader, sizeof(print_file_header))
!= sizeof(print_file_header)) { != sizeof(print_file_header)) {
CancelJob(); CancelJob();
return; return;
} }