Added sanity check to public method. Set offset to first page in header.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21754 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Michael Pfeiffer 2007-07-30 18:19:56 +00:00
parent 820f5fa5a5
commit dc5219b081

View File

@ -525,6 +525,9 @@ BPrintJob::CanContinue()
void
BPrintJob::DrawView(BView *view, BRect rect, BPoint where)
{
if (fSpoolFile == NULL)
return;
if (view == NULL)
return;
@ -718,6 +721,10 @@ BPrintJob::NewPage()
// write page header
fCurrentPageHeaderOffset = fSpoolFile->Position();
fSpoolFile->Write(fCurrentPageHeader, sizeof(*fCurrentPageHeader));
if (fPageNumber == 1)
fCurrentHeader.first_page = fCurrentPageHeaderOffset;
fPageNumber ++;
}
@ -727,8 +734,6 @@ BPrintJob::EndLastPage()
{
fSpoolFile->Seek(0, SEEK_SET);
fCurrentHeader.page_count = fPageNumber;
// TODO set first_page correctly
// fCurrentHeader.first_page = 0;
fSpoolFile->Write(&fCurrentHeader, sizeof(fCurrentHeader));}