[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sfx2/source vcl/generic

Michael Stahl mstahl at redhat.com
Fri Feb 21 01:06:04 PST 2014


 sfx2/source/view/viewprn.cxx    |    1 +
 vcl/generic/print/genprnpsp.cxx |    8 +++++++-
 2 files changed, 8 insertions(+), 1 deletion(-)

New commits:
commit 9da8283de5c1327a30f9c8f5719a8454d1a0eab9
Author: Michael Stahl <mstahl at redhat.com>
Date:   Tue Feb 18 22:40:20 2014 +0100

    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 at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sfx2/source/view/viewprn.cxx b/sfx2/source/view/viewprn.cxx
index 12e5633..0c003ed 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 1f080a2..6b8c8ce 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 )


More information about the Libreoffice-commits mailing list