summaryrefslogtreecommitdiff
path: root/vcl/unx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2012-11-29 11:50:54 +0000
committerCaolán McNamara <caolanm@redhat.com>2012-11-29 14:40:45 +0000
commit59b98580bfd70205a9ebdb0ba67e74225d875b43 (patch)
tree49ae5fefb8e5df4fdcce26f77740fc0fef70cdc5 /vcl/unx
parent7e1b156a4103bbb6d1dc110ffac53528c00b5dd2 (diff)
Resolves: fdo#44664 Provide a way to set the default print job format.
a) In the print dialog you can temporarily override the default print job format for a single print job b) In the printer options dialog you can override the default print job format for a single printer c) Under tools->options->print you can override the default print job format for all printers. Tidy up the restart dialog in passing Change-Id: Ibea94bab6a79c3590dbf34583013db4e2ac06f45
Diffstat (limited to 'vcl/unx')
-rw-r--r--vcl/unx/generic/printer/cupsmgr.cxx12
-rw-r--r--vcl/unx/generic/printer/jobdata.cxx6
2 files changed, 13 insertions, 5 deletions
diff --git a/vcl/unx/generic/printer/cupsmgr.cxx b/vcl/unx/generic/printer/cupsmgr.cxx
index e23aedcb6b05..a1d8d497e0a9 100644
--- a/vcl/unx/generic/printer/cupsmgr.cxx
+++ b/vcl/unx/generic/printer/cupsmgr.cxx
@@ -33,6 +33,8 @@
#include "rtl/ustrbuf.hxx"
+#include <officecfg/Office/Common.hxx>
+
#include <algorithm>
using namespace psp;
@@ -284,10 +286,11 @@ void CUPSManager::initialize()
if( pOpt )
{
m_bUseIncludeFeature = true;
- bUsePDF = true;
- if( m_aGlobalDefaults.m_nPSLevel == 0 && m_aGlobalDefaults.m_nPDFDevice == 0 )
- m_aGlobalDefaults.m_nPDFDevice = 1;
+ bUsePDF = officecfg::Office::Common::Print::Option::Printer::PDFAsStandardPrintJobFormat::get();
}
+
+ m_aGlobalDefaults.setDefaultBackend(bUsePDF);
+
// do not send include JobPatch; CUPS will insert that itself
// TODO: currently unknown which versions of CUPS insert JobPatches
// so currently it is assumed CUPS = don't insert JobPatch files
@@ -351,8 +354,7 @@ void CUPSManager::initialize()
aPrinter.m_aInfo.m_pParser = c_it->second.getParser();
aPrinter.m_aInfo.m_aContext = c_it->second;
}
- if( bUsePDF && aPrinter.m_aInfo.m_nPSLevel == 0 && aPrinter.m_aInfo.m_nPDFDevice == 0 )
- aPrinter.m_aInfo.m_nPDFDevice = 1;
+ aPrinter.m_aInfo.setDefaultBackend(bUsePDF);
aPrinter.m_aInfo.m_aDriverName = aBuf.makeStringAndClear();
aPrinter.m_bModified = false;
diff --git a/vcl/unx/generic/printer/jobdata.cxx b/vcl/unx/generic/printer/jobdata.cxx
index bd18b19ec279..385ed02426ae 100644
--- a/vcl/unx/generic/printer/jobdata.cxx
+++ b/vcl/unx/generic/printer/jobdata.cxx
@@ -269,4 +269,10 @@ bool JobData::constructFromStreamBuffer( void* pData, int bytes, JobData& rJobDa
return bVersion && bPrinter && bOrientation && bCopies && bContext && bMargin && bPSLevel && bPDFDevice && bColorDevice && bColorDepth;
}
+void JobData::setDefaultBackend(bool bUsePDF)
+{
+ if (bUsePDF && m_nPSLevel == 0 && m_nPDFDevice == 0)
+ m_nPDFDevice = 1;
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */