[Libreoffice-commits] core.git: 7 commits - include/vcl padmin/source padmin/uiconfig sfx2/source solenv/gbuild vcl/generic vcl/unx

Michael Stahl mstahl at redhat.com
Tue Feb 18 23:17:57 CET 2014


 include/vcl/jobdata.hxx                       |    2 
 padmin/source/prtsetup.cxx                    |    4 -
 padmin/uiconfig/ui/printerpropertiesdialog.ui |   14 ---
 sfx2/source/view/viewprn.cxx                  |    1 
 solenv/gbuild/gbuild.help.txt                 |    2 
 solenv/gbuild/gbuild.mk                       |    2 
 solenv/gbuild/platform/macosx.mk              |    2 
 solenv/gbuild/platform/solaris.mk             |    2 
 solenv/gbuild/platform/unxgcc.mk              |    2 
 vcl/generic/print/genprnpsp.cxx               |   21 ++---
 vcl/unx/generic/printer/cupsmgr.cxx           |  101 ++++++++------------------
 vcl/unx/generic/printer/jobdata.cxx           |   18 ++++
 12 files changed, 71 insertions(+), 100 deletions(-)

New commits:
commit cdb405f4e4b168d1e2f6dea9ac985df319a76015
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

diff --git a/sfx2/source/view/viewprn.cxx b/sfx2/source/view/viewprn.cxx
index c7bb3fc..ea0eae4 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 fca730d..1b8d0bd 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 )
commit 677855e67c0ebd4f695950dfadb2ef36718efe45
Author: Michael Stahl <mstahl at redhat.com>
Date:   Tue Feb 18 21:51:52 2014 +0100

    padmin: make Printer Properties Device tab usable again
    
    The code of the "Font Replacement" tab was removed in
    6230cdd2d8971147dcb629c8bd61daa1fefcb7c7 but the tab was not removed
    from printerpropertiesdialog.ui; for some reason this orphan tab causes
    it to actually be visible in the UI and also enormous delays when painting
    the preceding Device tab's content.
    
    Change-Id: I95e1b29403307b86aea48518bbadea62aaba3b56

diff --git a/padmin/uiconfig/ui/printerpropertiesdialog.ui b/padmin/uiconfig/ui/printerpropertiesdialog.ui
index 345485d..b84184a 100644
--- a/padmin/uiconfig/ui/printerpropertiesdialog.ui
+++ b/padmin/uiconfig/ui/printerpropertiesdialog.ui
@@ -104,20 +104,6 @@
               <placeholder/>
             </child>
             <child type="tab">
-              <object class="GtkLabel" id="font">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="label" translatable="yes">Font Replacement</property>
-              </object>
-              <packing>
-                <property name="position">3</property>
-                <property name="tab_fill">False</property>
-              </packing>
-            </child>
-            <child>
-              <placeholder/>
-            </child>
-            <child type="tab">
               <object class="GtkLabel" id="other">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
commit c76cd71fe9bdefaef3f33f8ca193c32e3ab112ed
Author: Michael Stahl <mstahl at redhat.com>
Date:   Tue Feb 18 18:07:37 2014 +0100

    fdo#41524: CUPS printing: use "collate" option when PDF is available
    
    Assume that the CUPS printer is able to handle collating by itself,
    don't send multiple print jobs (except if user clicks on "Create single
    print jobs for collated output" of course...).
    
    To enable collating with PDF based printers, add the "collate" option;
    legacy PS based printers still get the weird stuff read from the PPD
    (not sure what the risks of changing that are).
    
    Change-Id: Ia12dc69f9083bba94f2ed633ecbd153aac7e40ab

diff --git a/include/vcl/jobdata.hxx b/include/vcl/jobdata.hxx
index 22ef0ee..8cffdd1 100644
--- a/include/vcl/jobdata.hxx
+++ b/include/vcl/jobdata.hxx
@@ -34,6 +34,7 @@ enum type {
 struct VCL_DLLPUBLIC JobData
 {
     int                     m_nCopies;
+    bool                    m_bCollate;
     int                     m_nLeftMarginAdjust;
     int                     m_nRightMarginAdjust;
     int                     m_nTopMarginAdjust;
@@ -50,6 +51,7 @@ struct VCL_DLLPUBLIC JobData
 
     JobData() :
             m_nCopies( 1 ),
+            m_bCollate(false),
             m_nLeftMarginAdjust( 0 ),
             m_nRightMarginAdjust( 0 ),
             m_nTopMarginAdjust( 0 ),
diff --git a/vcl/generic/print/genprnpsp.cxx b/vcl/generic/print/genprnpsp.cxx
index bf38ef0..fca730d 100644
--- a/vcl/generic/print/genprnpsp.cxx
+++ b/vcl/generic/print/genprnpsp.cxx
@@ -808,16 +808,9 @@ sal_uLong PspSalInfoPrinter::GetCapabilities( const ImplJobSetup* pJobSetup, sal
             return 0xffff;
         case PRINTER_CAPABILITIES_COLLATECOPIES:
         {
-            // see if the PPD contains a value to set Collate to True
-            JobData aData;
-            JobData::constructFromStreamBuffer( pJobSetup->mpDriverData, pJobSetup->mnDriverDataLen, aData );
-
-            const PPDKey* pKey = aData.m_pParser ? aData.m_pParser->getKey( OUString("Collate") ) : NULL;
-            const PPDValue* pVal = pKey ? pKey->getValue(OUString("True")) : NULL;
-
             // PPDs don't mention the number of possible collated copies.
             // so let's guess as many as we want ?
-            return pVal ? 0xffff : 0;
+            return 0xffff;
         }
         case PRINTER_CAPABILITIES_SETORIENTATION:
             return 1;
@@ -836,7 +829,7 @@ sal_uLong PspSalInfoPrinter::GetCapabilities( const ImplJobSetup* pJobSetup, sal
                 return 1;
             else
             {
-                // see if the PPD contains a value to set Collate to True
+                // see if the PPD contains a value to set PDF device
                 JobData aData = PrinterInfoManager::get().getPrinterInfo( pJobSetup->maPrinterName );
                 if( pJobSetup->mpDriverData )
                     JobData::constructFromStreamBuffer( pJobSetup->mpDriverData, pJobSetup->mnDriverDataLen, aData );
@@ -846,7 +839,7 @@ sal_uLong PspSalInfoPrinter::GetCapabilities( const ImplJobSetup* pJobSetup, sal
             return PrinterInfoManager::get().checkFeatureToken( pJobSetup->maPrinterName, "external_dialog" ) ? 1 : 0;
         case PRINTER_CAPABILITIES_USEPULLMODEL:
         {
-            // see if the PPD contains a value to set Collate to True
+            // see if the PPD contains a value to set PDF device
             JobData aData = PrinterInfoManager::get().getPrinterInfo( pJobSetup->maPrinterName );
             if( pJobSetup->mpDriverData )
                 JobData::constructFromStreamBuffer( pJobSetup->mpDriverData, pJobSetup->mnDriverDataLen, aData );
diff --git a/vcl/unx/generic/printer/cupsmgr.cxx b/vcl/unx/generic/printer/cupsmgr.cxx
index 75c45ab..2cfcbaa 100644
--- a/vcl/unx/generic/printer/cupsmgr.cxx
+++ b/vcl/unx/generic/printer/cupsmgr.cxx
@@ -603,6 +603,8 @@ void CUPSManager::getOptionsFromDocumentSetup( const JobData& rJob, bool bBanner
     {
         OString aVal( OString::number( rJob.m_nCopies ) );
         rNumOptions = cupsAddOption( "copies", aVal.getStr(), rNumOptions, (cups_option_t**)rOptions );
+        aVal = OString::boolean(rJob.m_bCollate);
+        rNumOptions = cupsAddOption( "collate", aVal.getStr(), rNumOptions, (cups_option_t**)rOptions );
     }
     if( ! bBanner )
     {
diff --git a/vcl/unx/generic/printer/jobdata.cxx b/vcl/unx/generic/printer/jobdata.cxx
index 9b9e9ec..f9a9d3f 100644
--- a/vcl/unx/generic/printer/jobdata.cxx
+++ b/vcl/unx/generic/printer/jobdata.cxx
@@ -31,6 +31,7 @@ using namespace psp;
 JobData& JobData::operator=(const JobData& rRight)
 {
     m_nCopies               = rRight.m_nCopies;
+    m_bCollate              = rRight.m_bCollate;
     m_nLeftMarginAdjust     = rRight.m_nLeftMarginAdjust;
     m_nRightMarginAdjust    = rRight.m_nRightMarginAdjust;
     m_nTopMarginAdjust      = rRight.m_nTopMarginAdjust;
@@ -54,6 +55,11 @@ JobData& JobData::operator=(const JobData& rRight)
 
 void JobData::setCollate( bool bCollate )
 {
+    if (m_nPDFDevice > 0)
+    {
+        m_bCollate = bCollate;
+        return;
+    }
     const PPDParser* pParser = m_aContext.getParser();
     if( pParser )
     {
@@ -133,6 +139,13 @@ bool JobData::getStreamBuffer( void*& pData, int& bytes )
     aLine.append(static_cast<sal_Int32>(m_nCopies));
     aStream.WriteLine(aLine.makeStringAndClear());
 
+    if (m_nPDFDevice > 0)
+    {
+        aLine.append("collate=");
+        aLine.append(OString::boolean(m_bCollate));
+        aStream.WriteLine(aLine.makeStringAndClear());
+    }
+
     aLine.append("margindajustment=");
     aLine.append(static_cast<sal_Int32>(m_nLeftMarginAdjust));
     aLine.append(',');
@@ -191,6 +204,7 @@ bool JobData::constructFromStreamBuffer( void* pData, int bytes, JobData& rJobDa
     const char printerEquals[] = "printer=";
     const char orientatationEquals[] = "orientation=";
     const char copiesEquals[] = "copies=";
+    const char collateEquals[] = "collate=";
     const char margindajustmentEquals[] = "margindajustment=";
     const char colordepthEquals[] = "colordepth=";
     const char colordeviceEquals[] = "colordevice=";
@@ -217,6 +231,10 @@ bool JobData::constructFromStreamBuffer( void* pData, int bytes, JobData& rJobDa
             bCopies = true;
             rJobData.m_nCopies = aLine.copy(RTL_CONSTASCII_LENGTH(copiesEquals)).toInt32();
         }
+        else if (aLine.startsWith(collateEquals))
+        {
+            rJobData.m_bCollate = aLine.copy(RTL_CONSTASCII_LENGTH(collateEquals)).toInt32();
+        }
         else if (aLine.startsWith(margindajustmentEquals))
         {
             bMargin = true;
commit 6058a238fceba2e856e0f52c0438a480cb7cb59f
Author: Michael Stahl <mstahl at redhat.com>
Date:   Tue Feb 18 17:52:08 2014 +0100

    padmin: fix assert on opening Properties of "Generic Printer"
    
    The default printer is special and allowed to be entirely sitting on the
    PDF/PS fence.
    
    Change-Id: I32a18cd0e4ed4c338c0be30928bedf26888a99cd

diff --git a/padmin/source/prtsetup.cxx b/padmin/source/prtsetup.cxx
index 1b59ffc..952a11b 100644
--- a/padmin/source/prtsetup.cxx
+++ b/padmin/source/prtsetup.cxx
@@ -354,7 +354,9 @@ RTSDevicePage::RTSDevicePage( RTSDialog* pParent )
 
     bool bAutoIsPDF = officecfg::Office::Common::Print::Option::Printer::PDFAsStandardPrintJobFormat::get();
 
-    assert(nLevelEntryData != 0 || int(bAutoIsPDF) == m_pParent->m_aJobData.m_nPDFDevice);
+    assert(nLevelEntryData != 0
+            || "Generic Printer" == m_pParent->m_aJobData.m_aPrinterName
+            || int(bAutoIsPDF) == m_pParent->m_aJobData.m_nPDFDevice);
 
     OUString sStr = m_pLevelBox->GetEntry(0);
     m_pLevelBox->InsertEntry(sStr.replaceAll("%s", bAutoIsPDF ? m_pLevelBox->GetEntry(5) : m_pLevelBox->GetEntry(1)), 0);
commit 1970bf0466e93412a157b6849ec96245856743ac
Author: Michael Stahl <mstahl at redhat.com>
Date:   Tue Feb 18 17:48:55 2014 +0100

    gbuild: "make debugrun" starting instdir/program/soffice with ...
    
    ... UserInstallation in test-install/ does not make sense.
    It already has this: instdir/program/bootstraprc:UserInstallation=$ORIGIN/..
    
    Change-Id: I0d5e952876b80661375cc5ca6f8fbf44539bc83f

diff --git a/solenv/gbuild/gbuild.help.txt b/solenv/gbuild/gbuild.help.txt
index d8fd15e..49cb90d 100644
--- a/solenv/gbuild/gbuild.help.txt
+++ b/solenv/gbuild/gbuild.help.txt
@@ -34,7 +34,7 @@ AVAILABLE TARGETS
        subsequentcheck  run system tests (requires full installation)
        check            run unit tests and if in toplevel subsequentcheck
        clean            remove all generated files
-       debugrun         starts the dev-install instance and allows tests to be run
+       debugrun         starts the INSTDIR instance and allows tests to be run
                         against it
        <module>         build the named module
        <module>.check   run unittests of the named module
diff --git a/solenv/gbuild/gbuild.mk b/solenv/gbuild/gbuild.mk
index 3d6b0f6..8c0f8b4 100644
--- a/solenv/gbuild/gbuild.mk
+++ b/solenv/gbuild/gbuild.mk
@@ -257,8 +257,6 @@ gb_GLOBALDEFS += \
 
 gb_GLOBALDEFS := $(sort $(gb_GLOBALDEFS))
 
-gb_USER_INSTALLATION = $(call gb_Helper_make_url,$(TESTINSTALLDIR)/)
-
 include $(GBUILDDIR)/Deliver.mk
 
 $(eval $(call gb_Deliver_init))
diff --git a/solenv/gbuild/platform/macosx.mk b/solenv/gbuild/platform/macosx.mk
index 211be4c..96624b8 100644
--- a/solenv/gbuild/platform/macosx.mk
+++ b/solenv/gbuild/platform/macosx.mk
@@ -318,7 +318,7 @@ gb_PythonTest_PRECOMMAND := $(gb_PythonTest_PRECOMMAND):$(WORKDIR)/UnpackedTarba
 
 define gb_Module_DEBUGRUNCOMMAND
 OFFICESCRIPT=$$($(gb_MKTEMP)) && \
-printf '%s\n' "set args --norestore --nologo '--accept=pipe,name=$(USER);urp;' -env:UserInstallation=$(gb_USER_INSTALLATION)" > $${OFFICESCRIPT} && \
+printf '%s\n' "set args --norestore --nologo '--accept=pipe,name=$(USER);urp;'" > $${OFFICESCRIPT} && \
 gdb -x $${OFFICESCRIPT} $(INSTROOT)/$(LIBO_BIN_FOLDER)/soffice && \
 rm $${OFFICESCRIPT}
 endef
diff --git a/solenv/gbuild/platform/solaris.mk b/solenv/gbuild/platform/solaris.mk
index c8254f6..68e5020 100644
--- a/solenv/gbuild/platform/solaris.mk
+++ b/solenv/gbuild/platform/solaris.mk
@@ -340,7 +340,7 @@ define gb_Module_DEBUGRUNCOMMAND
 OFFICESCRIPT=`mktemp` && \
 printf ". $(INSTROOT)/program/ooenv\\n" > $${OFFICESCRIPT} && \
 printf "gdb --tui $(INSTROOT)/$(LIBO_BIN_FOLDER)/soffice.bin" >> $${OFFICESCRIPT} && \
-printf " -ex \"set args --norestore --nologo '--accept=pipe,name=$(USER);urp;' -env:UserInstallation=$(gb_USER_INSTALLATION)\"" >> $${OFFICESCRIPT} && \
+printf " -ex \"set args --norestore --nologo '--accept=pipe,name=$(USER);urp;' \"" >> $${OFFICESCRIPT} && \
 printf " -ex \"r\"\\n" >> $${OFFICESCRIPT} && \
 $(SHELL) $${OFFICESCRIPT} && \
 rm $${OFFICESCRIPT}
diff --git a/solenv/gbuild/platform/unxgcc.mk b/solenv/gbuild/platform/unxgcc.mk
index c743dcb..20a84e4 100644
--- a/solenv/gbuild/platform/unxgcc.mk
+++ b/solenv/gbuild/platform/unxgcc.mk
@@ -338,7 +338,7 @@ define gb_Module_DEBUGRUNCOMMAND
 OFFICESCRIPT=`mktemp` && \
 printf 'if [ -e $(INSTROOT)/program/ooenv ]; then . $(INSTROOT)/program/ooenv; fi\n' > $${OFFICESCRIPT} && \
 printf "gdb $(INSTROOT)/$(LIBO_BIN_FOLDER)/soffice.bin" >> $${OFFICESCRIPT} && \
-printf " -ex \"set args --norestore --nologo '--accept=pipe,name=$(USER);urp;' -env:UserInstallation=$(gb_USER_INSTALLATION)\"" >> $${OFFICESCRIPT} && \
+printf " -ex \"set args --norestore --nologo '--accept=pipe,name=$(USER);urp;' \"" >> $${OFFICESCRIPT} && \
 $(SHELL) $${OFFICESCRIPT} && \
 rm $${OFFICESCRIPT}
 endef
commit 39bdc8cef6ff0e77534ca9401951594415381213
Author: Michael Stahl <mstahl at redhat.com>
Date:   Tue Feb 18 15:24:29 2014 +0100

    vcl: convert some printfs to SAL_INFO
    
    Change-Id: I0c0ec5242160333a47a4a459c7be5c0a25079f44

diff --git a/vcl/unx/generic/printer/cupsmgr.cxx b/vcl/unx/generic/printer/cupsmgr.cxx
index 0b32e06..75c45ab 100644
--- a/vcl/unx/generic/printer/cupsmgr.cxx
+++ b/vcl/unx/generic/printer/cupsmgr.cxx
@@ -93,9 +93,8 @@ struct GetPPDAttribs
         if (m_aCondition.wait( pDelay ) != Condition::result_ok
             )
         {
-            #if OSL_DEBUG_LEVEL > 1
-            fprintf( stderr, "cupsGetPPD %s timed out\n", m_aParameter.getStr() );
-            #endif
+            SAL_WARN("vcl.unx.print",
+                    "cupsGetPPD " << m_aParameter << " timed out");
         }
         m_pSyncMutex->acquire();
 
@@ -206,9 +205,7 @@ void CUPSManager::runDestThread( void* pThis )
 
 void CUPSManager::runDests()
 {
-#if OSL_DEBUG_LEVEL > 1
-    fprintf( stderr, "starting cupsGetDests\n" );
-#endif
+    SAL_INFO("vcl.unx.print", "starting cupsGetDests");
     cups_dest_t* pDests = NULL;
 
     // n#722902 - do a fast-failing check for cups working *at all* first
@@ -222,17 +219,13 @@ void CUPSManager::runDests()
         httpClose(p_http);
 
         int nDests = cupsGetDests( &pDests );
-#if OSL_DEBUG_LEVEL > 1
-        fprintf( stderr, "came out of cupsGetDests\n" );
-#endif
+        SAL_INFO("vcl.unx.print", "came out of cupsGetDests");
 
         osl::MutexGuard aGuard( m_aCUPSMutex );
         m_nDests = nDests;
         m_pDests = pDests;
         m_bNewDests = true;
-#if OSL_DEBUG_LEVEL > 1
-        fprintf( stderr, "finished cupsGetDests\n" );
-#endif
+        SAL_INFO("vcl.unx.print", "finished cupsGetDests");
     }
 }
 
@@ -397,25 +390,17 @@ static void updatePrinterContextInfo( ppd_group_t* pPPDGroup, PPDContext& rConte
                         if( pValue != pKey->getDefaultValue() )
                         {
                             rContext.setValue( pKey, pValue, true );
-#if OSL_DEBUG_LEVEL > 1
-                            fprintf( stderr, "key %s is set to %s\n", pOption->keyword, pChoice->choice );
-#endif
+                            SAL_INFO("vcl.unx.print", "key " << pOption->keyword << " is set to " << pChoice->choice);
 
                         }
-#if OSL_DEBUG_LEVEL > 1
                         else
-                            fprintf( stderr, "key %s is defaulted to %s\n", pOption->keyword, pChoice->choice );
-#endif
+                            SAL_INFO("vcl.unx.print", "key " << pOption->keyword << " is defaulted to " << pChoice->choice);
                     }
-#if OSL_DEBUG_LEVEL > 1
                     else
-                        fprintf( stderr, "caution: value %s not found in key %s\n", pChoice->choice, pOption->keyword );
-#endif
+                        SAL_INFO("vcl.unx.print", "caution: value " << pChoice->choice << " not found in key " << pOption->keyword);
                 }
-#if OSL_DEBUG_LEVEL > 1
                 else
-                    fprintf( stderr, "caution: key %s not found in parser\n", pOption->keyword );
-#endif
+                    SAL_INFO("vcl.unx.print", "caution: key " << pOption->keyword << " not found in parser");
             }
         }
     }
@@ -447,9 +432,8 @@ const PPDParser* CUPSManager::createCUPSParser( const OUString& rPrinter )
             {
                 cups_dest_t* pDest = ((cups_dest_t*)m_pDests) + dest_it->second;
                 OString aPPDFile = threadedCupsGetPPD( pDest->name );
-                #if OSL_DEBUG_LEVEL > 1
-                fprintf( stderr, "PPD for %s is %s\n", OUStringToOString( aPrinter, osl_getThreadTextEncoding() ).getStr(), aPPDFile.getStr() );
-                #endif
+                SAL_INFO("vcl.unx.print",
+                        "PPD for " << aPrinter << " is " << aPPDFile);
                 if( !aPPDFile.isEmpty() )
                 {
                     rtl_TextEncoding aEncoding = osl_getThreadTextEncoding();
@@ -464,14 +448,11 @@ const PPDParser* CUPSManager::createCUPSParser( const OUString& rPrinter )
                         pNewParser = pCUPSParser;
 
                         /*int nConflicts =*/ cupsMarkOptions( pPPD, pDest->num_options, pDest->options );
-                        #if OSL_DEBUG_LEVEL > 1
-                        fprintf( stderr, "processing the following options for printer %s (instance %s):\n",
-                        pDest->name, pDest->instance );
+                        SAL_INFO("vcl.unx.print", "processing the following options for printer " << pDest->name << " (instance " << pDest->instance << "):");
                         for( int k = 0; k < pDest->num_options; k++ )
-                            fprintf( stderr, "   \"%s\" = \"%s\"\n",
-                        pDest->options[k].name,
-                        pDest->options[k].value );
-                        #endif
+                            SAL_INFO("vcl.unx.print",
+                                "   \"" << pDest->options[k].name <<
+                                "\" = \"" << pDest->options[k].value << "\"");
                         PrinterInfo& rInfo = m_aPrinters[ aPrinter ].m_aInfo;
 
                         // remember the default context for later use
@@ -489,30 +470,22 @@ const PPDParser* CUPSManager::createCUPSParser( const OUString& rPrinter )
                         // clean up the mess
                         ppdClose( pPPD );
                     }
-                    #if OSL_DEBUG_LEVEL > 1
                     else
-                        fprintf( stderr, "ppdOpenFile failed, falling back to generic driver\n" );
-                    #endif
+                        SAL_INFO("vcl.unx.print", "ppdOpenFile failed, falling back to generic driver");
 
                     // remove temporary PPD file
                     unlink( aPPDFile.getStr() );
                 }
-                #if OSL_DEBUG_LEVEL > 1
                 else
-                    fprintf( stderr, "cupsGetPPD failed, falling back to generic driver\n" );
-                #endif
+                    SAL_INFO("vcl.unx.print", "cupsGetPPD failed, falling back to generic driver");
             }
-            #if OSL_DEBUG_LEVEL > 1
             else
-                fprintf( stderr, "no dest found for printer %s\n", OUStringToOString( aPrinter, osl_getThreadTextEncoding() ).getStr() );
-            #endif
+                SAL_INFO("vcl.unx.print", "no dest found for printer " << aPrinter);
         }
         m_aCUPSMutex.release();
     }
-    #if OSL_DEBUG_LEVEL >1
     else
-        fprintf( stderr, "could not acquire CUPS mutex !!!\n" );
-    #endif
+        SAL_WARN("vcl.unx.print", "could not acquire CUPS mutex !!!" );
 
     if( ! pNewParser )
     {
@@ -540,9 +513,8 @@ void CUPSManager::setupJobContextData( JobData& rData )
         m_aPrinters.find( rData.m_aPrinterName );
     if( p_it == m_aPrinters.end() ) // huh ?
     {
-#if OSL_DEBUG_LEVEL > 1
-        fprintf( stderr, "CUPS printer list in disorder, no dest for printer %s !\n", OUStringToOString( rData.m_aPrinterName, osl_getThreadTextEncoding() ).getStr() );
-#endif
+        SAL_WARN("vcl.unx.print", "CUPS printer list in disorder, "
+                "no dest for printer " << rData.m_aPrinterName);
         return;
     }
 
@@ -674,17 +646,13 @@ bool CUPSManager::endSpool( const OUString& rPrintername, const OUString& rJobTi
         it->second.getStr(),
         OUStringToOString( rJobTitle, aEnc ).getStr(),
         nNumOptions, pOptions );
-#if OSL_DEBUG_LEVEL > 1
-        fprintf( stderr, "cupsPrintFile( %s, %s, %s, %d, %p ) returns %d\n",
-                    pDest->name,
-                    it->second.getStr(),
-                    OUStringToOString( rJobTitle, aEnc ).getStr(),
-                    nNumOptions,
-                    pOptions,
-                    nJobID
-                    );
+        SAL_INFO("vcl.unx.print", "cupsPrintFile( " << pDest->name << ", "
+                << it->second << ", " << rJobTitle << ", " << nNumOptions
+                << ", " << pOptions << " ) returns " << nJobID);
         for( int n = 0; n < nNumOptions; n++ )
-            fprintf( stderr, "    option %s=%s\n", pOptions[n].name, pOptions[n].value );
+            SAL_INFO("vcl.unx.print",
+                "    option " << pOptions[n].name << "=" << pOptions[n].value);
+#if OSL_DEBUG_LEVEL > 1
         OString aCmd( "cp " );
         aCmd = aCmd + it->second;
         aCmd = aCmd + OString( " $HOME/cupsprint.ps" );
@@ -714,15 +682,11 @@ bool CUPSManager::checkPrintersChanged( bool bWait )
         if(  m_aDestThread )
         {
             // initial asynchronous detection still running
-            #if OSL_DEBUG_LEVEL > 1
-            fprintf( stderr, "syncing cups discovery thread\n" );
-            #endif
+            SAL_INFO("vcl.unx.print", "syncing cups discovery thread");
             osl_joinWithThread( m_aDestThread );
             osl_destroyThread( m_aDestThread );
             m_aDestThread = NULL;
-            #if OSL_DEBUG_LEVEL > 1
-            fprintf( stderr, "done: syncing cups discovery thread\n" );
-            #endif
+            SAL_INFO("vcl.unx.print", "done: syncing cups discovery thread");
         }
         else
         {
@@ -886,12 +850,11 @@ const char* CUPSManager::authenticateUser( const char* /*pIn*/ )
         }
         osl_unloadModule( pLib );
     }
-#if OSL_DEBUG_LEVEL > 1
     else
     {
-        fprintf( stderr, "loading of module %s failed\n", _XSALSET_LIBNAME );
+        SAL_WARN("vcl.unx.print",
+            "loading of module " << _XSALSET_LIBNAME << " failed\n");
     }
-#endif
 
     return pRet;
 }
commit a67f3f73248f998764bea46292118aa2c9886c11
Author: Michael Stahl <mstahl at redhat.com>
Date:   Tue Feb 18 14:09:43 2014 +0100

    chmod spadmin script executable
    
    Change-Id: I008be78b41a20924c1dabe291157ef9633282fe6

diff --git a/padmin/source/spadmin.sh b/padmin/source/spadmin.sh
old mode 100644
new mode 100755


More information about the Libreoffice-commits mailing list