[PATCH] Change in core[libreoffice-4-0]: Resolves: fdo#59131 resolve default backend on printer->setu...

Caolán McNamara (via_Code_Review) gerrit at gerrit.libreoffice.org
Wed Jan 9 04:58:29 PST 2013


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/1609

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/09/1609/1

Resolves: fdo#59131 resolve default backend on printer->setup

For setting permanent defaults via spadmin we don't want to resolve the
default backend on saving "default", this happens during the print
initialization stuff.

But when we tweak the printer settings for a single print job and reset back to
default, we need to resolve that to what backend we want

Change-Id: Iac2370624b6d248c9658fb0fbc2f2d449849d81a
(cherry picked from commit 9c4d77f22d58f5b500c95f65a431628a8d8d6e6e)
---
M vcl/generic/print/genprnpsp.cxx
M vcl/inc/vcl/jobdata.hxx
M vcl/unx/generic/printer/jobdata.cxx
3 files changed, 10 insertions(+), 2 deletions(-)



diff --git a/vcl/generic/print/genprnpsp.cxx b/vcl/generic/print/genprnpsp.cxx
index 9949eae..6800e01 100644
--- a/vcl/generic/print/genprnpsp.cxx
+++ b/vcl/generic/print/genprnpsp.cxx
@@ -584,6 +584,7 @@
 
     if( pSetupFunction( aInfo ) )
     {
+        aInfo.resolveDefaultBackend();
         rtl_freeMemory( pJobSetup->mpDriverData );
         pJobSetup->mpDriverData = NULL;
 
diff --git a/vcl/inc/vcl/jobdata.hxx b/vcl/inc/vcl/jobdata.hxx
index 577e0fa..3f81877 100644
--- a/vcl/inc/vcl/jobdata.hxx
+++ b/vcl/inc/vcl/jobdata.hxx
@@ -68,7 +68,8 @@
     void setCollate( bool bCollate );
     bool setPaper( int nWidth, int nHeight ); // dimensions in pt
     bool setPaperBin( int nPaperBin ); // dimensions in pt
-    void setDefaultBackend( bool bUsePDF );
+    void resolveDefaultBackend();
+    void setDefaultBackend(bool bUsePDF);
 
     // creates a new buffer using new
     // it is up to the user to delete it again
diff --git a/vcl/unx/generic/printer/jobdata.cxx b/vcl/unx/generic/printer/jobdata.cxx
index 385ed02..c55f64a 100644
--- a/vcl/unx/generic/printer/jobdata.cxx
+++ b/vcl/unx/generic/printer/jobdata.cxx
@@ -18,9 +18,9 @@
  */
 
 
+#include <officecfg/Office/Common.hxx>
 #include "vcl/jobdata.hxx"
 #include "vcl/printerinfomanager.hxx"
-
 #include "tools/stream.hxx"
 
 #include <sal/alloca.h>
@@ -269,6 +269,12 @@
     return bVersion && bPrinter && bOrientation && bCopies && bContext && bMargin && bPSLevel && bPDFDevice && bColorDevice && bColorDepth;
 }
 
+void JobData::resolveDefaultBackend()
+{
+    if (m_nPSLevel == 0 && m_nPDFDevice == 0)
+        setDefaultBackend(officecfg::Office::Common::Print::Option::Printer::PDFAsStandardPrintJobFormat::get());
+}
+
 void JobData::setDefaultBackend(bool bUsePDF)
 {
     if (bUsePDF && m_nPSLevel == 0 && m_nPDFDevice == 0)

-- 
To view, visit https://gerrit.libreoffice.org/1609
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iac2370624b6d248c9658fb0fbc2f2d449849d81a
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: libreoffice-4-0
Gerrit-Owner: Caolán McNamara <caolanm at redhat.com>



More information about the LibreOffice mailing list