summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTeemu Katajisto <teemu.katajisto@digia.com>2012-05-10 08:54:28 (GMT)
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-03-28 07:56:34 (GMT)
commit1fa7deed0a6441b20493c49bb3d5b53e55a9bcae (patch)
tree7a04ee3a7e1305c05d4fc46c6f729b31c3c1164b /src
parentba059bc9f908c0794b8749948539a0a8a747f907 (diff)
downloadQt-1fa7deed0a6441b20493c49bb3d5b53e55a9bcae.zip
Qt-1fa7deed0a6441b20493c49bb3d5b53e55a9bcae.tar.gz
Qt-1fa7deed0a6441b20493c49bb3d5b53e55a9bcae.tar.bz2
printsupport: set duplex setting correctly to CUPS printer
If CUPS printer default is not DuplexNone then setting duplex to None for printer did not have any effect on duplex setting. (backported from qtbase/385e584926f2957d6e9ec4c2c4e89b37a5e0c80c) Change-Id: Ia72f599a9e5fa511b3214c6b8016e21f40409b86 Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Diffstat (limited to 'src')
-rw-r--r--src/gui/painting/qpdf.cpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/gui/painting/qpdf.cpp b/src/gui/painting/qpdf.cpp
index 304d237..7a23f17 100644
--- a/src/gui/painting/qpdf.cpp
+++ b/src/gui/painting/qpdf.cpp
@@ -1855,22 +1855,22 @@ void QPdfBaseEnginePrivate::closePrintDevice()
options.append(QPair<QByteArray, QByteArray>("Collate", "True"));
}
- if (duplex != QPrinter::DuplexNone) {
- switch(duplex) {
- case QPrinter::DuplexNone: break;
- case QPrinter::DuplexAuto:
- if (orientation == QPrinter::Portrait)
- options.append(QPair<QByteArray, QByteArray>("sides", "two-sided-long-edge"));
- else
- options.append(QPair<QByteArray, QByteArray>("sides", "two-sided-short-edge"));
- break;
- case QPrinter::DuplexLongSide:
+ switch (duplex) {
+ case QPrinter::DuplexNone:
+ options.append(QPair<QByteArray, QByteArray>("sides", "one-sided"));
+ break;
+ case QPrinter::DuplexAuto:
+ if (orientation == QPrinter::Portrait)
options.append(QPair<QByteArray, QByteArray>("sides", "two-sided-long-edge"));
- break;
- case QPrinter::DuplexShortSide:
+ else
options.append(QPair<QByteArray, QByteArray>("sides", "two-sided-short-edge"));
- break;
- }
+ break;
+ case QPrinter::DuplexLongSide:
+ options.append(QPair<QByteArray, QByteArray>("sides", "two-sided-long-edge"));
+ break;
+ case QPrinter::DuplexShortSide:
+ options.append(QPair<QByteArray, QByteArray>("sides", "two-sided-short-edge"));
+ break;
}
if (QCUPSSupport::cupsVersion() >= 10300 && orientation == QPrinter::Landscape) {