/[packages]/cauldron/libreoffice/current/SOURCES/0001-every-even-numbered-print-job-is-reported-as-failed.patch
ViewVC logotype

Contents of /cauldron/libreoffice/current/SOURCES/0001-every-even-numbered-print-job-is-reported-as-failed.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 618518 - (show annotations) (download)
Sun Apr 27 21:53:48 2014 UTC (9 years, 11 months ago) by tv
File size: 5539 byte(s)
- 4.2.4 rc1
- sync patches with FC
- install man pages
1 From 2dae70268e8f53b11301c4c8490efea57b0cc51c Mon Sep 17 00:00:00 2001
2 From: Stephan Bergmann <sbergman@redhat.com>
3 Date: Thu, 9 Jan 2014 23:09:12 +0100
4 Subject: [PATCH] every even numbered print job is reported as failed
5
6 because of.
7 bool bSuccess;
8 ...
9 bSuccess &= ...endSpool(...);
10
11 in PspSalPrinter::StartJob
12
13 was...
14
15 endSpool return value is effectively success flag, not job ID
16
17 (cherry picked from commit e6323214830895d1c76ec44ee53990bf577fbda2)
18
19 Change-Id: I5b96eeff80ca29f0f8f24ee6da7a2ca76cbb05ce
20 ---
21 include/vcl/printerinfomanager.hxx | 4 ++--
22 vcl/generic/print/printerjob.cxx | 2 +-
23 vcl/inc/cupsmgr.hxx | 2 +-
24 vcl/null/printerinfomanager.cxx | 2 +-
25 vcl/unx/generic/printer/cupsmgr.cxx | 4 ++--
26 vcl/unx/generic/printer/printerinfomanager.cxx | 2 +-
27 6 files changed, 8 insertions(+), 8 deletions(-)
28
29 diff --git a/include/vcl/printerinfomanager.hxx b/include/vcl/printerinfomanager.hxx
30 index 96e7846..7e3ccd6 100644
31 --- a/include/vcl/printerinfomanager.hxx
32 +++ b/include/vcl/printerinfomanager.hxx
33 @@ -211,8 +211,8 @@ public:
34 // close the FILE* returned by startSpool and does the actual spooling
35 // set bBanner to "false" will attempt to suppress banner printing
36 // set bBanner to "true" will rely on the system default
37 - // returns a numerical job id
38 - virtual int endSpool( const OUString& rPrinterName, const OUString& rJobTitle, FILE* pFile, const JobData& rDocumentJobData, bool bBanner );
39 + // returns true on success
40 + virtual bool endSpool( const OUString& rPrinterName, const OUString& rJobTitle, FILE* pFile, const JobData& rDocumentJobData, bool bBanner );
41
42 // for spadmin: whether adding or removing a printer is possible
43 virtual bool addOrRemovePossible() const;
44 diff --git a/vcl/generic/print/printerjob.cxx b/vcl/generic/print/printerjob.cxx
45 index 7c1b359..f611c26 100644
46 --- a/vcl/generic/print/printerjob.cxx
47 +++ b/vcl/generic/print/printerjob.cxx
48 @@ -530,7 +530,7 @@ PrinterJob::EndJob ()
49 else
50 {
51 PrinterInfoManager& rPrinterInfoManager = PrinterInfoManager::get();
52 - if (0 == rPrinterInfoManager.endSpool( m_aLastJobData.m_aPrinterName,
53 + if (!rPrinterInfoManager.endSpool( m_aLastJobData.m_aPrinterName,
54 maJobTitle, pDestFILE, m_aDocumentJobData, true ))
55 {
56 bSuccess = sal_False;
57 diff --git a/vcl/inc/cupsmgr.hxx b/vcl/inc/cupsmgr.hxx
58 index 8c659fe..a8c06bb 100644
59 --- a/vcl/inc/cupsmgr.hxx
60 +++ b/vcl/inc/cupsmgr.hxx
61 @@ -78,7 +78,7 @@ public:
62 const char* authenticateUser( const char* );
63
64 virtual FILE* startSpool( const OUString& rPrinterName, bool bQuickCommand );
65 - virtual int endSpool( const OUString& rPrinterName, const OUString& rJobTitle, FILE* pFile, const JobData& rDocumentJobData, bool bBanner );
66 + virtual bool endSpool( const OUString& rPrinterName, const OUString& rJobTitle, FILE* pFile, const JobData& rDocumentJobData, bool bBanner );
67 virtual void setupJobContextData( JobData& rData );
68
69 /// changes the info about a named printer
70 diff --git a/vcl/null/printerinfomanager.cxx b/vcl/null/printerinfomanager.cxx
71 index a480856..4845ec3 100644
72 --- a/vcl/null/printerinfomanager.cxx
73 +++ b/vcl/null/printerinfomanager.cxx
74 @@ -147,7 +147,7 @@ FILE* PrinterInfoManager::startSpool( const OUString& /* rPrintername */, bool /
75 return NULL;
76 }
77
78 -int PrinterInfoManager::endSpool( const OUString& /*rPrintername*/, const OUString& /*rJobTitle*/, FILE* /* pFile */, const JobData& /*rDocumentJobData*/, bool /*bBanner*/ )
79 +bool PrinterInfoManager::endSpool( const OUString& /*rPrintername*/, const OUString& /*rJobTitle*/, FILE* /* pFile */, const JobData& /*rDocumentJobData*/, bool /*bBanner*/ )
80 {
81 return true;
82 }
83 diff --git a/vcl/unx/generic/printer/cupsmgr.cxx b/vcl/unx/generic/printer/cupsmgr.cxx
84 index 069df7d..ecf44e7 100644
85 --- a/vcl/unx/generic/printer/cupsmgr.cxx
86 +++ b/vcl/unx/generic/printer/cupsmgr.cxx
87 @@ -640,7 +640,7 @@ void CUPSManager::getOptionsFromDocumentSetup( const JobData& rJob, bool bBanner
88 }
89 }
90
91 -int CUPSManager::endSpool( const OUString& rPrintername, const OUString& rJobTitle, FILE* pFile, const JobData& rDocumentJobData, bool bBanner )
92 +bool CUPSManager::endSpool( const OUString& rPrintername, const OUString& rJobTitle, FILE* pFile, const JobData& rDocumentJobData, bool bBanner )
93 {
94 OSL_TRACE( "endSpool: %s, %s, copy count = %d",
95 OUStringToOString( rPrintername, RTL_TEXTENCODING_UTF8 ).getStr(),
96 @@ -699,7 +699,7 @@ int CUPSManager::endSpool( const OUString& rPrintername, const OUString& rJobTit
97 cupsFreeOptions( nNumOptions, pOptions );
98 }
99
100 - return nJobID;
101 + return nJobID != 0;
102 }
103
104
105 diff --git a/vcl/unx/generic/printer/printerinfomanager.cxx b/vcl/unx/generic/printer/printerinfomanager.cxx
106 index 4f8f56e..45b9f62 100644
107 --- a/vcl/unx/generic/printer/printerinfomanager.cxx
108 +++ b/vcl/unx/generic/printer/printerinfomanager.cxx
109 @@ -1117,7 +1117,7 @@ FILE* PrinterInfoManager::startSpool( const OUString& rPrintername, bool bQuickC
110 return popen (aShellCommand.getStr(), "w");
111 }
112
113 -int PrinterInfoManager::endSpool( const OUString& /*rPrintername*/, const OUString& /*rJobTitle*/, FILE* pFile, const JobData& /*rDocumentJobData*/, bool /*bBanner*/ )
114 +bool PrinterInfoManager::endSpool( const OUString& /*rPrintername*/, const OUString& /*rJobTitle*/, FILE* pFile, const JobData& /*rDocumentJobData*/, bool /*bBanner*/ )
115 {
116 return (0 == pclose( pFile ));
117 }
118 --
119 1.9.0
120

  ViewVC Help
Powered by ViewVC 1.1.30