summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2014-02-18 22:40:20 +0100
committerCaolán McNamara <caolanm@redhat.com>2014-02-21 09:05:40 +0000
commit9da8283de5c1327a30f9c8f5719a8454d1a0eab9 (patch)
tree4cc988f3a90c9d88b46c32e067ab17b73c6decf3
parent3ba02e9ec03df980803f35c4b16ce8b8ce90cb66 (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 (cherry picked from commit cdb405f4e4b168d1e2f6dea9ac985df319a76015) Reviewed-on: https://gerrit.libreoffice.org/8115 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--sfx2/source/view/viewprn.cxx1
-rw-r--r--vcl/generic/print/genprnpsp.cxx8
2 files changed, 8 insertions, 1 deletions
diff --git a/sfx2/source/view/viewprn.cxx b/sfx2/source/view/viewprn.cxx
index 12e5633d3272..0c003ed31a7a 100644
--- a/sfx2/source/view/viewprn.cxx
+++ b/sfx2/source/view/viewprn.cxx
@@ -339,6 +339,7 @@ void SfxPrinterController::jobFinished( com::sun::star::view::PrintableState nSt
mpObjectShell->Broadcast( SfxPrintingHint( nState ) );
switch ( nState )
{
+ case view::PrintableState_JOB_SPOOLING_FAILED :
case view::PrintableState_JOB_FAILED :
{
// "real" problem (not simply printing cancelled by user)
diff --git a/vcl/generic/print/genprnpsp.cxx b/vcl/generic/print/genprnpsp.cxx
index 1f080a22d196..6b8c8ce62b6d 100644
--- a/vcl/generic/print/genprnpsp.cxx
+++ b/vcl/generic/print/genprnpsp.cxx
@@ -1231,6 +1231,8 @@ sal_Bool PspSalPrinter::StartJob( const OUString* i_pFileName, const OUString& i
}
}
+ bool bSuccess(true);
+
// spool files
if( ! i_pFileName && ! bAborted )
{
@@ -1273,6 +1275,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;
}
@@ -1283,7 +1286,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 )