summaryrefslogtreecommitdiff
path: root/vcl/unx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2013-01-09 12:44:09 +0000
committerMiklos Vajna <vmiklos@suse.cz>2013-01-10 09:02:14 +0000
commit4c93acdba9274f5571a01a7ed5738957d8ebb0cd (patch)
tree607269d319e7f7ea82f486de5b06e999684ce034 /vcl/unx
parentfe3bcdac912580607611475bfc3b0fa478a54ec1 (diff)
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) Reviewed-on: https://gerrit.libreoffice.org/1609 Reviewed-by: Miklos Vajna <vmiklos@suse.cz> Tested-by: Miklos Vajna <vmiklos@suse.cz>
Diffstat (limited to 'vcl/unx')
-rw-r--r--vcl/unx/generic/printer/jobdata.cxx8
1 files changed, 7 insertions, 1 deletions
diff --git a/vcl/unx/generic/printer/jobdata.cxx b/vcl/unx/generic/printer/jobdata.cxx
index 385ed02426ae..c55f64aad12f 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 @@ bool JobData::constructFromStreamBuffer( void* pData, int bytes, JobData& rJobDa
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)