endSpool return value is effectively success flag, not job ID
Change-Id: I5b96eeff80ca29f0f8f24ee6da7a2ca76cbb05ce
This commit is contained in:
@@ -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;
|
||||
|
@@ -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;
|
||||
|
@@ -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
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
@@ -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 ));
|
||||
}
|
||||
|
Reference in New Issue
Block a user