Update ooo320-m1
[ooovba.git] / applied_patches / 0275-psprint-postscript-page-setup.diff
blob71a4489c57de41630a7e42f3d83dceb544c7f66b
1 --- vcl/inc/vcl/printerjob.hxx
2 +++ vcl/inc/vcl/printerjob.hxx
3 @@ -99,7 +99,7 @@ private: // private methods
5 bool writeFeatureList( osl::File* pFile, const JobData&, bool bDocumentSetup );
6 bool writeSetup( osl::File* pFile, const JobData& );
7 - bool writePageSetup( osl::File* pFile, const JobData& );
8 + bool writePageSetup( osl::File* pFile, const JobData&, bool bWriteFeatures = true );
9 void writeJobPatch( osl::File* File, const JobData& );
10 bool writeProlog (osl::File* pFile, const JobData& );
12 --- vcl/unx/source/printergfx/printerjob.cxx
13 +++ vcl/unx/source/printergfx/printerjob.cxx
14 @@ -1047,14 +1047,6 @@ PrinterJob::StartPage (const JobData& rJ
15 if( ! (pPageHeader && pPageBody) )
16 return sal_False;
18 - /* #i7262# write setup only before first page
19 - * don't do this in StartJob since the jobsetup there may be
20 - * different.
21 - */
22 - bool bSuccess = true;
23 - if( 1 == maPageList.size() )
24 - m_aDocumentJobData = rJobSetup;
26 // write page header according to Document Structuring Conventions (DSC)
27 WritePS (pPageHeader, "%%Page: ");
28 WritePS (pPageHeader, aPageNo);
29 @@ -1077,13 +1069,25 @@ PrinterJob::StartPage (const JobData& rJ
31 WritePS (pPageHeader, pBBox);
33 - if (bSuccess)
34 - bSuccess = writePageSetup ( pPageHeader, rJobSetup );
35 - if(bSuccess)
36 - m_aLastJobData = rJobSetup;
37 + /* #i7262# #i65491# write setup only before first page
38 + * (to %%Begin(End)Setup, instead of %%Begin(End)PageSetup)
39 + * don't do this in StartJob since the jobsetup there may be
40 + * different.
41 + */
42 + bool bWriteFeatures = true;
43 + if( 1 == maPageList.size() )
44 + {
45 + m_aDocumentJobData = rJobSetup;
46 + bWriteFeatures = false;
47 + }
49 + if ( writePageSetup( pPageHeader, rJobSetup, bWriteFeatures ) )
50 + {
51 + m_aLastJobData = rJobSetup;
52 + return true;
53 + }
55 - return bSuccess;
56 + return false;
59 sal_Bool
60 @@ -1174,12 +1178,9 @@ bool PrinterJob::writeFeatureList( osl::
61 if( pKey->getSetupType() == PPDKey::DocumentSetup )
62 bEmit = true;
64 - else
65 - {
66 - if( pKey->getSetupType() == PPDKey::PageSetup ||
67 - pKey->getSetupType() == PPDKey::AnySetup )
68 - bEmit = true;
69 - }
70 + if( pKey->getSetupType() == PPDKey::PageSetup ||
71 + pKey->getSetupType() == PPDKey::AnySetup )
72 + bEmit = true;
73 if( bEmit )
75 const PPDValue* pValue = rJob.m_aContext.getValue( pKey );
76 @@ -1213,13 +1214,13 @@ bool PrinterJob::writeFeatureList( osl::
77 return bSuccess;
80 -bool PrinterJob::writePageSetup( osl::File* pFile, const JobData& rJob )
81 +bool PrinterJob::writePageSetup( osl::File* pFile, const JobData& rJob, bool bWriteFeatures )
83 bool bSuccess = true;
85 WritePS (pFile, "%%BeginPageSetup\n%\n");
87 - bSuccess = writeFeatureList( pFile, rJob, false );
88 + if ( bWriteFeatures )
89 + bSuccess = writeFeatureList( pFile, rJob, false );
90 WritePS (pFile, "%%EndPageSetup\n");
92 sal_Char pTranslate [128];