[Libreoffice-commits] core.git: include/vcl vcl/generic vcl/inc vcl/null vcl/unx

Stephan Bergmann sbergman at redhat.com
Thu Jan 9 23:33:38 PST 2014


 include/vcl/printerinfomanager.hxx             |    4 ++--
 vcl/generic/print/printerjob.cxx               |    2 +-
 vcl/inc/cupsmgr.hxx                            |    2 +-
 vcl/null/printerinfomanager.cxx                |    2 +-
 vcl/unx/generic/printer/cupsmgr.cxx            |    4 ++--
 vcl/unx/generic/printer/printerinfomanager.cxx |    2 +-
 6 files changed, 8 insertions(+), 8 deletions(-)

New commits:
commit e6323214830895d1c76ec44ee53990bf577fbda2
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Jan 9 23:09:12 2014 +0100

    endSpool return value is effectively success flag, not job ID
    
    Change-Id: I5b96eeff80ca29f0f8f24ee6da7a2ca76cbb05ce

diff --git a/include/vcl/printerinfomanager.hxx b/include/vcl/printerinfomanager.hxx
index b431fad..d35e1fb 100644
--- a/include/vcl/printerinfomanager.hxx
+++ b/include/vcl/printerinfomanager.hxx
@@ -192,8 +192,8 @@ public:
     // close the FILE* returned by startSpool and does the actual spooling
     // set bBanner to "false" will attempt to suppress banner printing
     // set bBanner to "true" will rely on the system default
-    // returns a numerical job id
-    virtual int endSpool( const OUString& rPrinterName, const OUString& rJobTitle, FILE* pFile, const JobData& rDocumentJobData, bool bBanner );
+    // returns true on success
+    virtual bool endSpool( const OUString& rPrinterName, const OUString& rJobTitle, FILE* pFile, const JobData& rDocumentJobData, bool bBanner );
 
     // for spadmin: whether adding or removing a printer is possible
     virtual bool addOrRemovePossible() const;
diff --git a/vcl/generic/print/printerjob.cxx b/vcl/generic/print/printerjob.cxx
index 131c651..e18d769f 100644
--- a/vcl/generic/print/printerjob.cxx
+++ b/vcl/generic/print/printerjob.cxx
@@ -530,7 +530,7 @@ PrinterJob::EndJob ()
     else
     {
         PrinterInfoManager& rPrinterInfoManager = PrinterInfoManager::get();
-        if (0 == rPrinterInfoManager.endSpool( m_aLastJobData.m_aPrinterName,
+        if (!rPrinterInfoManager.endSpool( m_aLastJobData.m_aPrinterName,
             maJobTitle, pDestFILE, m_aDocumentJobData, true ))
         {
             bSuccess = sal_False;
diff --git a/vcl/inc/cupsmgr.hxx b/vcl/inc/cupsmgr.hxx
index a5f8a84..08711a3 100644
--- a/vcl/inc/cupsmgr.hxx
+++ b/vcl/inc/cupsmgr.hxx
@@ -77,7 +77,7 @@ public:
     const char* authenticateUser( const char* );
 
     virtual FILE* startSpool( const OUString& rPrinterName, bool bQuickCommand );
-    virtual int endSpool( const OUString& rPrinterName, const OUString& rJobTitle, FILE* pFile, const JobData& rDocumentJobData, bool bBanner );
+    virtual bool endSpool( const OUString& rPrinterName, const OUString& rJobTitle, FILE* pFile, const JobData& rDocumentJobData, bool bBanner );
     virtual void setupJobContextData( JobData& rData );
 
     /// changes the info about a named printer
diff --git a/vcl/null/printerinfomanager.cxx b/vcl/null/printerinfomanager.cxx
index cf0bad9..cc31c86 100644
--- a/vcl/null/printerinfomanager.cxx
+++ b/vcl/null/printerinfomanager.cxx
@@ -142,7 +142,7 @@ FILE* PrinterInfoManager::startSpool( const OUString& /* rPrintername */, bool /
     return NULL;
 }
 
-int PrinterInfoManager::endSpool( const OUString& /*rPrintername*/, const OUString& /*rJobTitle*/, FILE* /* pFile */, const JobData& /*rDocumentJobData*/, bool /*bBanner*/ )
+bool PrinterInfoManager::endSpool( const OUString& /*rPrintername*/, const OUString& /*rJobTitle*/, FILE* /* pFile */, const JobData& /*rDocumentJobData*/, bool /*bBanner*/ )
 {
     return true;
 }
diff --git a/vcl/unx/generic/printer/cupsmgr.cxx b/vcl/unx/generic/printer/cupsmgr.cxx
index 52b6bfb..0b32e06 100644
--- a/vcl/unx/generic/printer/cupsmgr.cxx
+++ b/vcl/unx/generic/printer/cupsmgr.cxx
@@ -638,7 +638,7 @@ void CUPSManager::getOptionsFromDocumentSetup( const JobData& rJob, bool bBanner
     }
 }
 
-int CUPSManager::endSpool( const OUString& rPrintername, const OUString& rJobTitle, FILE* pFile, const JobData& rDocumentJobData, bool bBanner )
+bool CUPSManager::endSpool( const OUString& rPrintername, const OUString& rJobTitle, FILE* pFile, const JobData& rDocumentJobData, bool bBanner )
 {
     OSL_TRACE( "endSpool: %s, %s, copy count = %d",
                OUStringToOString( rPrintername, RTL_TEXTENCODING_UTF8 ).getStr(),
@@ -697,7 +697,7 @@ int CUPSManager::endSpool( const OUString& rPrintername, const OUString& rJobTit
             cupsFreeOptions( nNumOptions, pOptions );
     }
 
-    return nJobID;
+    return nJobID != 0;
 }
 
 
diff --git a/vcl/unx/generic/printer/printerinfomanager.cxx b/vcl/unx/generic/printer/printerinfomanager.cxx
index 2f3cedd..5fe3dbb 100644
--- a/vcl/unx/generic/printer/printerinfomanager.cxx
+++ b/vcl/unx/generic/printer/printerinfomanager.cxx
@@ -966,7 +966,7 @@ FILE* PrinterInfoManager::startSpool( const OUString& rPrintername, bool bQuickC
     return popen (aShellCommand.getStr(), "w");
 }
 
-int PrinterInfoManager::endSpool( const OUString& /*rPrintername*/, const OUString& /*rJobTitle*/, FILE* pFile, const JobData& /*rDocumentJobData*/, bool /*bBanner*/ )
+bool PrinterInfoManager::endSpool( const OUString& /*rPrintername*/, const OUString& /*rJobTitle*/, FILE* pFile, const JobData& /*rDocumentJobData*/, bool /*bBanner*/ )
 {
     return (0 == pclose( pFile ));
 }


More information about the Libreoffice-commits mailing list