diff options
author | Michael Stahl <mstahl@redhat.com> | 2014-02-18 22:40:20 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2014-02-18 22:57:25 +0100 |
commit | cdb405f4e4b168d1e2f6dea9ac985df319a76015 (patch) | |
tree | 56ea749cce698f7402d90cc8fe33da27cf22ee72 /vcl/generic | |
parent | 677855e67c0ebd4f695950dfadb2ef36718efe45 (diff) |
vcl: CUPS printing: notify user if spooling failed
CUPS does not accept jobs for a printer that has been stopped; pop up
an error message in this case instead of silently ignoring failure.
Change-Id: I1bc9120c9c9f438e350c964ed7ef29924a72ce78
Diffstat (limited to 'vcl/generic')
-rw-r--r-- | vcl/generic/print/genprnpsp.cxx | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/vcl/generic/print/genprnpsp.cxx b/vcl/generic/print/genprnpsp.cxx index fca730d4ad4a..1b8d0bd45f3e 100644 --- a/vcl/generic/print/genprnpsp.cxx +++ b/vcl/generic/print/genprnpsp.cxx @@ -1218,6 +1218,8 @@ sal_Bool PspSalPrinter::StartJob( const OUString* i_pFileName, const OUString& i } } + bool bSuccess(true); + // spool files if( ! i_pFileName && ! bAborted ) { @@ -1260,6 +1262,7 @@ sal_Bool PspSalPrinter::StartJob( const OUString* i_pFileName, const OUString& i aBuf.append( ' ' ); aBuf.append( sal_Int32( i + nCurJob * aPDFFiles.size() ) ); } + bSuccess &= PrinterInfoManager::get().endSpool( pPrinter->GetName(), aBuf.makeStringAndClear(), fp, m_aJobData, bFirstJob ); bFirstJob = false; } @@ -1270,7 +1273,10 @@ sal_Bool PspSalPrinter::StartJob( const OUString* i_pFileName, const OUString& i } // job has been spooled - i_rController.setJobState( bAborted ? view::PrintableState_JOB_ABORTED : view::PrintableState_JOB_SPOOLED ); + i_rController.setJobState( (bAborted) + ? view::PrintableState_JOB_ABORTED + : ((bSuccess) ? view::PrintableState_JOB_SPOOLED + : view::PrintableState_JOB_SPOOLING_FAILED)); // clean up the temporary PDF files if( ! i_pFileName || bAborted ) |